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.

A006992 Bertrand primes: a(n) is largest prime < 2*a(n-1) for n > 1, with a(1) = 2.

Original entry on oeis.org

2, 3, 5, 7, 13, 23, 43, 83, 163, 317, 631, 1259, 2503, 5003, 9973, 19937, 39869, 79699, 159389, 318751, 637499, 1274989, 2549951, 5099893, 10199767, 20399531, 40799041, 81598067, 163196129, 326392249, 652784471, 1305568919, 2611137817
Offset: 1

Views

Author

Keywords

Comments

a(n) < a(n+1) by Bertrand's postulate (Chebyshev's theorem). - Jonathan Sondow, May 31 2014
Let b(n) = 2^n - a(n). Then b(n) >= 2^(n-1) - 1 and b(n) is a B_2 sequence: 0, 1, 3, 9, 19, 41, 85, 173, 349, ... - Thomas Ordowski, Sep 23 2014 See the link for B_2 sequence.
These primes can be obtained of exclusive form using a restricted variant of Rowland's prime-generating recurrence (A106108), making gcd(n, a(n-1)) = -1 when GCDs are greater than 1 and less than n (see program). These GCDs are also a divisor of each odd number from a(n) + 2 to 2*a(n-1) - 1 in reverse order, so that this subtraction with -1's invariably leads to the prime. - Manuel Valdivia, Jan 13 2015
First row of array in A229607. - Robert Israel, Mar 31 2015
Named after the French mathematician Joseph Bertrand (1822-1900). - Amiram Eldar, Jun 10 2021

References

  • Martin Aigner and Günter M. Ziegler, Proofs from The Book, Springer-Verlag, Berlin, 1999; see p. 7.
  • Martin Griffiths, The Backbone of Pascal's Triangle, United Kingdom Mathematics Trust (2008), page 115. [From Martin Griffiths, Mar 28 2009]
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 344.
  • Ivan Niven and Herbert S. Zuckerman, An Introduction to the Theory of Numbers. 2nd ed., Wiley, NY, 1966, p. 189.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A185231 for another version.

Programs

  • Haskell
    a006992 n = a006992_list !! (n-1)
    a006992_list = iterate (a007917 . (* 2)) 2
    -- Reinhard Zumkeller, Sep 17 2014
    
  • Maple
    A006992 := proc(n) option remember; if n=1 then 2 else prevprime(2*A006992(n-1)); fi; end;
  • Mathematica
    bertrandPrime[1] = 2; bertrandPrime[n_] := NextPrime[ 2*a[n - 1], -1]; Table[bertrandPrime[n], {n, 40}]
    (* Second program: *)
    NestList[NextPrime[2#, -1] &, 2, 40] (* Harvey P. Dale, May 21 2012 *)
    k = 3; a[n_] := If[GCD[n,k] > 1 && GCD[n, k] < n, -1, GCD[n, k]]; Select[Differences@Table[k = a[n] + k, {n, 2611137817}], # > 1 &] (* Manuel Valdivia, Jan 13 2015 *)
  • PARI
    print1(t=2);for(i=2,60,print1(", "t=precprime(2*t))) \\ Charles R Greathouse IV, Apr 01 2013
    
  • Python
    from sympy import prevprime
    l = [2]
    for i in range(1, 51):
        l.append(prevprime(2 * l[i - 1]))
    print(l) # Indranil Ghosh, Apr 26 2017

Formula

a(n+1) = A007917(2*a(n)). - Reinhard Zumkeller, Sep 17 2014
Limit_{n -> infinity} a(n)/2^n = 0.303976447924... - Thomas Ordowski, Apr 05 2015

Extensions

Definition completed by Jonathan Sondow, May 31 2014
B_2 sequence link added by Wolfdieter Lang, Oct 09 2014