login
a(n) = n-th primorial (A002110) minus next prime.
5

%I #20 Feb 26 2023 02:23:11

%S -1,-1,1,23,199,2297,30013,510491,9699667,223092841,6469693199,

%T 200560490093,7420738134769,304250263527167,13082761331669983,

%U 614889782588491357,32589158477190044671,1922760350154212639009

%N a(n) = n-th primorial (A002110) minus next prime.

%C It is well-known and easy to prove (see Honsbeger) that a(n) > 0 for n > 1. - _N. J. A. Sloane_, Jul 05 2009

%C Terms are pairwise coprime with very high probability. I didn't find terms which are pairwise noncoprime, although it may be a case of the "strong law of small numbers." - _Daniel Forgues_, Apr 23 2012

%D R. Honsberger, Mathematical Diamonds, MAA, 2003, see p. 79. [Added by _N. J. A. Sloane_, Jul 05 2009]

%H Harry J. Smith, <a href="/A060882/b060882.txt">Table of n, a(n) for n = 0..100</a>

%H Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha106.htm">P1 * Pn + NextPrime (n = 1 to 100)</a>

%H Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha107.htm">P1 * Pn - NextPrime (n = 1 to 100)</a>

%H Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha102.htm">P1 * Pn + 1 (n = 1 to 100)</a>

%H Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/matha103.htm">P1 * Pn - 1 (n = 1 to 100)</a>

%H Hisanori Mishima, <a href="http://www.asahi-net.or.jp/~KC2H-MSM/mathland/matha1/index.htm">WIFC (World Integer Factorization Center)</a>

%p pp:=n->mul(ithprime(i),i=1..n);

%p [seq(pp(n)-ithprime(n+1),n=1..20)];

%t Join[{-1},With[{nn=20},#[[1]]-#[[2]]&/@Thread[{FoldList[Times,1, Prime[ Range[nn]]],Prime[Range[nn+1]]}]]] (* _Harvey P. Dale_, May 10 2013 *)

%o (PARI) { n=-1; m=1; forprime (p=2, prime(101), write("b060882.txt", n++, " ", m - p); m*=p; ) } \\ _Harry J. Smith_, Jul 13 2009

%o (Python)

%o from sympy import prime, primorial

%o def A060882(n): return primorial(n)-prime(n+1) if n else -1 # _Chai Wah Wu_, Feb 25 2023

%Y Cf. A002110, A060881, A064819, A006862, A057588.

%K sign

%O 0,4

%A _N. J. A. Sloane_, May 05 2001