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.

Previous Showing 11-16 of 16 results.

A215222 Number of solutions to n = Sum_{i=1..pi(n-1)} c(i)*p(i) with c(i) in {-1,0,1}, p(n) = n-th prime and pi = A000720.

Original entry on oeis.org

0, 0, 0, 0, 1, 1, 1, 2, 2, 3, 1, 5, 5, 13, 12, 11, 11, 29, 28, 74, 73, 71, 69, 184, 182, 176, 173, 170, 164, 446, 437, 1180, 1165, 1147, 1137, 1115, 1104, 2984, 2949, 2919, 2887, 7841, 7778, 21331, 21184, 21029, 20861, 57465, 57114, 56741, 56372, 55997, 55610
Offset: 1

Views

Author

Alois P. Heinz, Aug 06 2012

Keywords

Examples

			a(5) = 1: 5 = 3+2.
a(6) = 1: 6 = 5+3-2.
a(7) = 1: 7 = 5+2.
a(8) = 2: 8 = 5+3 = 7+3-2.
a(9) = 2: 9 = 7+2 = 7+5-3.
a(10) = 3: 10 = 5+3+2 = 7+3 = 7+5-2.
a(11) = 1: 11 = 7+5-3+2.
a(12) = 5: 12 = 7+3+2 = 7+5 = 11+3-2 = 11-7+5+3 = 11+7-5-3+2.
		

Crossrefs

Programs

  • Maple
    sp:= proc(n) option remember; `if`(n=0, 0, ithprime(n)+sp(n-1)) end:
    b := proc(n, i) option remember; `if`(n>sp(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, numtheory[pi](n-1)):
    seq(a(n), n=1..60);
  • Mathematica
    sp[n_] := sp[n] = If[n == 0, 0, Prime[n]+sp[n-1]]; b[n_, i_] := b[n, i] = If[n>sp[i], 0, If[i == 0, 1, b[n, i-1] + b[n+Prime[i], i-1] + b[Abs[n-Prime[i]], i-1]]]; a[n_] := b[n, PrimePi[n-1]]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Dec 03 2014, after Alois P. Heinz *)

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

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

Original entry on oeis.org

0, 2, 2, 6, 14, 39, 125, 399, 1310, 4356, 14970, 51715, 178832, 635778, 2290019, 8106059, 29234378, 105635076, 384409483, 1408730050, 5193316109, 19170300330, 71421970661, 263893092145, 984568438169, 3686368605467, 13838552783467, 52008816746450
Offset: 1

Views

Author

Ilya Gutkovskiy, Jan 27 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Coefficient[Product[(x^Prime[k] + 1/x^Prime[k]), {k, 1, 2 n}], x, Prime[2 n]], {n, 1, 28}]

Formula

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

A369733 Number of solutions to 2*k_1 + 3*k_2 + ... + prime(n)*k_n = 1, where k_i are from {-1,0,1}, i=1..n.

Original entry on oeis.org

0, 0, 1, 1, 3, 8, 18, 39, 95, 233, 565, 1440, 3640, 9409, 24957, 66699, 177931, 475584, 1292985, 3517163, 9636135, 26675682, 73847316, 205379443, 571621138, 1588186858, 4435778209, 12474517743, 35194193531, 99781874834, 283513309423, 799779819641
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 30 2024

Keywords

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(1, n):
    seq(a(n), n=0..32);  # Alois P. Heinz, Jan 30 2024
  • Mathematica
    Table[Coefficient[Product[(x^Prime[k] + 1 + 1/x^Prime[k]), {k, 1, n}], x, 1], {n, 0, 31}]

Formula

a(n) = [x^1] Product_{k=1..n} (x^prime(k) + 1 + 1/x^prime(k)).
Previous Showing 11-16 of 16 results.