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.

A332659 Alternate multiplying and adding prime numbers: a(2n) = a(2n-1) + prime(2n+1) and a(2n-1) = a(2n) * prime(2n-2) for n >= 1.

Original entry on oeis.org

6, 11, 77, 88, 1144, 1161, 22059, 22082, 640378, 640409, 23695133, 23695174, 1018892482, 1018892529, 54001304037, 54001304096, 3294079549856, 3294079549923, 233879648044533, 233879648044606, 18476492195523874, 18476492195523957, 1644407805401632173
Offset: 1

Views

Author

Adnan Baysal, Feb 18 2020

Keywords

Examples

			a(1) =  2 * 3 =  6;
a(2) =  6 + 5 = 11;
a(3) = 11 * 7 = 77.
		

Crossrefs

Programs

  • Python
    from sympy import primerange
    p = list(primerange(1, 1000))
    def a(n):
        out = p[0] * p[1]
        for i in range(1, n):
            if i % 2:
                out += p[i + 1]
            else:
                out *= p[i + 1]
        return out