|
|
A133583
|
|
Index of smallest prime number where n consecutive leading digits of the index match n consecutive leading digits in the prime.
|
|
9
|
|
|
|
OFFSET
|
1,1
|
|
COMMENTS
|
Puzzle 217 on Carlos Rivera's The Prime Puzzles & Problems Connection has anticipated some of the concepts of this sequence. Several people have contributed to this puzzle and some of its terms may be seen there. In particular, the first page of the puzzle includes a term in this sequence.
|
|
LINKS
|
Carlos Rivera's The Prime Puzzles & Problems Connection, Puzzle 217
|
|
FORMULA
|
|
|
EXAMPLE
|
a(2)=5591 because this is the index of prime 55001 where n=2 and 55 in the index matches the first two leading digits of the prime.
|
|
MAPLE
|
local p, i, dgsi, dgsp, d, wrks;
p := 2 ;
for i from 1 do
dgsi := convert(i, base, 10) ;
dgsp := convert(p, base, 10) ;
if nops(dgsi) >= n and nops(dgsp) >= n then
wrks := true;
for d from 1 to n do
if op(-d, dgsi) <> op(-d, dgsp) then
wrks := false ;
break;
end if;
end do:
if wrks then
return i;
end if;
end if;
p := nextprime(p) ;
end do:
|
|
MATHEMATICA
|
Table[ind = 10^(n - 1); While[Take[IntegerDigits[ind], n] !=
Take[IntegerDigits[Prime[ind]], n], ind++]; ind, {n, 1, 4}] (* Robert Price, Apr 11 2019 *)
|
|
CROSSREFS
|
|
|
KEYWORD
|
more,nonn,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|