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.

A350287 Number of solutions to +-1 +- 3 +- 6 +- 10 +- ... +- n*(n + 1)/2 = 0 or 1.

Original entry on oeis.org

1, 1, 0, 0, 2, 1, 2, 2, 4, 7, 12, 16, 26, 42, 66, 104, 210, 318, 620, 970, 1748, 3281, 5948, 10480, 18976, 34233, 60836, 111430, 209460, 378529, 704934, 1284836, 2387758, 4466874, 8331820, 15525814, 28987902, 54162165, 101242982, 190267598, 358969426, 674845081
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 19 2022

Keywords

Examples

			a(4) = 2: -1 - 3 - 6 + 10 = +1 + 3 + 6 - 10 = 0.
		

Crossrefs

Programs

  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def b(n, i):
        if n > i*(i+1)*(i+2)//6: return 0
        if i == 0: return 1
        return b(n+i*(i+1)//2, i-1) + b(abs(n-i*(i+1)//2), i-1)
    def a(n): return b(0, n) + b(1, n)
    print([a(n) for n in range(41)]) # Michael S. Branicky, Jan 19 2022