I was reading yesterday when I came across the history of counting. There was some evidence of an early understanding of prime numbers. I thought that I would try changing the definition of primality from something like:
domain: Z+ except 1. P is prime if the only way to express it as A*B is P*1 for any integers A and B.
to something like:
domain: Z+ except 1. P is prime if the only way to express it as A^B is P^1 for any integers A and B.
(Notice the operation change from '*' to '^'.) I am just wondering what this more general definition, replacing factors with hyper roots, is called. I have written a (hugely inefficient) Java program that raises every base A to every power B where A < P and B < P to check the primality of P. So far I have found that this 'hyperprimality' is much more common than regular primality. (Also, 4 is always 'hypercomposite': 4 = 2 ^^^...^ 2 in up-arrow notation).
So I ask you: What is this called and where can I find out more?
Just a quick comment on your java program.... To see if you can find a $B$ so that $$P = A^B$$ you can first check if $$\gcd(A,P) = A$$ If this is not true, then you can skip all the trials.
If you can quickly estimate $\log_2 P$ and $\log_2 A$, then you have an estimate on $B$. So you do not need try all the powers.
Finally, if you know $B>B_0$ then you can quickly calculate $A^{B_0}$ very efficiently by divide and conquer algorithm. If you don't mind recursion, the code will look look like this (the code is more like C/C++ than Java