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!)
A228566 a(n) is the smallest prime of more than n digits such that the number formed by first n digits is same as the number formed by last n digits. 1
11, 11311, 18181, 1041041, 1212121, 1125112511, 323232323, 13513513513, 12121212121, 1021021021021, 17417417417417, 11005110051100511, 151515151515151, 11411411411411411, 38383838383838383, 1041041041041041041, 1111111111111111111, 1111111111111111111 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,1
LINKS
EXAMPLE
a(4) = 1041041 because 1041041 is the smallest prime with more than 4 digits that starts and ends with the same 4-digit number (here 1041).
MATHEMATICA
ric[ps_, w_] := Catch[Block[{n, d, r}, If[w == {}, Throw@If[PrimeQ[n = FromDigits@ps], n, 0], Do[If[(r = ric[ps /. w[[1, 1]] -> d, Rest@w]) > 0, Throw[r]], {d, w[[1, 2]]}]]; 0]]; try[nd_, k_] := Block[{v = Array[x, nd], w, s}, s = v /. ToRules@ Reduce[Take[v, k] == Take[v, -k]]; w = Table[{e, If[e === s[[-1]], {1, 3, 7, 9}, If[e === s[[1]], Range@9, Range[0, 9]]]}, {e, DeleteDuplicates@ s}]; ric[s, w]]; a[n_] := Block[{nd = n+1, v=0},
While[(v = try[nd, n]) == 0, nd++]; v]; Array[a, 20]
CROSSREFS
Cf. A228533.
Sequence in context: A034873 A075854 A050786 * A228533 A088103 A180561
KEYWORD
nonn,base
AUTHOR
Giovanni Resta, Aug 25 2013
STATUS
approved

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 July 18 00:08 EDT 2024. Contains 374377 sequences. (Running on oeis4.)