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.

A046941 Palindromic primes whose indices n are also palindromes.

This page as a plain text file.
%I A046941 #40 Feb 16 2025 08:32:39
%S A046941 2,3,5,7,11,143787341,11853735811,126537757735621
%N A046941 Palindromic primes whose indices n are also palindromes.
%H A046941 Chris K. Caldwell and G. L. Honaker, Jr., <a href="https://primes.utm.edu/curios/page.php?short=143787341">143787341</a>
%H A046941 Carl Pomerance, <a href="https://www.math.dartmouth.edu/~carlp/illinoistalk1.pdf">What we still don't know about addition and multiplication</a>, Trjitzinsky Lecture 1, U. Illinois Urbana-Champaign, November 27, 2018. See slides 22 & 24.
%H A046941 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PalindromicPrime.html">Palindromic Prime.</a>
%F A046941 a(n) = prime(A046942(n)).
%t A046941 NextPalindrome[n_] := Block[ {l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]}, If[ Union[ idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[ FromDigits[ Reverse[ Take[ idn, Ceiling[l/2]]]] FromDigits[ Take[ idn, -Ceiling[l/2]]], FromDigits[ Join[ Take[ idn, Ceiling[l/2]], Reverse[ Take[ idn, Floor[l/2]]] ]], idfhn = FromDigits[ Take[ idn, Ceiling[l/2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[ idfhn], Drop[ Reverse[ IntegerDigits[ idfhn]], Mod[l, 2]]]] ]]]];
%t A046941 p = 0; Do[p = NextPalindrome[p]; While[ !PrimeQ[p], p = NextPalindrome[ p]]; q = IntegerDigits[ PrimePi[ p]]; If[Reverse[q] == q, Print[{p, FromDigits[q]}]], {n, 10^4}] (* _Robert G. Wilson v_, Feb 03 2005 *)
%t A046941 palQ[n_] := Reverse[x = IntegerDigits[n]] == x; t = {}; Do[p = Prime[i]; If[palQ[i] && palQ[p], AppendTo[t, p]], {i, 9*10^6}]; t (* _Jayanta Basu_, Jun 23 2013 *)
%o A046941 (PARI) ispal(n) = my(d=digits(n)); d == Vecrev(d);
%o A046941 isok(p) = isprime(p) && ispal(p) && ispal(primepi(p)); \\ _Michel Marcus_, Jan 27 2019
%Y A046941 Cf. A046942, A103357, A103358, A103402, A103403.
%K A046941 nonn,base,more
%O A046941 1,1
%A A046941 _Carlos Rivera_
%E A046941 a(7) from _Giovanni Resta_, May 14 2003
%E A046941 a(8) from _Giovanni Resta_, Aug 10 2019