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-3 of 3 results.

A075409 a(n) is the smallest m such that n!-m and n!+m are both primes.

Original entry on oeis.org

0, 1, 5, 7, 19, 19, 31, 17, 11, 17, 83, 67, 353, 227, 163, 59, 61, 113, 353, 31, 1447, 571, 389, 191, 337, 883, 101, 1823, 659, 709, 163, 1361, 439, 307, 1093, 1733, 2491, 1063, 1091, 1999, 1439, 109, 2753, 607, 2617, 269, 103, 2663, 337, 14447, 2221, 5471, 2887
Offset: 2

Views

Author

Zak Seidov, Sep 18 2002

Keywords

Comments

For n=3,5,10,21,171,190,348, n! is an interprime, the average of two consecutive primes, see A053709. In general n! may be average of several pairs of primes, in which case the minimal distance is in the sequence. See also n^n and n!! as average of two primes in A075468 and A075410.
According to Goldbach's conjecture, a(n) always exists with a(n) = A047160(n!). - Jens Kruse Andersen, Jul 30 2014

Examples

			a(4)=5 because 4!=24 and 19 and 25 are primes with smallest distance 5 from 4!.
		

Crossrefs

Programs

  • Mathematica
    smp[n_]:=Module[{m=1,nf=n!},While[!PrimeQ[nf+m]||!PrimeQ[nf-m],m=m+2];m]; Join[{0},Array[smp,60,3]] (* Harvey P. Dale, Apr 18 2014 *)
  • PARI
    a(n) = {my (m=0); until (ok, ok = isprime(n!-m) && isprime(n!+m); if (!ok, m++);); return (m);} \\ Michel Marcus, Apr 19 2013

Extensions

More terms from David Wasserman, Jan 17 2005

A075410 a(n) is the smallest m such that n!!-m and n!!+m are both primes.

Original entry on oeis.org

0, 0, 3, 2, 5, 2, 5, 8, 7, 4, 19, 16, 29, 68, 97, 16, 109, 86, 19, 158, 17, 172, 41, 16, 529, 106, 263, 212, 163, 302, 593, 302, 607, 262, 311, 428, 227, 106, 1271, 8, 229, 386, 1489, 32, 47, 1996, 1097, 2566, 41, 632, 1913, 458, 149, 1244, 2837, 362, 3317, 908
Offset: 2

Views

Author

Zak Seidov, Sep 18 2002

Keywords

Comments

For n = 5,7,10,11,22,41,67,76,91,96,163,245,299,341, n!! is an interprime, the average of two consecutive primes, see A075275. See also n^n and n! as average of two primes in A075468 and A075409.

Examples

			a(4) = 3 because 4!! = 8 and 8 -/+ 3 = 5 and 11 are primes with smallest equal distances from 4!!
		

Crossrefs

Programs

  • Mathematica
    smbp[n_]:=Module[{m=0,n2=n!!},While[Total[Boole[PrimeQ[n2+{m,-m}]]] != 2,m++];m]; Array[smbp,60,2] (* Harvey P. Dale, Sep 02 2017 *)

Extensions

More terms from David Wasserman, Jan 17 2005

A075469 Maximal m such that n^n-m and n^n+m are both primes, or -1 if there is no such m.

Original entry on oeis.org

1, 20, 253, 3122, 46651, 823540, 16777155, 387420478, 9999999939, 285311670528, 8916100448227, 302875106592216, 11112006825558003, 437893890380859368, 18446744073709551537, 827240261886336764070, 39346408075296537575383
Offset: 2

Views

Author

Lior Manor, Sep 18 2002

Keywords

Comments

Are there any negative terms?
Of course the Goldbach conjecture implies that the answer is "no"; further, the first thousand terms are positive. - Charles R Greathouse IV, Mar 16 2016

Examples

			a(4) = 253 since 4^4-253 = 3 and 4^4+253 = 509 are both prime.
		

Crossrefs

Programs

  • PARI
    a(n)=my(N=n^n); forprime(p=2,N, if(isprime(2*N-p), return(N-p))); -1 \\ Charles R Greathouse IV, Mar 16 2016

Formula

a(n) = A047949(n^n). - Michel Marcus, Jun 09 2013
Showing 1-3 of 3 results.