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.

Showing 1-1 of 1 results.

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

Original entry on oeis.org

1, 0, 7, 90, 1129, 14976, 255199, 4849770, 111546337, 3234846488, 100280244907, 3710369067210, 152125131763369, 6541380665834736, 307444891294245379, 16294579238595021986, 961380175077106319097, 58644190679703485491136, 3929160775540133527938979
Offset: 0

Views

Author

Des MacHale and Bernard Schott, Jul 12 2022

Keywords

Comments

The parity of a(n) is the opposite of the parity of n.

Examples

			a(4) = (3*5*7*11) - (3+5+7+11) = 1129.
		

Crossrefs

Programs

  • Maple
    a:= n-> (l-> mul(i,i=l)-add(i,i=l))([ithprime(i)$i=2..n+1]):
    seq(a(n), n=0..20);  # Alois P. Heinz, Jul 12 2022
  • Mathematica
    FoldList[Times, 1, p = Prime[Range[2, 20]]] - Prepend[Accumulate[p], 0] (* Amiram Eldar, Jul 14 2022 *)
  • PARI
    a(n) = my(vp=primes(n+1)); vecprod(vp)/2 - vecsum(vp) + 2; \\ Michel Marcus, Jul 12 2022
  • Python
    from itertools import count, islice
    from sympy import nextprime
    def agen():
        p, s, primen = 1, 0, 2
        while True:
            yield p - s; primen = nextprime(primen); p *= primen; s += primen
    print(list(islice(agen(), 19))) # Michael S. Branicky, Jul 12 2022
    

Formula

a(n) = A070826(n+1) - A071148(n).

Extensions

More terms from Michael S. Branicky, Jul 12 2022
Showing 1-1 of 1 results.