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.

A242568 Least number k >= 0 such that (n!+k)/(n+k) is prime.

Original entry on oeis.org

0, 1, 110, 1, 5026, 10070, 362862, 1, 39916778, 34, 6227020774, 25152407, 1307674367970, 50917, 355687428095966, 256443711659, 121645100408831962, 1286, 51090942171709439958, 111014413076599, 25852016738884976639954, 51704033477769953279974
Offset: 3

Views

Author

Derek Orr, May 17 2014

Keywords

Comments

a(n) <= n!-2n for all n. See A242567.
a(68) = 1526549.
Since 2 is prime, we see that (n!+k)/(n+k) = 2 when k = n!-2n, which is an integer. Thus, a(n) will always be nonzero. However, it is uncertain whether there are smaller k-values besides n!-2n.

Examples

			(4!+1)/(4+1) = 5 is prime. Thus, a(4) = 1.
		

Crossrefs

Cf. A242567.

Programs

  • PARI
    a(n)=for(k=1,5*10^6,s=(n!+k)/(n+k);if(floor(s)==s,if(ispseudoprime(s),return(k))));
    n=1;while(n<100,print(a(n));n += 1)

Extensions

a(11)-a(24) from Hiroaki Yamanouchi, Sep 29 2014

A242569 n!-2n.

Original entry on oeis.org

-1, -2, 0, 16, 110, 708, 5026, 40304, 362862, 3628780, 39916778, 479001576, 6227020774, 87178291172, 1307674367970, 20922789887968, 355687428095966, 6402373705727964, 121645100408831962, 2432902008176639960, 51090942171709439958, 1124000727777607679956, 25852016738884976639954, 620448401733239439359952
Offset: 1

Views

Author

Derek Orr, May 17 2014

Keywords

Comments

For n > 2, a(n) is the largest value of k such that (n!+k)/(n+k) is an integer.
For n > 2, a(n) is the largest value of k such that (n!+k)/(n+k) is prime.
For n > 1, a(n) is even.

Examples

			3!-2*3 = 0 so a(3) = 0.
4!-2*4 = 16 so a(4) = 16.
5!-2*5 = 110 so a(5) = 110.
		

Crossrefs

Programs

  • Mathematica
    Table[n!-2n,{n,30}] (* Harvey P. Dale, Oct 22 2024 *)
  • PARI
    for(n=1,25,print(n!-2*n))
  • Python
    import math
    {print(math.factorial(n)-2*n) for n in range(1,25)}
    

Formula

a(n) = n!-2n.
Showing 1-2 of 2 results.