Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A103404
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A103404 The 10^n-th palindromic prime. +0
2
2, 191, 94049, 114232411, 13649694631, 1565887885651, 175606737606571 (list; graph; listen)
OFFSET

0,1

EXAMPLE

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

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}]

CROSSREFS

Cf. A083816.

Sequence in context: A053936 A085937 A142890 this_sequence A151709 A064682 A139949

Adjacent sequences: A103401 A103402 A103403 this_sequence A103405 A103406 A103407

KEYWORD

base,nonn

AUTHOR

Robert G. Wilson v (rgwv(AT)rgwv.com), Feb 03 2005

page 1

Search completed in 0.002 seconds

Lookup | Welcome | Find friends | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Transforms | Puzzles | Hot | Classics
More pages | Superseeker | Maintained by N. J. A. Sloane (njas@research.att.com)

Last modified November 27 22:38 EST 2009. Contains 167602 sequences.


AT&T Labs Research