login
Smallest prime power p^k (k >= 2) such that there is a difference of exactly n between p^k and some other prime power q^m (m >= 2); or 0 if no such q^m exists.
1

%I #20 Nov 02 2023 10:39:31

%S 8,25,125,4,4,0,9,8,16,2187,16,4,243,0,49,9,8,9,8,0,4,27,4,8,0,0,0,4,

%T 0,6859,0,32,16,0,0,0,27,1331,25,9,8,0,0,81,4,243,81,16,32,0,0,0,0,27,

%U 9,8,64,0,0,4,64,0,961,64,16,0,0,0,0,0,0,9,8,169,0,49,4,0,49,0,0,0,0,0,0

%N Smallest prime power p^k (k >= 2) such that there is a difference of exactly n between p^k and some other prime power q^m (m >= 2); or 0 if no such q^m exists.

%C Any solution for the terms that are currently zero is > 10^14. Since there are so many 'missing' values, I would recommend leaving the more keyword. - Larry Reeves (larryr(AT)acm.org), Jul 02 2002

%C The nonzero terms are sure terms, only the zero terms are conjectured. - _Michel Marcus_, Nov 02 2023

%e a(1) = 8 = 2^3 and 8 + 1 = 9 = 3^2;

%e a(3) = 125 = 5^3 and 125 + 3 = 128 = 2^7.

%o (PARI) lista(nn) = my(vpp=select(x->(isprimepower(x) && !isprime(x)), [2..10^4]), v=vector(nn)); for (i=1, #vpp, for (j=1, i-1, my(d = vpp[i] - vpp[j]); if ((d<=nn) && (!v[d] || (vpp[j]<v[d])), v[d] = vpp[j]););); v; \\ _Michel Marcus_, Oct 30 2023

%Y First time a difference of n occurs in A025475 (with its initial 1 deleted).

%K nonn

%O 1,1

%A _Amarnath Murthy_, Mar 24 2002

%E More terms from Larry Reeves (larryr(AT)acm.org), Jul 02 2002

%E Description corrected by _Karl W. Heuer_, Apr 08 2012