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.

A070866 Smallest prime such that the difference of successive terms is nondecreasing.

Original entry on oeis.org

2, 3, 5, 7, 11, 17, 23, 29, 37, 47, 59, 71, 83, 97, 113, 131, 149, 167, 191, 223, 257, 293, 331, 373, 419, 467, 521, 577, 641, 709, 787, 877, 967, 1061, 1163, 1277, 1399, 1523, 1657, 1801, 1949, 2099, 2251, 2411, 2579, 2749, 2927, 3109, 3299, 3491, 3691, 3907
Offset: 1

Views

Author

Amarnath Murthy, May 16 2002

Keywords

Crossrefs

Cf. A070865.

Programs

  • Julia
    using Primes
    function A070866(bound)
        a, b = 2, 3
        P = [a, b]
        while true
            p = nextprime(b + (b - a))
            p > bound && break
            push!(P, p)
            a, b = b, p
        end
    P end
    A070866(100000) |> println # Peter Luschny, Dec 23 2019
  • Mathematica
    d = 2; p = 2; t = {2, 3}; Do[p = NextPrime[p + d - 1]; d = p - t[[-1]]; AppendTo[t, p], {98}]; t (* T. D. Noe, Nov 21 2011 *)
  • PARI
    s=1; t=1; for(n=1,100,s=s+t; while(isprime(s+t)==0,t++); print1(s+t,","))
    

Formula

a(1)=2, a(2)=3, a(n) = A007918(2*a(n-1) - a(n-2)). - Reinhard Zumkeller, Jul 08 2004

Extensions

More terms from Benoit Cloitre, May 20 2002