cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A247025 Lengths of prefixes of the infinite string of digits repeat(1379) that are prime.

Original entry on oeis.org

2, 3, 7, 81, 223, 250, 255, 537, 543, 1042, 2103, 4285, 25015, 35361, 43525
Offset: 1

Views

Author

Mark E. Shoulson, Sep 09 2014

Keywords

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

Examples

			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.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..300] | IsPrime(Floor(1379/9999 * 10^n))]; // Vincenzo Librandi, Oct 17 2014
  • 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 *)
  • 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
    
  • 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)
    

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