login
Smallest prime whose decimal expansion begins (nontrivially) with the n-th prime.
5

%I #14 Jan 30 2020 04:50:18

%S 23,31,53,71,113,131,173,191,233,293,311,373,419,431,479,5323,593,613,

%T 673,719,733,797,839,8923,971,1013,1031,10711,1091,11311,1277,1319,

%U 1373,1399,1493,1511,1571,1637,16729,1733,17911,1811,1913,1931

%N Smallest prime whose decimal expansion begins (nontrivially) with the n-th prime.

%C Add digits to p (starting with a nonzero digit) until another prime is reached.

%H Robert Israel, <a href="/A030670/b030670.txt">Table of n, a(n) for n = 1..10000</a>

%p f:= proc(p) local d,x;

%p for d from 1 do

%p x:= nextprime(10^d*p+10^(d-1)-1);

%p if x < 10^d*(p+1) then return x fi

%p od

%p end proc:

%p map(f @ ithprime, [$1..100]); # _Robert Israel_, Aug 12 2018

%t f[n_] := Block[{k = 1, p = Prime@ n}, While[a = 10^Floor[1 + Log10@ k] p + k; !PrimeQ@ a, k += 2]; a]; Array[f, 44]

%Y See A064792 for another version. Note that A064792 <= a(n). Cf. A065112.

%K nonn,base

%O 1,1

%A _Patrick De Geest_