OFFSET
1,1
COMMENTS
Every prime > 5 in base 10 ends in 1, 3, 7, or 9. If those digits are repeated, in order, some prefixes of that string are prime.
n such that floor(1379/9999 * 10^n) is prime. - Robert Israel, Sep 09 2014
a(13) > 15500. - Daniel Starodubtsev, Mar 16 2021
EXAMPLE
1 and 3 are the first two digits of the string, and 13 is prime. 13 has length 2, so 2 is a term.
137 is prime and three digits long, so 3 is a term.
1379137 is prime and seven digits long, so 7 is a term.
MATHEMATICA
Select[Range[4300], PrimeQ[FromDigits[PadRight[{}, #, {1, 3, 7, 9}]]]&] (* The program generates the first 12 terms of the sequence. *) (* Harvey P. Dale, Jun 11 2024 *)
PROG
(Python)
from sympy import isprime
from itertools import cycle
it=cycle([1, 3, 7, 9])
c=0
a=0
for i in it:
....c+=1
....a*=10
....a+=i
....if isprime(a):
........print c
(PARI) lista(nn) = {s = 0; digs = [1, 3, 7, 9]; id = 1; for (n=1, nn, s = 10*s + digs[id]; if (isprime(s), print1(n, ", ")); id++; if (id==5, id = 1); ); } \\ Michel Marcus, Oct 11 2014
(Magma) [n: n in [0..300] | IsPrime(Floor(1379/9999 * 10^n))]; // Vincenzo Librandi, Oct 17 2014
CROSSREFS
KEYWORD
nonn,base,more,less
AUTHOR
Mark E. Shoulson, Sep 09 2014
EXTENSIONS
Edited. Name specified. Example reformulated. a(12) added (using R. Israel's formula). Keyword less and Crossreferences added. - Wolfdieter Lang, Nov 03 2014
a(13)-a(14) from Michael S. Branicky, May 29 2023
a(15) from Michael S. Branicky, Jun 13 2024
STATUS
approved