A060848 Difference between a nontrivial prime power (A025475) and the next prime.
1, 3, 2, 1, 4, 2, 5, 4, 3, 2, 6, 2, 3, 4, 8, 1, 4, 4, 6, 9, 12, 6, 4, 12, 6, 7, 30, 4, 12, 12, 5, 16, 6, 4, 10, 10, 12, 10, 6, 3, 4, 6, 10, 4, 6, 2, 4, 10, 6, 17, 4, 10, 4, 18, 6, 30, 12, 12, 4, 10, 27, 4, 6, 4, 12, 4, 28, 6, 2, 10, 4, 4, 10, 12, 18, 10, 10, 3, 12, 4, 12, 6, 10, 10, 18, 10, 12
Offset: 1
Keywords
Examples
78125=5^7 is followed by 78137, the difference is 12.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Programs
-
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 *)
Comments