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.

A138264 Balanced prime numbers n such that n*(n-1)+1 is a balanced prime.

Original entry on oeis.org

150571, 998353, 1719517, 3942889, 4476187, 5290699, 5651869, 6041701, 6089521, 6553117, 8018089, 9046627, 9606349, 10990489, 11460859, 11466769, 12573283, 12997483, 13082617, 13152817, 13334701, 14774971, 16240597, 16319179, 17335501, 17445397, 18814261
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A006562.

Programs

  • Mathematica
    NextPrime[n_Int]:=Module[{k},k=n+1;While[ !PrimeQ[k],k++ ];k];PrevPrime[n_Int]:=Module[{k},k=n-1;While[ !PrimeQ[k],k-- ];k];s="";For[i=2,i< 10^5*5,p=Prime[i];If[(Prime[i-1]+Prime[i+1])/2==p,r=p*(p-1)+1;a=PrevPrime[r];b=NextPrime[r];If[PrimeQ[r]&&r==(a+b)/2,(*Print[p, ":", a, ",", b, ";", r]*)s=s<>ToString[p]<>","]];i++ ];Print[s]
    bpnQ[{a_,b_,c_}]:=Module[{d=b(b-1)+1,e,f},e=NextPrime[d,-1];f= NextPrime[ d]; (a+c)/2==b&&PrimeQ[d]&&(e+f)/2==d]; Select[Partition[Prime[ Range[ 1200000]],3,1],bpnQ][[All,2]] (* Harvey P. Dale, May 12 2017 *)

Extensions

a(11)-a(27) from Donovan Johnson, Aug 24 2011