login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A355590 a(n) = (product of the first n primes) - (sum of the first n primes). 1
1, 0, 1, 20, 193, 2282, 29989, 510452, 9699613, 223092770, 6469693101, 200560489970, 7420738134613, 304250263526972, 13082761331669749, 614889782588491082, 32589158477190044349, 1922760350154212638630, 117288381359406970982769, 7858321551080267055878522 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,4
COMMENTS
The parity of a(n) is the opposite of the parity of n.
LINKS
FORMULA
a(n) = A002110(n) - A007504(n).
EXAMPLE
a(4) = (2*3*5*7) - (2+3+5+7) = 193.
MATHEMATICA
FoldList[Times, 1, p = Prime[Range[20]]] - Prepend[Accumulate[p], 0] (* Amiram Eldar, Jul 08 2022 *)
PROG
(Python)
from itertools import count, islice
from sympy import nextprime
def agen():
p, s, primen = 1, 0, 0
while True:
yield p - s; primen = nextprime(primen); p *= primen; s += primen
print(list(islice(agen(), 20))) # Michael S. Branicky, Jul 08 2022
(PARI) a(n) = my(vp=primes(n)); vecprod(vp) - vecsum(vp); \\ Michel Marcus, Jul 08 2022
CROSSREFS
Sequence in context: A126541 A213218 A247742 * A219369 A245137 A232224
KEYWORD
nonn
AUTHOR
Des MacHale and Bernard Schott, Jul 08 2022
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 05:18 EDT 2024. Contains 371964 sequences. (Running on oeis4.)