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.

A036013 a(n) = smallest number > 1 such that a(1)a(2)...a(n) - 1 is prime (or 1).

Original entry on oeis.org

2, 2, 2, 3, 2, 4, 2, 3, 6, 4, 5, 5, 5, 10, 4, 3, 5, 8, 22, 13, 14, 2, 5, 5, 2, 20, 9, 9, 24, 5, 26, 15, 14, 25, 25, 4, 9, 30, 9, 21, 12, 11, 10, 2, 40, 19, 8, 13, 11, 50, 3, 25, 25, 8, 5, 25, 46, 19, 47, 54, 9, 13, 14, 43, 4, 24, 28, 16, 33, 25, 152, 2, 11, 22, 6, 78, 87, 7, 10, 21
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. A036012, A058000 (corresponding primes).

Programs

  • Mathematica
    sng1[{t_,a_}]:=Module[{k=2},While[CompositeQ[t k-1],k++];{t*k,k}]; NestList[sng1,{2,2},80][[;;,2]] (* Harvey P. Dale, May 20 2023 *)
  • Python
    from sympy import isprime
    from itertools import count
    a,p = [2],2
    for _ in range(100):
        q = next(filter(lambda x:isprime(x*p-1), count(2)))
        p = p*q
        a.append(q)
    print(a) # Nicholas Stefan Georgescu, Mar 06 2023

Extensions

More terms from Erich Friedman. More terms from Jud McCranie, Jan 26 2000.