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

%I #7 Mar 31 2012 12:38:14

%S 113921,114083,375163,760933,1065893,1432583,2362153,2935453,3294293,

%T 3390719,3591781,3699011,3981119,4489273,5371801,5780513,6233693,

%U 6297223,6470231,6830041,6982021,7036193,7164673,7490221,8266229,8577623,8608291,8698241,8805163

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

%t 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*2,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]

%Y Cf. A006562.

%K nonn

%O 1,1

%A _Vladimir Joseph Stephan Orlovsky_, May 05 2008

%E a(8)-a(29) from _Donovan Johnson_, Aug 24 2011