login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A319880
Difference between 2^n and the product of primes less than or equal to n.
0
0, 1, 2, 2, 10, 2, 34, -82, 46, 302, 814, -262, 1786, -21838, -13646, 2738, 35506, -379438, -248366, -9175402, -8651114, -7602538, -5505386, -214704262, -206315654, -189538438, -155984006, -88875142, 45342586, -5932822318, -5395951406, -198413006482
OFFSET
0,3
COMMENTS
This sequence shows 2^n is neither a lower bound nor an upper bound for the primorials.
FORMULA
a(n) = 2^n - n#, where n# is the product of primes less than or equal to n (A034386).
a(n) = A000079(n) - A034386(n) .
MAPLE
restart;
with(NumberTheory);
a := n -> 2^n-product(ithprime(i), i = 1 .. PrimeCounting(n)):
0, seq(a(n), n = 1 .. 15); # Stefano Spezia, Nov 05 2018
MATHEMATICA
Table[2^n - Times@@Select[Range[n], PrimeQ], {n, 0, 31}]
PROG
(PARI) a(n) = 2^n - prod(k=1, primepi(n), prime(k)); \\ Michel Marcus, Nov 05 2018
CROSSREFS
KEYWORD
sign
AUTHOR
Alonso del Arte, Sep 30 2018
STATUS
approved