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.

A060646 Bonse sequence: a(n) = minimal j such that n-j+1 < prime(j).

Original entry on oeis.org

1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 18, 18
Offset: 1

Views

Author

Frank Ellermann, Apr 17 2001

Keywords

Comments

For 35.

Examples

			For n=5, j=3 gives 5-3+1 = 3 < prime(3) = 5, true; but if j=2 we get 5-2+1 = 4 which is not < prime(2) = 3; hence a(5) = 3.
a(75)=18 because 75-18+1=58 < 61=prime(18), but 75-17+1=59=prime(17).
		

References

  • R. Remak, Archiv d. Math. u. Physik (3) vol. 15 (1908) 186-193

Crossrefs

Cf. A014688.

Programs

  • Haskell
    import Data.List (findIndex)
    import Data.Maybe (fromJust)
    a060646 n = (fromJust $ findIndex ((n+1) <) a014688_list) + 1
    -- Reinhard Zumkeller, Sep 16 2011
    
  • Mathematica
    Table[j=0; While[j++; n-j+1 >= Prime[j]]; j, {n, 1, 76}] (* Jean-François Alcover, Aug 30 2011 *)
  • Python
    from sympy import nextprime
    from itertools import count, islice
    def agen(): # generator of terms
        n, pj = 1, 2
        for j in count(1):
            while n - j + 1 < pj: yield j; n += 1
            pj = nextprime(pj)
    print(list(islice(agen(), 76))) # Michael S. Branicky, Aug 09 2022