OFFSET
1,1
COMMENTS
If b is the largest integer such that n=a^b for some a > 1, then n occurs d(b)-1 times in this sequence (where d = A000005 is the number of divisors function). (This includes the case where b=1 and n does not occur in the sequence.) - M. F. Hasler, Jan 25 2015
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..9999, recomputed with new offset by M. F. Hasler, Jan 25 2015
Eric Weisstein's World of Mathematics, Perfect Power
FORMULA
Sum_{i>=2} Sum_{j>=2} 1/i^j = 1.
EXAMPLE
(a,b) = (2,4) and (4,2) both yield 2^4 = 4^2 = 16, therefore 16 is listed twice.
Similarly, 64 is listed 3 times since (a,b) = (2,6), (4,3) and (8,2) all yield 64.
MAPLE
N:= 2000: # to get all entries <= N
sort([seq(seq(a^b, b = 2 .. floor(log[a](N))), a = 2 .. floor(sqrt(N)))]); # Robert Israel, Jan 25 2015
MATHEMATICA
nn=60; Take[Sort[#[[1]]^#[[2]]&/@Tuples[Range[2, nn], 2]], nn] (* Harvey P. Dale, Oct 03 2012 *)
PROG
(Haskell)
import Data.Set (singleton, findMin, deleteMin, insert)
a072103 n = a072103_list !! (n-1)
a072103_list = f 9 3 $ Set.singleton (4, 2) where
f zz z s
| xx < zz = xx : f zz z (Set.insert (x*xx, x) $ Set.deleteMin s)
| otherwise = zz : f (zz+2*z+1) (z+1) (Set.insert (z*zz, z) s)
where (xx, x) = Set.findMin s
-- Reinhard Zumkeller, Oct 04 2012
(PARI) is_A072103(n)=ispower(n)
for(n=1, 999, (e=ispower(n))||next; fordiv(e, d, d>1 && print1(n", "))) \\ M. F. Hasler, Jan 25 2015
(Python)
import numpy
from math import isqrt
upto = 1090
A072103 = []
for m in range(2, isqrt(upto)+1):
k = 2
while m**k < upto:
A072103.append(m**k)
k += 1
print(sorted(A072103)) # Karl-Heinz Hofmann, Sep 16 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Eric W. Weisstein, Jun 18 2002
EXTENSIONS
Offset corrected and examples added by M. F. Hasler, Jan 25 2015
STATUS
approved