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.

A035092 Smallest k such that (n^2)*k + 1 is prime.

Original entry on oeis.org

1, 1, 2, 1, 4, 1, 4, 3, 2, 1, 6, 3, 4, 1, 8, 1, 12, 4, 30, 1, 2, 3, 24, 1, 18, 1, 2, 4, 12, 2, 16, 12, 2, 3, 6, 1, 4, 13, 6, 1, 10, 2, 12, 6, 2, 6, 4, 8, 6, 9, 6, 9, 28, 1, 4, 1, 10, 3, 6, 4, 46, 4, 4, 3, 4, 1, 4, 3, 22, 6, 10, 2, 4, 1, 2, 7, 22, 3, 6, 4, 6, 3, 10, 1, 4, 3, 2, 4, 6, 1, 10, 4, 2, 1
Offset: 1

Views

Author

Keywords

Examples

			a(40) = 1 because in 1600k + 1 at k = 1, 1601 is the smallest prime;
a(61) = 46 because in the 46*46*k + 1 sequence the first prime appears at k = 46; it is 171167.
		

Crossrefs

Analogous case is A034693. See also A005574 and A002496.

Programs

  • Mathematica
    Table[k = 1; While[! PrimeQ[k (n^2) + 1], k++]; k, {n, 94}] (* Michael De Vlieger, Dec 17 2016 *)
  • PARI
    a(n)=k=1;while(!isprime(k*n^2+1),k++);k
    vector(100,n,a(n)) \\ Derek Orr, Oct 01 2014