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.

A354964 a(1) = 1, a(2) = 2, a(3) = 3; for n > 3, a(n) is the smallest new number such that the sum of any four successive terms is prime.

Original entry on oeis.org

1, 2, 3, 5, 7, 4, 13, 17, 9, 8, 19, 11, 15, 14, 21, 23, 25, 10, 31, 35, 27, 16, 29, 37, 45, 20, 47, 39, 33, 12, 43, 49, 53, 6, 41, 51, 59, 22, 61, 55, 73, 34, 65, 57, 67, 38, 71, 63, 69, 24, 77, 81, 75, 18, 83, 87, 89, 48, 93, 101, 95, 28
Offset: 1

Views

Author

Zak Seidov, Jun 13 2022

Keywords

Crossrefs

See A055265 and A076990 for similar sequences.

Programs

  • Mathematica
    s = {1, 2, 3}; Do[a = s[[-1]] + s[[-2]] + s[[-3]]; n = 4; While[MemberQ[s, n] || ! PrimeQ[a + n], n++]; AppendTo[s, n], {120}]; s
  • PARI
    { s = 0; for (n=1, #a = vector(62), if (n<=3, a[n]=n, for (v=1, oo, if (!bittest(s,v) && isprime(v+a[n-1]+a[n-2]+a[n-3]), a[n]=v; break))); print1 (a[n]", "); s+=2^a[n]) } \\ Rémy Sigrist, Jul 03 2022