OFFSET
0,1
COMMENTS
Conjecture: the sequence is infinite (number of nonprime powers between consecutive primes is arbitrarily large; see A014963).
EXAMPLE
a(2) = 13 because between 13 and 17 there are three composite numbers, only one of which (16) is a prime power, and no previous prime has this property.
a(5) = 53 because between 53 and 59 there are 5 composite numbers, none of which are prime powers, and no smaller prime has this property.
MATHEMATICA
p = q = 2; r = a[_] = 0; Do[q = NextPrime[q]; If[a[#] == 0, a[#] = p; If[# > r, r = #]] &@ Count[Range[p, q - 1], _?(Not@*PrimePowerQ)]; p = q, {i, 2^16}]; {2}~Join~TakeWhile[Array[a, r], # > 0 &] (* Michael De Vlieger, Jan 04 2024 *)
PROG
(PARI) f(p) = sum(k=p+1, nextprime(p+1)-1, !isprimepower(k));
a(n) = my(p=2); while(f(p) != n, p=nextprime(p+1)); p; \\ Michel Marcus, Jan 04 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
David James Sycamore and Michael De Vlieger, Jan 04 2024
EXTENSIONS
More terms from Michel Marcus, Jan 04 2024
STATUS
approved