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.

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

This page as a plain text file.
%I A355591 #30 Jul 14 2023 15:20:40
%S A355591 1,0,7,90,1129,14976,255199,4849770,111546337,3234846488,100280244907,
%T A355591 3710369067210,152125131763369,6541380665834736,307444891294245379,
%U A355591 16294579238595021986,961380175077106319097,58644190679703485491136,3929160775540133527938979
%N A355591 a(n) = (product of the first n odd primes) - (sum of the first n odd primes).
%C A355591 The parity of a(n) is the opposite of the parity of n.
%H A355591 Robert Israel, <a href="/A355591/b355591.txt">Table of n, a(n) for n = 0..348</a>
%F A355591 a(n) = A070826(n+1) - A071148(n).
%e A355591 a(4) = (3*5*7*11) - (3+5+7+11) = 1129.
%p A355591 a:= n-> (l-> mul(i,i=l)-add(i,i=l))([ithprime(i)$i=2..n+1]):
%p A355591 seq(a(n), n=0..20);  # _Alois P. Heinz_, Jul 12 2022
%t A355591 FoldList[Times, 1, p = Prime[Range[2, 20]]] - Prepend[Accumulate[p], 0] (* _Amiram Eldar_, Jul 14 2022 *)
%o A355591 (Python)
%o A355591 from itertools import count, islice
%o A355591 from sympy import nextprime
%o A355591 def agen():
%o A355591     p, s, primen = 1, 0, 2
%o A355591     while True:
%o A355591         yield p - s; primen = nextprime(primen); p *= primen; s += primen
%o A355591 print(list(islice(agen(), 19))) # _Michael S. Branicky_, Jul 12 2022
%o A355591 (PARI) a(n) = my(vp=primes(n+1)); vecprod(vp)/2 - vecsum(vp) + 2; \\ _Michel Marcus_, Jul 12 2022
%Y A355591 Cf. A000040, A059841, A070826, A071148, A355590.
%K A355591 nonn
%O A355591 0,3
%A A355591 _Des MacHale_ and _Bernard Schott_, Jul 12 2022
%E A355591 More terms from _Michael S. Branicky_, Jul 12 2022