OFFSET
0,3
LINKS
Antti Karttunen, Table of n, a(n) for n = 0..349 (terms 1..349 from Harvey P. Dale)
FORMULA
EXAMPLE
a(3) = (2+1)*(3+1)*(5+1) - 2*3*5 = 72 - 30 = 42.
MAPLE
for n from 1 to 25 do a[n] := product(ithprime(i)+1, i=1..n)-product(ithprime(i), i=1..n): od:seq(a[j], j=1..25);
MATHEMATICA
Module[{nn=20, p, pr, pr1}, p=Prime[Range[nn]]; pr=FoldList[Times, 1, p]; pr1= FoldList[Times, 1, p+1]; #[[2]]-#[[1]]&/@Rest[Thread[{pr, pr1}]]](* Harvey P. Dale, Feb 07 2015 *)
PROG
(PARI) A074107(n) = (prod(i=1, n, 1+prime(i))-prod(i=1, n, prime(i))); \\ Antti Karttunen, Nov 19 2024
CROSSREFS
KEYWORD
nonn
AUTHOR
Amarnath Murthy, Aug 22 2002
EXTENSIONS
More terms from Sascha Kurz, Feb 01 2003
Term a(0)=0 prepended, data section further extended, and secondary definition added by Antti Karttunen, Nov 19 2024
STATUS
approved