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.

This page as a plain text file.
%I A138264 #9 May 12 2017 15:40:59
%S A138264 150571,998353,1719517,3942889,4476187,5290699,5651869,6041701,
%T A138264 6089521,6553117,8018089,9046627,9606349,10990489,11460859,11466769,
%U A138264 12573283,12997483,13082617,13152817,13334701,14774971,16240597,16319179,17335501,17445397,18814261
%N A138264 Balanced prime numbers n such that n*(n-1)+1 is a balanced prime.
%t A138264 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]
%t A138264 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 *)
%Y A138264 Cf. A006562.
%K A138264 nonn
%O A138264 1,1
%A A138264 _Vladimir Joseph Stephan Orlovsky_, May 05 2008
%E A138264 a(11)-a(27) from _Donovan Johnson_, Aug 24 2011