cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A355590 a(n) = (product of the first n primes) - (sum of the first n primes).

This page as a plain text file.
%I A355590 #20 Jul 11 2022 16:10:53
%S A355590 1,0,1,20,193,2282,29989,510452,9699613,223092770,6469693101,
%T A355590 200560489970,7420738134613,304250263526972,13082761331669749,
%U A355590 614889782588491082,32589158477190044349,1922760350154212638630,117288381359406970982769,7858321551080267055878522
%N A355590 a(n) = (product of the first n primes) - (sum of the first n primes).
%C A355590 The parity of a(n) is the opposite of the parity of n.
%F A355590 a(n) = A002110(n) - A007504(n).
%e A355590 a(4) = (2*3*5*7) - (2+3+5+7) = 193.
%t A355590 FoldList[Times, 1, p = Prime[Range[20]]] - Prepend[Accumulate[p], 0] (* _Amiram Eldar_, Jul 08 2022 *)
%o A355590 (Python)
%o A355590 from itertools import count, islice
%o A355590 from sympy import nextprime
%o A355590 def agen():
%o A355590     p, s, primen = 1, 0, 0
%o A355590     while True:
%o A355590         yield p - s; primen = nextprime(primen); p *= primen; s += primen
%o A355590 print(list(islice(agen(), 20))) # _Michael S. Branicky_, Jul 08 2022
%o A355590 (PARI) a(n) = my(vp=primes(n)); vecprod(vp) - vecsum(vp); \\ _Michel Marcus_, Jul 08 2022
%Y A355590 Cf. A000040, A002110, A007504, A059841.
%K A355590 nonn
%O A355590 0,4
%A A355590 _Des MacHale_ and _Bernard Schott_, Jul 08 2022