login
a(n) = smallest prime in which n substrings containing the most significant digit are primes.
4

%I #10 Sep 23 2023 03:15:47

%S 2,23,233,2333,23333,233993,2339933,23399339,1979339333,23339531339,

%T 293999994791,3733799959397,233323747999733,2333939994739931,

%U 23833939369399333,238339393693993337,23833939369399333613

%N a(n) = smallest prime in which n substrings containing the most significant digit are primes.

%C Agrees with A127889 for 8 terms, but A127889 ends there while this sequence continues. - _Ray Chandler_, Mar 13 2007

%o (PARI) f(n, d, spare) = local(p, r); if (!d, return(n)); for (i = 0, 9, p = 10*n + i; if (isprime(p) || spare, r = f(p, d - 1, spare - 1 + isprime(p))); if (r, return(r))); 0;

%o a(n) = local(i, r); i = 0; while (1, r = f(0, n + i, i); if (r, return(r), i++)); \\ _David Wasserman_, Aug 12 2005

%Y Cf. A088604, A127889.

%K base,nonn

%O 1,1

%A _Amarnath Murthy_, Oct 15 2003

%E Corrected and extended by _David Wasserman_, Aug 12 2005