Logo

Greetings from The On-Line Encyclopedia of Integer Sequences!

Hints

Search: id:A085054
Displaying 1-1 of 1 results found. page 1
     Format: long | short | internal | text      Sort: relevance | references | number      Highlight: on | off
A085054 Smallest palindromic prime containing the n-th palindrome. +0
2
101, 11, 2, 3, 11411, 5, 10601, 7, 181, 191, 11, 72227, 13331, 1444441, 15551, 16661, 77377, 78887, 19991, 101, 1114111, 1212121, 131, 11411, 151, 1611161, 1117111, 181, 191, 1120211, 1212121, 72227, 32323, 12421, 3252523, 1126211, 12721, 12821 (list; graph; listen)
OFFSET

0,1

EXAMPLE

1311131 contains the palindrome 111.

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]]]] ]]]]; f[n_] := Block[{k = 0, s = ToString[n]}, While[ !PrimeQ[k] || FromDigits[ Reverse[ IntegerDigits[k]]] != k || StringPosition[ ToString[k], s] == {}, k++ ]; k]; Map[f, NestList[ NextPalindrome, 0, 40]]

CROSSREFS

Cf. A002113, A085419.

Adjacent sequences: A085051 A085052 A085053 this_sequence A085055 A085056 A085057

Sequence in context: A126834 A060386 A062584 this_sequence A085419 A029948 A029949

KEYWORD

base,nonn

AUTHOR

Amarnath Murthy and Meenakshi Srikanth (amarnath_murthy(AT)yahoo.com), Jun 26 2003

EXTENSIONS

Edited, corrected and extended by Robert G. Wilson v (rgwv(AT)rgwv.com), Jun 28 2003

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 October 13 02:37 EDT 2008. Contains 145008 sequences.


AT&T Labs Research