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”).

A319857
Difference between 4^n and the product of primes less than or equal to n.
2
0, 3, 14, 58, 250, 994, 4066, 16174, 65326, 261934, 1048366, 4191994, 16774906, 67078834, 268405426, 1073711794, 4294937266, 17179358674, 68718966226, 274868207254, 1099501928086, 4398036811414, 17592176344726, 70368521084794, 281474753617786, 1125899683749754, 4503599404277626
OFFSET
0,2
LINKS
Erdős Pál, "Ramanujan and I" Number Theory, Madras 1987. Springer, Berlin, Heidelberg, 1989. 1-17.
Leo Moser, "On the product of the primes not exceeding n", Canad. Math. Bull. 2 (1959), 119 - 121.
FORMULA
a(n) = 4^n - n#, where n# is the product of primes less than or equal to n (see A034386).
EXAMPLE
4^5 = 1024. The primes less than or equal to 5 are 2, 3, and 5. Then 2 * 3 * 5 = 30 and hence a(5) = 1024 - 30 = 994.
MAPLE
restart;
with(NumberTheory);
a := n -> 4^n-product(ithprime(i), i = 1 .. PrimeCounting(n)):
0, seq(a(n), n = 1 .. 15); # Stefano Spezia, Nov 06 2018
MATHEMATICA
Table[4^n - Times@@Select[Range[n], PrimeQ], {n, 0, 31}]
PROG
(PARI) a034386(n) = my(v=primes(primepi(n))); prod(i=1, #v, v[i]) \\ after Charles R Greathouse IV in A034386
a(n) = 4^n - a034386(n) \\ Felix Fröhlich, Nov 04 2018
CROSSREFS
Cf. A000302 (4^n), A034386 (n#), A319852.
Sequence in context: A133444 A126875 A110526 * A038679 A151235 A151236
KEYWORD
nonn
AUTHOR
Alonso del Arte, Sep 29 2018
STATUS
approved