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.

A030471 Primes which are concatenations of four consecutive numbers.

Original entry on oeis.org

4567, 14151617, 20212223, 34353637, 58596061, 64656667, 118119120121, 140141142143, 148149150151, 176177178179, 196197198199, 218219220221, 220221222223, 236237238239, 238239240241, 268269270271, 278279280281
Offset: 1

Views

Author

Keywords

Comments

There are no primes which are concatenations of three consecutive numbers (A001703), in fact all such concatenations are divisible by 3. - Zak Seidov, Oct 25 2014

Crossrefs

Programs

  • Mathematica
    A279204[n_] := FromDigits[Flatten[IntegerDigits[Range[n, n + 3]]]];
    Select[Array[A279204, 500], PrimeQ] (* Paolo Xausa, Aug 26 2024 *)
  • PARI
    lista(nn) = for(n=1, nn, if (isprime(q=eval(concat(concat(concat(Str(n), Str(n+1)), Str(n+2)), Str(n+3)))), print1(q, ", "))); \\ Michel Marcus, Oct 26 2014
    
  • Python
    from sympy import isprime
    from itertools import count, islice
    def agen(): # generator of terms
        strs = ["1", "2", "3", "4"]
        for k in count(1):
            if isprime(t:=int("".join(strs))): yield t
            strs = strs[1:] + [str(k+4)]
    print(list(islice(agen(), 20))) # Michael S. Branicky, Aug 26 2024

Extensions

Edited by Charles R Greathouse IV, Apr 23 2010