cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A060848 Difference between a nontrivial prime power (A025475) and the next prime.

This page as a plain text file.
%I A060848 #17 Oct 19 2022 09:07:49
%S A060848 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,
%T A060848 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,
%U A060848 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
%N A060848 Difference between a nontrivial prime power (A025475) and the next prime.
%C A060848 a(n)=1 only for some powers of 2 corresponding to Fermat primes > 3. - Edited by _Robert Israel_, Jun 03 2021
%H A060848 Robert Israel, <a href="/A060848/b060848.txt">Table of n, a(n) for n = 1..10000</a>
%F A060848 a(n) = nextprime(A025475(n)) - A025475(n) = A013632(A025475(n)).
%e A060848 78125=5^7 is followed by 78137, the difference is 12.
%p A060848 N:= 10^5: # for prime powers <= N
%p A060848 S:= {}:
%p A060848 p:= 1:
%p A060848 do
%p A060848   p:= nextprime(p);
%p A060848   if p^2 > N then break fi;
%p A060848   S:= S union {seq(p^i,i=2..floor(log[p](N)))}
%p A060848 od:
%p A060848 map(t -> nextprime(t)-t, sort(convert(S,list))); # _Robert Israel_, Jun 03 2021
%t A060848 NextPrime[#]-#&/@Select[Range[100000],PrimePowerQ[#]&&!PrimeQ[#]&] (* _Harvey P. Dale_, Oct 19 2022 *)
%Y A060848 Cf. A025475, A007918, A013632.
%K A060848 nonn
%O A060848 1,2
%A A060848 _Labos Elemer_, May 03 2001