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.

A088732 First prime in the arithmetic progression n+k*(n+1) with k>0.

Original entry on oeis.org

2, 3, 5, 7, 19, 11, 13, 23, 17, 19, 43, 23, 103, 41, 29, 31, 67, 53, 37, 59, 41, 43, 137, 47, 149, 103, 53, 83, 173, 59, 61, 127, 131, 67, 139, 71, 73, 113, 233, 79, 163, 83, 257, 131, 89, 137, 281, 191, 97, 149, 101, 103, 211, 107, 109, 167, 113, 173, 353, 179
Offset: 0

Views

Author

Reinhard Zumkeller, Oct 12 2003

Keywords

Examples

			For n=10, the progression starts: 10, 21, 32, 43, 54, 65, 76, 87, 98, 109, etc., 43 is the first prime: a(10)=43.
		

Crossrefs

Cf. A088733.
Cf. A010051.

Programs

  • Haskell
    a088732 n = head [q | q <- [2 * n + 1, 3 * n + 2 ..], a010051' q == 1]
    -- Reinhard Zumkeller, Oct 01 2014
    
  • Mathematica
    Table[k = 1; While[p = n + k*(n + 1); ! PrimeQ[p], k++]; p, {n, 0, 100}] (* Frank M Jackson, Oct 20 2011 *)
  • Python
    from itertools import accumulate, repeat
    from sympy import isprime
    def A088732(n): return next(m for m in accumulate(repeat(n+1),initial=(n<<1)+1) if isprime(m)) # Chai Wah Wu, Aug 02 2023