OFFSET
1,2
COMMENTS
a(n)=1 only for some powers of 2 corresponding to Fermat primes > 3. - Edited by Robert Israel, Jun 03 2021
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
EXAMPLE
78125=5^7 is followed by 78137, the difference is 12.
MAPLE
N:= 10^5: # for prime powers <= N
S:= {}:
p:= 1:
do
p:= nextprime(p);
if p^2 > N then break fi;
S:= S union {seq(p^i, i=2..floor(log[p](N)))}
od:
map(t -> nextprime(t)-t, sort(convert(S, list))); # Robert Israel, Jun 03 2021
MATHEMATICA
NextPrime[#]-#&/@Select[Range[100000], PrimePowerQ[#]&&!PrimeQ[#]&] (* Harvey P. Dale, Oct 19 2022 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, May 03 2001
STATUS
approved