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.

A269485 Least k > 0 such that n! + k^2 is prime.

Original entry on oeis.org

1, 1, 1, 1, 7, 11, 7, 13, 17, 31, 13, 1, 47, 17, 19, 19, 23, 73, 43, 29, 47, 31, 43, 29, 31, 37, 167, 1, 29, 43, 79, 229, 89, 71, 137, 37, 53, 1, 79, 131, 137, 1, 71, 83, 89, 89, 53, 97, 53, 101, 59, 173, 79, 71, 353, 191, 103, 523, 229, 191, 103, 401, 67, 257
Offset: 0

Views

Author

Jean-Marc Rebert, Feb 28 2016

Keywords

Comments

a(n) = A033932(n) = 1 for n in A002981.

Examples

			a(4) = 7, because 4! + 7^2 = 73 is prime and for 0 < i < 7, 4! + i^2 is not prime.
		

Crossrefs

Programs

  • Mathematica
    Table[SelectFirst[Range@ 10000, PrimeQ[n! + #^2] &], {n, 120}]
    (* Version 10, or *)
    Table[k = 1; While[! PrimeQ[n! + k^2], k++]; k, {n, 120}] (* Michael De Vlieger, Feb 28 2016 *)
  • PARI
    a(n) = {my(k=1); while (!isprime(n! + k^2), k++); k;} \\ Michel Marcus, Feb 29 2016