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!)
A124232 Numbers n such that prime(n) and pi(n) are palindromic. 0

%I #15 Sep 19 2019 21:44:08

%S 1,2,3,4,5,26,32,36,138,3691,6987,7193,86969,117766,127150,142583,

%T 515786,531448,539596,615980,646060,17262354,39816443,47548105,

%U 48803361,49426747,528977302,538348374,1475057753,1559827952,2994135736,60040412496,64516992534,333771325433,11655934712628,21872729899659,22903935103276,28311805106395,29606335619415

%N Numbers n such that prime(n) and pi(n) are palindromic.

%t NextPalindrome[n_] := Block[{lg = Floor@ Log[10, n] + 1, idn = IntegerDigits@n}, If[Union@ idn == {9}, Return[n + 2], If[lg < 2, Return[n + 1], If[ FromDigits@ Reverse@ Take[idn, Ceiling[lg/2]] > FromDigits@ Take[idn, -Ceiling[lg/2]], FromDigits@ Join[ Take[idn, Ceiling[lg/2]], Reverse@ Take[idn, Floor[lg/2]]], idfhn = FromDigits@ Take[idn, Ceiling[lg/2]] + 1; idp = FromDigits@ Join[IntegerDigits@ idfhn, Drop[ Reverse@ IntegerDigits@ idfhn, Mod[lg, 2]]] ]]]];

%t palQ[n_Integer] := Module[{idn = IntegerDigits@n}, idn == Reverse@ idn]; lst = {}; k = 1; While[k < 10^12, If[ PrimeQ@k && palQ@PrimePi@PrimePi@k, Print@PrimePi@k; AppendTo[lst, PrimePi@k]]; k = NextPalindrome@k]; lst (* _Robert G. Wilson v_ *)

%Y Subsequence of A075807 = numbers n such that n-th prime is palindromic.

%K base,nonn

%O 1,2

%A _Tanya Khovanova_, Dec 13 2006

%E a(22) - a(31) from _Robert G. Wilson v_, Dec 14 2006

%E a(32)-a(33) from _Donovan Johnson_, Jul 19 2012

%E a(34) from _Chai Wah Wu_, Sep 12 2019

%E a(35)-a(39) from _Chai Wah Wu_, Sep 19 2019

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 March 19 01:57 EDT 2024. Contains 370952 sequences. (Running on oeis4.)