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.

A037039 Least k such that 4*n*k+1 is a prime.

Original entry on oeis.org

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

Views

Author

Keywords

Examples

			a(5)=2 because for n=5: 4*5*2+1=41 is a prime.
		

Crossrefs

Cf. A016014.

Programs

  • Mathematica
    Table[Module[{k=1},While[!PrimeQ[4 n*k+1],k++];k],{n,110}] (* Harvey P. Dale, Aug 11 2025 *)
  • PARI
    a(n) = my(k = 0); while (! isprime(4*n*k+1), k++); k; \\ Michel Marcus, Sep 28 2013

Extensions

More terms from Erich Friedman