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-3 of 3 results.

A350695 Number of solutions to +-2 +- 3 +- 5 +- 7 +- ... +- prime(n-1) = n.

Original entry on oeis.org

1, 0, 1, 0, 1, 0, 1, 1, 4, 5, 9, 15, 26, 45, 77, 137, 243, 434, 774, 1408, 2554, 4667, 8627, 15927, 29559, 54867, 101688, 189425, 355315, 668598, 1264180, 2395462, 4506221, 8507311, 16084405, 30545142, 57898862, 110199367, 209957460, 400430494, 765333684
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 29 2022

Keywords

Crossrefs

Programs

  • Mathematica
    Table[SeriesCoefficient[Product[x^Prime[k] + 1/x^Prime[k], {k, n - 1}], {x, 0, n}], {n, 0, 40}] (* Stefano Spezia, Jan 30 2022 *)
  • Python
    from sympy import sieve, primerange
    from functools import cache
    @cache
    def b(n, i):
        maxsum = 0 if i < 2 else sum(p for p in primerange(2, sieve[i-1]+1))
        if n > maxsum: return 0
        if i < 2: return 1
        return b(n+sieve[i-1], i-1) + b(abs(n-sieve[i-1]), i-1)
    def a(n): return b(n, n)
    print([a(n) for n in range(41)]) # Michael S. Branicky, Jan 29 2022

Formula

a(n) = [x^n] Product_{k=1..n-1} (x^prime(k) + 1/x^prime(k)).

A369560 a(n) = [x^n] Product_{k=1..n} (x^prime(k) + 1 + 1/x^prime(k)).

Original entry on oeis.org

1, 0, 1, 2, 3, 6, 16, 38, 91, 225, 547, 1407, 3570, 9250, 24578, 65740, 175626, 470084, 1279101, 3482419, 9547953, 26445796, 73251187, 203818706, 567543095, 1577629707, 4408095456, 12400615844, 34995570604, 99241500366, 282037360250, 795846583187
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 25 2024

Keywords

Comments

a(n) is the number of solutions to n = Sum_{i=1..n} c_i * prime(i) with c_i in {-1,0,1}.

Crossrefs

Programs

  • Maple
    s:= proc(n) s(n):= `if`(n<1, 0, ithprime(n)+s(n-1)) end:
    b:= proc(n, i) option remember; `if`(n>s(i), 0, `if`(i=0, 1,
          b(n, i-1)+b(n+ithprime(i), i-1)+b(abs(n-ithprime(i)), i-1)))
        end:
    a:= n-> b(n$2):
    seq(a(n), n=0..32);  # Alois P. Heinz, Jan 25 2024
  • Mathematica
    Table[Coefficient[Product[x^Prime[k] + 1 + 1/x^Prime[k], {k, 1, n}], x, n], {n, 0, 31}]

A367088 Number of solutions to +- 1 +- 2 +- 3 +- 5 +- 7 +- ... +- prime(n-1) = 0 or 1.

Original entry on oeis.org

1, 1, 1, 2, 2, 2, 3, 6, 7, 12, 19, 32, 53, 90, 156, 276, 493, 878, 1566, 2834, 5146, 9396, 17358, 32042, 59434, 110292, 204332, 380548, 713601, 1342448, 2538012, 4808578, 9043605, 17070234, 32268611, 61271738, 116123939, 220993892, 421000142, 802844420, 1534312896
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 26 2024

Keywords

Crossrefs

Showing 1-3 of 3 results.