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.

A103404 The 10^n-th palindromic prime.

Original entry on oeis.org

2, 191, 94049, 114232411, 13649694631, 1565887885651, 175606737606571, 19508150605180591
Offset: 0

Views

Author

Robert G. Wilson v, Feb 03 2005

Keywords

Examples

			2, 3, 5, 7, 11, 101, 131, 151, 181 and 191 are the first ten palindromic primes.
		

Crossrefs

Cf. A083816.

Programs

  • Mathematica
    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]]]] ]]]];
    pal = 0; Do[pal = NextPalindrome[pal]; Do[While[pal = NextPalindrome[pal]; ! PrimeQ[pal], ], {i, 10^(n - 1) + 1, 10^n}]; Print[pal], {n, 0, 8}]

Extensions

a(7) from Donovan Johnson, Aug 25 2012