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

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

A292474 Number of solutions to +-1 +- 5 +- 12 +- ... +- n*(3*n-1)/2 = 0.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 2, 2, 4, 0, 2, 4, 4, 0, 30, 46, 78, 0, 210, 366, 644, 0, 2032, 3696, 6694, 0, 21936, 39886, 73098, 0, 246172, 454074, 841714, 0, 2899542, 5401222, 10073398, 0, 35282910, 66213604, 124427582, 0, 441326270, 832775792, 1573861942, 0, 5642205488
Offset: 0

Views

Author

Seiichi Manyama, Sep 17 2017

Keywords

Examples

			For n=6 the 2 solutions are +1+5-12+22+35-51 = 0 and -1-5+12-22-35+51 = 0.
		

Crossrefs

Programs

  • PARI
    {a(n) = polcoeff(prod(k=1, n, x^(k*(3*k-1)/2)+1/x^(k*(3*k-1)/2)), 0)}

Formula

Constant term in the expansion of Product_{k=1..n} (x^(k*(3*k-1)/2)+1/x^(k*(3*k-1)/2)).
a(4*k+1) = 0 for k >= 0.

A307877 Number of ways of partitioning the set of the first n positive squares into two subsets whose sums differ at most by 1.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 2, 1, 1, 5, 2, 1, 5, 13, 43, 43, 57, 193, 274, 239, 430, 1552, 3245, 2904, 5419, 18628, 31048, 27813, 50213, 188536, 372710, 348082, 649300, 2376996, 4197425, 3913496, 7287183, 27465147, 53072709, 50030553, 93696497, 351329160, 650125358
Offset: 0

Views

Author

Alois P. Heinz, Jun 04 2019

Keywords

Examples

			a(6) = 2: 1,9,36/4,16,25; 1,4,16,25/9,36.
a(7) = 1: 1,4,16,49/9,25,36.
		

Crossrefs

Programs

  • Maple
    s:= proc(n) s(n):= `if`(n=0, 1, n^2+s(n-1)) end:
    b:= proc(n, i) option remember; `if`(i=0, `if`(n<=1, 1, 0),
          `if`(n>s(i), 0, (p-> b(n+p, i-1)+b(abs(n-p), i-1))(i^2)))
        end:
    a:= n-> ceil(b(0, n)/2):
    seq(a(n), n=0..45);
  • Mathematica
    s[n_] := s[n] = If[n == 0, 1, n^2 + s[n - 1]];
    b[n_, i_] := b[n, i] = If[i == 0, If[n <= 1, 1, 0], If[n > s[i], 0, Function[p, b[n + p, i - 1] + b[Abs[n - p], i - 1]][i^2]]];
    a[n_] := Ceiling[b[0, n]/2];
    a /@ Range[0, 45] (* Jean-François Alcover, Dec 07 2020, after Alois P. Heinz *)

Formula

a(n) = A083527(n) if n == 0 or 3 (mod 4).

A350495 a(n) is the constant term in expansion of Product_{k=1..n} (x^(k^2) + 1/x^(k^2))^2.

Original entry on oeis.org

1, 2, 4, 8, 16, 40, 88, 222, 570, 1564, 4516, 13874, 41866, 137432, 442964, 1492610, 4998674, 17204844, 59175316, 207299554, 727137516, 2582078416, 9179001124, 32943918428, 118453240846, 428937325964, 1556421977612, 5676923326262, 20754245720206
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 28 2022

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n) option remember; `if`(n=0, 1,
          expand((x^(n^2)+1/x^(n^2))^2*b(n-1)))
        end:
    a:= n-> coeff(b(n),x,0):
    seq(a(n), n=0..28);  # Alois P. Heinz, Jan 28 2022
  • Mathematica
    Table[Coefficient[Product[(x^(k^2) + 1/x^(k^2))^2, {k, 1, n}], x, 0], {n, 0, 30}] (* Vaclav Kotesovec, Feb 05 2022 *)

Formula

Conjecture: a(n) ~ sqrt(5) * 4^n / (sqrt(Pi) * n^(5/2)). - Vaclav Kotesovec, Feb 05 2022

A350403 Number of solutions to +-1^2 +- 2^2 +- 3^2 +- ... +- n^2 = 0 or 1.

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 2, 2, 2, 5, 2, 2, 10, 13, 43, 86, 114, 193, 274, 478, 860, 1552, 3245, 5808, 10838, 18628, 31048, 55626, 100426, 188536, 372710, 696164, 1298600, 2376996, 4197425, 7826992, 14574366, 27465147, 53072709, 100061106, 187392994, 351329160
Offset: 0

Views

Author

Ilya Gutkovskiy, Dec 29 2021

Keywords

Examples

			a(8) = 2: +1^2 - 2^2 - 3^2 + 4^2 - 5^2 + 6^2 + 7^2 - 8^2 =
          -1^2 + 2^2 + 3^2 - 4^2 + 5^2 - 6^2 - 7^2 + 8^2 = 0.
		

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n>i*(i+1)*(2*i+1)/6, 0,
          `if`(i=0, 1, b(n+i^2, i-1)+b(abs(n-i^2), i-1)))
        end:
    a:=n-> b(0, n)+b(1, n):
    seq(a(n), n=0..42);  # Alois P. Heinz, Jan 16 2022
  • Mathematica
    b[n_, i_] := b[n, i] = If[n > i*(i + 1)*(2*i + 1)/6, 0,
         If[i == 0, 1, b[n + i^2, i - 1] + b[Abs[n - i^2], i - 1]]];
    a[n_] := b[0, n] + b[1, n];
    Table[a[n], {n, 0, 42}] (* Jean-François Alcover, Mar 01 2022, after Alois P. Heinz *)
  • Python
    from itertools import product
    def a(n):
        if n == 0: return 1
        nn = ["0"] + [str(i)+"**2" for i in range(1, n+1)]
        return sum(eval("".join([*sum(zip(nn, ops+("", )), ())])) in {0, 1} for ops in product("+-", repeat=n))
    print([a(n) for n in range(18)]) # Michael S. Branicky, Jan 16 2022
    
  • Python
    from functools import cache
    @cache
    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(0, n) + b(1, n)
    print([a(n) for n in range(43)]) # Michael S. Branicky, Jan 16 2022 after Alois P. Heinz

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

Original entry on oeis.org

0, 1, 0, 0, 0, 0, 2, 0, 0, 5, 2, 0, 0, 13, 43, 0, 0, 193, 274, 0, 0, 1552, 3245, 0, 0, 18628, 31048, 0, 0, 188536, 372710, 0, 0, 2376996, 4197425, 0, 0, 27465147, 53072709, 0, 0, 351329160, 650125358, 0, 0, 4398613111, 8429649875, 0, 0, 57629346805, 108986428106
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 30 2024

Keywords

Crossrefs

Programs

  • Maple
    b:= proc(n, i) option remember; `if`(n>i*(i+1)*(2*i+1)/6, 0,
          `if`(i=0, 1, b(n+i^2, i-1)+b(abs(n-i^2), i-1)))
        end:
    a:=n-> b(1, n):
    seq(a(n), n=0..50);  # Alois P. Heinz, Jan 30 2024
  • Mathematica
    Table[Coefficient[Product[(x^(k^2) + 1/x^(k^2)), {k, 1, n}], x, 1], {n, 0, 48}]

Formula

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

A292510 a(n) = smallest k >= 1 such that {1, p(n,2), p(n,3), ..., p(n,k)} can be partitioned into two sets with equal sums, where p(n,m) is m-th n-gonal number.

Original entry on oeis.org

4, 7, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
Offset: 3

Views

Author

Seiichi Manyama, Sep 17 2017

Keywords

Comments

Conjecture: a(n) = 7 for n > 5.

Examples

			n = 3
1+3+6 = 10
n = 4
1+4+16+49 = 9+25+36 (= 70 = 28*4-42)
n = 5
1+5+22+35 = 12+51 (=63)
n = 6
1+6+28+91 = 15+45+66 (= 126 = 28*6-42)
		

Crossrefs

Programs

  • Ruby
    def f(k, n)
      n * ((k - 2) * n - k + 4) / 2
    end
    def A(k, n)
      ary = [1]
      s_ary = [0]
      (1..n).each{|i| s_ary << s_ary[-1] + f(k, i)}
      m = s_ary[-1]
      a = Array.new(m + 1){0}
      a[0] = 1
      (1..n).each{|i|
        b = a.clone
        (0..[s_ary[i - 1], m - f(k, i)].min).each{|j| b[j + f(k, i)] += a[j]}
        a = b
        s_ary[i] % 2 == 0 ? ary << a[s_ary[i] / 2] : ary << 0
      }
      ary
    end
    def B(n)
      i = 1
      while A(n, i)[-1] == 0
        i += 1
      end
      i
    end
    def A292510(n)
      (3..n).map{|i| B(i)}
    end
    p A292510(100)

Formula

p(n,1) + p(n,2) + p(n,4) + p(n,7) = p(n,3) + p(n,5) + p(n,6) (= 28*n-42). So a(n) <= 7.
Previous Showing 11-17 of 17 results.