login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A271394 1 and the prime powers (p^k, p prime, k >= 1) such that p^k - k and p^k + k are prime powers. 0

%I #20 Apr 12 2016 09:50:53

%S 1,2,3,8,9,25,32,512,6561,36703368217294125441230211032033660188801

%N 1 and the prime powers (p^k, p prime, k >= 1) such that p^k - k and p^k + k are prime powers.

%C a(10) = 7^48. If it exists, a(11) > 10^100. - _Giovanni Resta_, Apr 12 2016

%e 6561 is in this sequence because 6561 = 3^8, 6561 - 8 = 6553 is prime and 6561 + 8 = 6569 is prime.

%t nn = 10^6; {1}~Join~Sort@ Apply[Power, Select[Flatten[Function[k, {#, k}] /@ Range[Floor@ Log[#, nn]] & /@ Prime@ Range@ PrimePi@ nn, 1], With[{p = First@ #, k = Last@ #}, And[Or[PrimePowerQ@ #, # == 1] &[p^k - k], Or[PrimePowerQ@ #, # == 1] &[p^k + k]]] &], 1] (* _Michael De Vlieger_, Apr 06 2016 *)

%o (PARI) ispp(n) = (n==1) || isprimepower(n);

%o isok(n) = (n==1) || ((k=isprimepower(n)) && ispp(n+k) && ispp(n-k));

%o \\ _Michel Marcus_, Apr 07 2016

%Y Cf. A000961, A025474.

%K nonn,more

%O 1,2

%A _Juri-Stepan Gerasimov_, Apr 06 2016

%E a(10) from _Giovanni Resta_, Apr 12 2016

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified August 31 15:16 EDT 2024. Contains 375572 sequences. (Running on oeis4.)