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.

Showing 1-1 of 1 results.

A343070 a(1) = 1, for n > 1, a(n) is the smallest positive integer for which a(n-1) + n + a(n) is a prime.

Original entry on oeis.org

1, 2, 2, 1, 1, 4, 2, 1, 1, 2, 4, 1, 3, 2, 2, 1, 1, 4, 6, 3, 5, 2, 4, 1, 3, 2, 2, 1, 1, 6, 4, 1, 3, 4, 2, 3, 1, 2, 2, 1, 1, 4, 6, 3, 5, 2, 4, 1, 3, 6, 2, 5, 1, 4, 2, 1, 1, 2, 6, 1, 5, 4, 4, 3, 3, 2, 2, 1, 1, 2, 6, 1, 5, 4, 4, 3, 3, 2, 2, 1, 1, 6, 8
Offset: 1

Views

Author

Todor Szimeonov, Apr 04 2021

Keywords

Crossrefs

Cf. A343039.

Programs

  • Mathematica
    a[1] = 1; a[n_] := a[n] = NextPrime[a[n - 1] + n] - a[n - 1] - n; Array[a, 100] (* Amiram Eldar, Apr 04 2021 *)
  • Python
    from sympy import nextprime
    def aupton(terms):
      alst = [1]
      for n in range(2, terms+1):
        alst.append(nextprime(alst[-1] + n) - alst[-1] - n)
      return alst
    print(aupton(87)) # Michael S. Branicky, Apr 04 2021
Showing 1-1 of 1 results.