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-10 of 14 results. Next

A348165 Number of solutions to +-1^2 +- 2^2 +- 3^2 +- ... +- n^2 = n.

Original entry on oeis.org

1, 1, 0, 0, 1, 2, 0, 0, 2, 4, 0, 0, 19, 29, 0, 0, 127, 208, 0, 0, 1121, 1917, 0, 0, 10479, 19360, 0, 0, 113213, 204121, 0, 0, 1290968, 2363982, 0, 0, 15303057, 28397538, 0, 0, 187446097, 351339307, 0, 0, 2355979330, 4455357992, 0, 0, 30360404500, 57630025172
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 28 2022

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; (m-> `if`(n>m, 0, `if`(n=m, 1,
          b(abs(n-i^2), i-1)+b(n+i^2, i-1))))((1+(3+2*i)*i)*i/6)
        end:
    a:= n-> `if`(irem(n, 4)>1, 0, b(n$2)):
    seq(a(n), n=0..50);  # Alois P. Heinz, Jan 28 2022
  • Mathematica
    b[n_, i_] := b[n, i] = Function[m, If[n > m, 0, If[n == m, 1, b[Abs[n - i^2], i - 1] + b[n + i^2, i - 1]]]][(1 + (3 + 2*i)*i)*i/6];
    a[n_] := If[Mod[n, 4] > 1, 0, b[n, n]];
    Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Feb 26 2022, after Alois P. Heinz *)
  • Python
    from functools import lru_cache
    @lru_cache(maxsize=None)
    def b(n, i):
        if n > i*(i+1)*(2*i+1)//6: return 0
        if i == 0: return 1
        return b(n+i**2, i-1) + b(abs(n-i**2), i-1)
    def a(n): return b(n, n)
    print([a(n) for n in range(50)]) # Michael S. Branicky, Jan 28 2022

Formula

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

A348892 Number of solutions to +-1^3 +- 2^3 +- 3^3 +- ... +- n^3 = n.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 4, 0, 0, 83, 69, 0, 0, 353, 414, 0, 0, 7800, 12496, 0, 0, 48162, 56870, 0, 0, 733392, 1253467, 0, 0, 4892337, 10022277, 0, 0, 45859303, 149422926, 0, 0, 623257759, 1339056922, 0, 0, 7453502893, 13446831198
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 28 2022

Keywords

Crossrefs

Programs

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

Formula

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

A368243 Number of solutions to +- 1^2 +- 2^2 +- 3^2 +- ... +- n^2 = n^2.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 2, 3, 0, 0, 5, 15, 0, 0, 127, 184, 0, 0, 819, 1382, 0, 0, 9441, 18176, 0, 0, 96562, 172371, 0, 0, 1192142, 2252342, 0, 0, 13869696, 25741462, 0, 0, 177056022, 334176492, 0, 0, 2207693292, 4182801839, 0, 0, 28966597122, 55125154468
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 22 2024

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; (m-> `if`(n>m, 0, `if`(n=m, 1,
          b(abs(n-i^2), i-1) +b(n+i^2, i-1))))((1+(3+2*i)*i)*i/6)
        end:
    a:= n-> `if`(irem(n, 4)>1, 0, b(n^2, n)):
    seq(a(n), n=0..49);  # Alois P. Heinz, Jan 22 2024

Formula

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

A368845 Number of solutions to +- 1^3 +- 2^3 +- 3^3 +- ... +- n^3 = n^3.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 6, 4, 0, 0, 8, 187, 0, 0, 831, 1086, 0, 0, 7127, 3983, 0, 0, 20086, 120445, 0, 0, 674006, 1056938, 0, 0, 6983613, 5964500, 0, 0, 40031490, 142694311, 0, 0, 853687222, 1622335105, 0, 0, 10288998770, 12509111104
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 22 2024

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; (m-> `if`(n>m, 0, `if`(n=m, 1,
          b(abs(n-i^3), i-1) +b(n+i^3, i-1))))((i*(i+1)/2)^2)
        end:
    a:= n-> `if`(irem(n, 4)>1, 0, b(n^3, n)):
    seq(a(n), n=0..53);  # Alois P. Heinz, Jan 22 2024

Formula

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

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

Original entry on oeis.org

1, 1, 2, 4, 6, 13, 31, 77, 188, 449, 1191, 3014, 7920, 21498, 57833, 154073, 412733, 1141274, 3106771, 8576977, 24015471, 66489615, 185886699, 517837152, 1435964205, 4034697191, 11438332340, 32395341851, 92396549863, 263233759500, 736127855014, 2093027604453
Offset: 1

Views

Author

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

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)).

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

Original entry on oeis.org

1, 1, 1, 0, 0, 1, 3, 0, 4, 3, 9, 0, 27, 43, 71, 0, 190, 318, 604, 0, 1846, 3127, 5664, 0, 19048, 34065, 62045, 0, 205713, 378243, 705836, 0, 2403370, 4434940, 8276125, 0, 28980680, 54167797, 101541048, 0, 358095372, 674776903, 1274888645, 0, 4551828850, 8612421500
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 29 2022

Keywords

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(n, n)
    print([a(n) for n in range(50)]) # Michael S. Branicky, Jan 29 2022

Formula

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

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

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 8, 13, 0, 0, 272, 0, 0, 0, 5400, 8915, 0, 0, 30433, 1590, 0, 0, 68638, 73470, 0, 0, 90808, 6638072, 0, 0, 127356, 319803, 0, 0, 20130146, 559282596, 0, 0, 1507066936, 3820244957, 0, 0
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 25 2024

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; (m-> `if`(n>m, 0, `if`(n=m, 1,
          b(abs(n-i^4), i-1)+b(n+i^4, i-1))))(i*(i+1)*(2*i+1)*(3*i^2+3*i-1)/30)
        end:
    a:= n-> `if`(irem(n, 4)>1, 0, b(n, n)):
    seq(a(n), n=0..43);  # Alois P. Heinz, Jan 25 2024

Extensions

a(46)-a(59) from Alois P. Heinz, Jan 25 2024

A367416 Triangle read by rows: T(n,k) = number of solutions to +- 1^k +- 2^k +- 3^k +- ... +- n^k is a k-th power, n >= 2.

Original entry on oeis.org

4, 8, 1, 16, 1, 32, 0, 2, 64, 6, 128, 8, 256, 16, 4, 512, 26, 1024, 17, 10, 2048, 67, 4, 3, 4096, 100, 10, 8192, 137, 34, 6, 16384, 426, 28, 1, 32768, 661, 96, 6, 65536, 1351, 146, 16, 8, 131072, 2637, 230, 15, 262144, 3831, 258, 40, 524288, 8095, 1130, 50
Offset: 2

Views

Author

Jean-Marc Rebert, Jan 26 2024

Keywords

Comments

In the case of n = 1, there are solutions for all k. In particular, 1^k is always a k-th power and -(1^k) is a k-th power for odd k. As a formula: T(1,k) = 1 + (k mod 2). This row is not included in the sequence.

Examples

			Triangle begins:
            k = 1      2     3   4  5
  n= 2:         4;
  n= 3:         8,     1;
  n= 4:        16,     1;
  n= 5:        32,     0,    2;
  n= 6:        64,     6;
  n= 7:       128,     8;
  n= 8:       256,    16,    4;
  n= 9:       512,    26;
  n=10:      1024,    17,   10;
  n=11:      2048,    67,    4,  3;
  n=12:      4096,   100,   10;
  n=13:      8192,   137,   34,  6;
  n=14:     16384,   426,   28,  1;
  n=15:     32768,   661,   96,  6;
  n=16:     65536,  1351,  146, 16, 8;
  n=17:    131072,  2637,  230, 15;
  n=18:    262144,  3831,  258, 40;
  n=19:    524288,  8095, 1130, 50;
  n=20:   1048576, 15241,  854, 77, 6;
  ...
The T(6,2) = 6 solutions are:
  - 1^2 - 2^2 + 3^2 - 4^2 + 5^2 + 6^2 = 49 = 7^2,
  - 1^2 - 2^2 + 3^2 + 4^2 + 5^2 - 6^2 =  9 = 3^2,
  - 1^2 - 2^2 + 3^2 + 4^2 + 5^2 + 6^2 = 81 = 9^2,
  + 1^2 - 2^2 + 3^2 - 4^2 - 5^2 + 6^2 =  1 = 1^2,
  + 1^2 + 2^2 - 3^2 + 4^2 + 5^2 - 6^2 =  1 = 1^2,
  + 1^2 + 2^2 + 3^2 - 4^2 - 5^2 + 6^2 =  9 = 3^2.
		

Crossrefs

Programs

  • PARI
    f(k,u)=my(x=0,v=vector(#u));for(i=1,#u,u[i]=if(u[i]==0,-1,1);v[i]=i^k);u*v~
    is(k,u)=my(x=f(k,u));ispower(x,k)
    T(n,k)=my(u=vector(n,i,[0,1]),nbsol=0);if(k%2==1,u[1]=[1,1]);forvec(X=u,if(is(k,X),nbsol++));if(k%2==1,nbsol*=2);nbsol

A367736 a(0) = 1; for n > 0, a(n) is the coefficient of x^a(n-1) in the expansion of Product_{k=0..n-1} (x^a(k) + 1 + 1/x^a(k)).

Original entry on oeis.org

1, 1, 2, 4, 6, 11, 19, 32, 58, 97, 163, 290, 501, 856, 1483, 2561, 4424, 7652, 13273, 23024, 39784, 69001, 119614, 207042, 358746, 621117, 1075865, 1864050, 3227724, 5590548, 9682402, 16770033, 29049713, 50310453, 87142439, 150939346, 261424583, 452810957
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 24 2024

Keywords

Crossrefs

Programs

  • Mathematica
    a[0] = 1; a[n_] := a[n] = Coefficient[Product[x^a[k] + 1 + 1/x^a[k], {k, 0, n - 1}], x, a[n - 1]]; Table[a[n], {n, 0, 28}]
  • Python
    from itertools import islice
    from collections import Counter
    def A367736_gen(): # generator of terms
        c, b = {0:1}, 1
        while True:
            yield b
            d = Counter(c)
            for k in c:
                e = c[k]
                d[k+b] += e
                d[k-b] += e
            c = d
            b = c[b]
    A367736_list = list(islice(A367736_gen(),20)) # Chai Wah Wu, Feb 05 2024

Extensions

a(29)-a(37) from Chai Wah Wu, Feb 05 2024
Showing 1-10 of 14 results. Next