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.

Showing 1-2 of 2 results.

A143933 a(n) is the smallest prime x such that x^2-n! is also prime.

Original entry on oeis.org

2, 2, 3, 11, 19, 31, 79, 211, 607, 1931, 6337, 21961, 78919, 295291, 1143563, 4574149, 18859777, 80014843, 348776611, 1559776279, 7147792903, 33526120129, 160785623729, 787685471519, 3938427356629, 20082117944579, 104349745809137, 552166953567737
Offset: 1

Views

Author

Artur Jasinski, Sep 05 2008

Keywords

Comments

Every prime > 3 in this sequence is bigger than the n-th prime, see comment to A121926. For the smallest number x such that x^2-n! is prime see A143931. For the smallest prime numbers of the form x^2-n! see A143932.

Crossrefs

Programs

  • Maple
    f:= proc(n) local p,t;
      t:= n!;
      p:= floor(sqrt(t));
      do
        p:= nextprime(p);
        if isprime(p^2-t) then return p fi
      od
    end proc:
    map(f, [$1..28]); # Robert Israel, Feb 10 2019
  • Mathematica
    f[n_] := Block[{p = NextPrime[ Sqrt[ n!]]}, While[ !PrimeQ[p^2 - n!], p = NextPrime@ p]; p]; Array[f, 27] (* Robert G. Wilson v, Jan 08 2015 *)
  • PARI
    a(n)=my(N=n!,x=sqrtint(N)+1); while(!isprime(x^2-N), x=nextprime(x+1)); x \\ Charles R Greathouse IV, Dec 09 2014

Extensions

Corrected by Charles R Greathouse IV, Dec 09 2014

A143932 a(n) = smallest positive prime number of the form x^2 - n! (where x is a positive integer).

Original entry on oeis.org

3, 2, 3, 97, 241, 241, 1201, 3361, 5569, 61441, 240769, 915049, 240769, 17302321, 7076521, 49186201, 2100735289, 1074527281, 23971813321, 32354445841, 68820869329, 2992426816129, 26238323995129, 104071698229321
Offset: 1

Views

Author

Artur Jasinski, Sep 05 2008

Keywords

Comments

For smallest positive integers x see A143931. Prime x see A143933.

Examples

			a(1)=3 because 2^2 - 1! = 3;
a(2)=2 because 2^2 - 2! = 2;
a(3)=3 because 3^2 - 3! = 3;
a(4)=97 because 11^2 - 4! = 97.
		

Crossrefs

Programs

  • Mathematica
    b = {}; Do[k = Round[Sqrt[n! ]] + 1; While[ ! PrimeQ[k^2 - n! ], k++ ]; AppendTo[b, k^2-n! ], {n, 1, 50}]; b
Showing 1-2 of 2 results.