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.

A381748 a(n) is the number of primes (counted with multiplicity) in row n of A051599.

Original entry on oeis.org

1, 2, 2, 4, 2, 4, 2, 6, 2, 4, 4, 4, 4, 4, 2, 2, 2, 2, 2, 6, 2, 4, 2, 2, 2, 4, 4, 6, 2, 8, 6, 6, 2, 2, 2, 2, 4, 4, 2, 2, 2, 2, 4, 2, 2, 4, 2, 6, 2, 4, 4, 8, 2, 4, 4, 2, 2, 4, 4, 2, 2, 2, 2, 10, 2, 2, 4, 4, 2, 4, 2, 2, 2, 2, 2, 2, 4, 2, 4
Offset: 0

Views

Author

Keywords

Examples

			2;                                                    1 prime
3,  3;                                                2 primes
5,  6,   5;                                           2 primes
7,  11,  11,  7;                                      4 primes
11, 18,  22,  18,  11;                                2 primes
		

Crossrefs

Cf. A051599.

Programs

  • Python
    from sympy import *
    pr = list(primerange(2, 200))
    lst = []
    a = []
    lst.append(1)
    for i in range(1, 31):
        c = []
        c.append(pr[i])
        for j in range(1, i):
            c.append(a[j-1] + a[j])
        c.append(pr[i])
        count_primes = sum(isprime(x) for x in c)
        lst.append(count_primes)
        a = c
    print(*lst)