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.

A369789 Number of different coefficient values in expansion of Product_{k=1..n} (1+x^prime(k))^2.

Original entry on oeis.org

1, 3, 4, 5, 10, 20, 29, 47, 69, 92, 122, 153, 190, 231, 274, 321, 374, 433, 494, 561, 632, 705, 784, 867, 956, 1053, 1154, 1257, 1364, 1473, 1586, 1713, 1844, 1981, 2120, 2269, 2420, 2577, 2740, 2907, 3080, 3259, 3440, 3631, 3824, 4021, 4220, 4431, 4654, 4881, 5110
Offset: 0

Views

Author

Seiichi Manyama, Feb 01 2024

Keywords

Crossrefs

Programs

  • PARI
    a(n) = #Set(Vec(prod(k=1, n, (1+x^prime(k))^2)));
    
  • Python
    from collections import Counter
    from sympy import prime
    def A369789(n):
        c = {0:1}
        for k in range(1,n+1):
            m, d = prime(k), Counter(c)
            for j in c:
                a = c[j]
                d[j+m] += a<<1
                d[j+(m<<1)] += a
            c = d
        return len(set(c.values()))+int(max(c)+1>len(c)) # Chai Wah Wu, Feb 01 2024
Showing 1-1 of 1 results.