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 10 results.

A063865 Number of solutions to +- 1 +- 2 +- 3 +- ... +- n = 0.

Original entry on oeis.org

1, 0, 0, 2, 2, 0, 0, 8, 14, 0, 0, 70, 124, 0, 0, 722, 1314, 0, 0, 8220, 15272, 0, 0, 99820, 187692, 0, 0, 1265204, 2399784, 0, 0, 16547220, 31592878, 0, 0, 221653776, 425363952, 0, 0, 3025553180, 5830034720, 0, 0, 41931984034, 81072032060, 0, 0
Offset: 0

Views

Author

N. J. A. Sloane, suggested by J. H. Conway, Aug 27 2001

Keywords

Comments

Number of sum partitions of the half of the n-th-triangular number by distinct numbers in the range 1 to n. Example: a(7)=8 since triangular(7)=28 and 14 = 2+3+4+5 = 1+3+4+6 = 1+2+5+6 = 3+5+6 = 7+1+2+4 = 7+3+4 = 7+2+5 = 7+1+6. - Hieronymus Fischer, Oct 20 2010
The asymptotic formula below was stated as a conjecture by Andrica & Tomescu in 2002 and proved by B. D. Sullivan in 2013. See his paper and H.-K. Hwang's review MR 2003j:05005 of the JIS paper. - Jonathan Sondow, Nov 11 2013
a(n) is the number of subsets of {1..n} whose sum is equal to the sum of their complement. See example below. - Gus Wiseman, Jul 04 2019

Examples

			From _Gus Wiseman_, Jul 04 2019: (Start)
For example, the a(0) = 1 through a(8) = 14 subsets (empty columns not shown) are:
  {}  {3}    {1,4}  {1,6,7}    {3,7,8}
      {1,2}  {2,3}  {2,5,7}    {4,6,8}
                    {3,4,7}    {5,6,7}
                    {3,5,6}    {1,2,7,8}
                    {1,2,4,7}  {1,3,6,8}
                    {1,2,5,6}  {1,4,5,8}
                    {1,3,4,6}  {1,4,6,7}
                    {2,3,4,5}  {2,3,5,8}
                               {2,3,6,7}
                               {2,4,5,7}
                               {3,4,5,6}
                               {1,2,3,4,8}
                               {1,2,3,5,7}
                               {1,2,4,5,6}
(End)
		

Crossrefs

"Decimations": A060468 = 2*A060005, A123117 = 2*A104456.
Analogous sequences for sums of squares and cubes are A158092, A158118, see also A019568. - Pietro Majer, Mar 15 2009

Programs

  • Maple
    M:=400; t1:=1; lprint(0,1); for n from 1 to M do t1:=expand(t1*(x^n+1/x^n)); lprint(n, coeff(t1,x,0)); od: # N. J. A. Sloane, Jul 07 2008
  • Mathematica
    f[n_, s_] := f[n, s]=Which[n==0, If[s==0, 1, 0], Abs[s]>(n*(n+1))/2, 0, True, f[ n-1, s-n]+f[n-1, s+n]]; a[n_] := f[n, 0]
    nmax = 50; d = {1}; a1 = {};
    Do[
      i = Ceiling[Length[d]/2];
      AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
      d = PadLeft[d, Length[d] + 2 n] + PadRight[d, Length[d] + 2 n];
      , {n, nmax}];
    a1 (* Ray Chandler, Mar 13 2014 *)
  • PARI
    a(n)=my(x='x); polcoeff(prod(k=1,n,x^k+x^-k)+O(x),0) \\ Charles R Greathouse IV, May 18 2015
    
  • PARI
    a(n)=0^n+floor(prod(k=1,n,2^(n*k)+2^(-n*k)))%(2^n) \\ Tani Akinari, Mar 09 2016

Formula

Asymptotic formula: a(n) ~ sqrt(6/Pi)*n^(-3/2)*2^n for n = 0 or 3 (mod 4) as n approaches infinity.
a(n) = 0 unless n == 0 or 3 (mod 4).
a(n) = constant term in expansion of Product_{ k = 1..n } (x^k + 1/x^k). - N. J. A. Sloane, Jul 07 2008
If n = 0 or 3 (mod 4) then a(n) = coefficient of x^(n(n+1)/4) in Product_{k=1..n} (1+x^k). - D. Andrica and I. Tomescu.
a(n) = 2*A058377(n) for any n > 0. - Rémy Sigrist, Oct 11 2017

Extensions

More terms from Dean Hickerson, Aug 28 2001
Corrected and edited by Steven Finch, Feb 01 2009

A158092 Number of solutions to +- 1 +- 2^2 +- 3^2 +- 4^2 +- ... +- n^2 = 0.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 2, 2, 0, 0, 2, 10, 0, 0, 86, 114, 0, 0, 478, 860, 0, 0, 5808, 10838, 0, 0, 55626, 100426, 0, 0, 696164, 1298600, 0, 0, 7826992, 14574366, 0, 0, 100061106, 187392994, 0, 0, 1223587084, 2322159814, 0, 0, 16019866270, 30353305134, 0, 0
Offset: 1

Views

Author

Pietro Majer, Mar 12 2009

Keywords

Comments

Twice A083527.
Number of partitions of the half of the n-th-square-pyramidal number into parts that are distinct square numbers in the range 1 to n^2. Example: a(7)=2 since, squarePyramidal(7)=140 and 70=1+4+16+49=9+25+36. - Hieronymus Fischer, Oct 20 2010
Erdős & Surányi prove that this sequence is unbounded. More generally, there are infinitely many ways to write a given number k as such a sum. - Charles R Greathouse IV, Nov 05 2012
The expansion and integral representation formulas below are due to Andrica & Tomescu. The asymptotic formula is a conjecture; see Andrica & Ionascu. - Jonathan Sondow, Nov 11 2013

Examples

			For n=8 the a(8)=2 solutions are: +1-4-9+16-25+36+49-64=0 and -1+4+9-16+25-36-49+64=0.
		

Crossrefs

Programs

  • Maple
    From Pietro Majer, Mar 15 2009: (Start)
    N:=60: p:=1: a:=[]: for n from 1 to N do p:=expand(p*(x^(n^2)+x^(-n^2))):
    a:=[op(a), coeff(p, x, 0)]: od:a; (End)
    # second Maple program:
    b:= proc(n, i) option remember; local m; m:= (1+(3+2*i)*i)*i/6;
          `if`(n>m, 0, `if`(n=m, 1, b(abs(n-i^2), i-1) +b(n+i^2, i-1)))
        end:
    a:= n-> `if`(irem(n-1, 4)<2, 0, 2*b(n^2, n-1)):
    seq(a(n), n=1..60);  # Alois P. Heinz, Nov 05 2012
  • Mathematica
    b[n_, i_] := b[n, i] = With[{m = (1+(3+2*i)*i)*i/6}, If[n>m, 0, If[n == m, 1, b[ Abs[n-i^2], i-1] + b[n+i^2, i-1]]]]; a[n_] := If[Mod[n-1, 4]<2, 0, 2*b[n^2, n-1]]; Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Mar 13 2015, after Alois P. Heinz *)
  • PARI
    a(n)=2*sum(i=0,2^(n-1)-1,sum(j=1,n-1,(-1)^bittest(i,j-1)*j^2)==n^2) \\ Charles R Greathouse IV, Nov 05 2012
    
  • Python
    from itertools import count, islice
    from collections import Counter
    def A158092_gen(): # generator of terms
        ccount = Counter({0:1})
        for i in count(1):
            bcount = Counter()
            for a in ccount:
                bcount[a+(j:=i**2)] += ccount[a]
                bcount[a-j] += ccount[a]
            ccount = bcount
            yield(ccount[0])
    A158092_list = list(islice(A158092_gen(),20)) # Chai Wah Wu, Jan 29 2024

Formula

Constant term in the expansion of (x + 1/x)(x^4 + 1/x^4)..(x^n^2 + 1/x^n^2).
a(n)=0 for any n == 1 or 2 (mod 4).
Integral representation: a(n)=((2^n)/pi)*int_0^pi prod_{k=1}^n cos(x*k^2) dx
Asymptotic formula: a(n) = (2^n)*sqrt(10/(pi*n^5))*(1+o(1)) as n-->infty; n == -1 or 0 (mod 4).
a(n) = 2 * A083527(n). - T. D. Noe, Mar 12 2009
min{n : a(n) > 0} = A231015(0) = 7. - Jonathan Sondow, Nov 06 2013

Extensions

a(51)-a(56) from R. H. Hardin, Mar 12 2009
Edited by N. J. A. Sloane, Sep 15 2009

A158380 Number of solutions to +-1 +- 3 +- 6 +- ... +- n(n+1)/2 = 0.

Original entry on oeis.org

1, 0, 0, 0, 2, 0, 2, 2, 4, 0, 12, 16, 26, 0, 66, 104, 210, 0, 620, 970, 1748, 0, 5948, 10480, 18976, 0, 60836, 111430, 209460, 0, 704934, 1284836, 2387758, 0, 8331820, 15525814, 28987902, 0, 101242982, 190267598, 358969426, 0, 1275032260, 2404124188, 4547419694
Offset: 0

Views

Author

Pietro Majer, Mar 17 2009

Keywords

Comments

Equivalently, number of partitions of the set of the first n triangular numbers {t(1),...,t(n)} into two classes with equal sums.
Constant term in the expansion of (x + 1/x)(x^3 + 1/x^3)...(x^t(n) + 1/x^t(n)).
a(n) = 0 for all n == 1 (mod 4).
Andrica & Tomescu give a more general integral formula than the one below. - Jonathan Sondow, Nov 11 2013

Examples

			For n=6 the 2 solutions are +1-3+6-10-15+21 = 0 and -1+3-6+10+15-21 = 0.
		

Crossrefs

Programs

  • Maple
    N:=70: p:=1: a:=[]: for n from 0 to N do
    p:=expand(p*(x^(n*(n+1)/2)+x^(-n*(n+1)/2))):
    a:=[op(a), coeff(p, x, 0)]: od:a;
    # second Maple program:
    b:= proc(n, i) option remember; (m-> `if`(n>m, 0,
          `if`(n=m, 1, b(abs(n-i*(i+1)/2), i-1)+
          b(n+i*(i+1)/2, i-1))))((2+(3+i)*i)*i/6)
        end:
    a:= n-> `if`(irem(n, 4)=1, 0, b(0, n)):
    seq(a(n), n=0..50);  # Alois P. Heinz, Sep 17 2017
  • Mathematica
    a[n_] := With[{t = Table[k(k+1)/2, {k, 1, n}]}, Coefficient[Times @@ (x^t + 1/x^t), x, 0]];
    Table[an = a[n]; Print["a(", n, ") = ", an]; an, {n, 0, 50}] (* Jean-François Alcover, Jun 16 2018 *)
  • PARI
    t(k) = k*(k+1)/2;
    a(n) = polcoeff(prod(k=1, n, (x^t(k)+ 1/x^t(k))), 0); \\ Michel Marcus, May 19 2015

Formula

a(n) = (2^n/Pi) * Integral_{x=0..Pi} cos(x)*cos(3x)*...*cos(n(n+1)x/2) dx.
a(n) ~ 2^(n+1)*sqrt(10/Pi)*n^(-5/2)*(1+o(1)) as n --> infinity, n !== 1 (mod 4).
a(n) = 2 * A058498(n) for n > 0. - Alois P. Heinz, Nov 01 2011

Extensions

a(0) = 1 prepended by Joerg Arndt, Sep 17 2017
Example corrected by Ilya Gutkovskiy, Feb 02 2022

A158465 Number of solutions to +-1+-2^4+-3^4+-4^4...+-n^4=0.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 16, 18, 0, 0, 32, 100, 0, 0, 424, 510, 0, 0, 2792, 5988, 0, 0, 29058, 45106, 0, 0, 276828, 473854, 0, 0, 2455340, 4777436, 0, 0, 27466324, 46429640, 0, 0, 280395282, 526489336, 0, 0, 3193589950, 5661226928, 0, 0
Offset: 1

Views

Author

Pietro Majer, Mar 19 2009

Keywords

Comments

Constant term in the expansion of (x + 1/x)(x^16 + 1/x^16)..(x^n^4 + 1/x^n^4).
a(n)=0 for any n=1 (mod 4) or n=2 (mod 4).
Andrica & Tomescu give a more general integral formula than the one below. The asymptotic formula below is a conjecture by Andrica & Ionascu; it remains unproven. - Jonathan Sondow, Nov 11 2013

Examples

			For n=16 the a(16) = 2 solutions are +1 +16 +81 +256 -625 -1296 -2401 +4096 +6561 +10000 +14641 +20736 -28561 -38416 -50625 +65536 = 0 and the opposite.
		

Crossrefs

A111253(n) = a(n)/2. - Alois P. Heinz, Oct 31 2011

Programs

  • Maple
    N:=32: p:=1 a:=[]: for n from 32 to N do p:=expand
    (p*(x^(n^4)+x^(-n^4))): a:=[op(a), coeff(p,x,0)]: od:a;

Formula

Integral representation: a(n) = ((2^n)/Pi)*int_0^pi prod_{k=1}^n cos(x*k^4) dx.
Asymptotic formula: a(n) = (2^n)*sqrt(18/(Pi*n^9))*(1+o(1)) as n->infinity; n=-1 or 0 (mod 4).

Extensions

a(35)-a(58) from Alois P. Heinz, Oct 31 2011

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

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

Original entry on oeis.org

1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 4, 1, 4, 2, 6, 1, 4, 124, 12, 344, 536, 712, 1140, 713, 4574, 2260, 4384, 5956, 10634, 73758, 48774, 197767, 406032, 638830, 1147500, 1097442, 4249160, 3263500, 6499466, 11844316, 21907736, 82561050, 85185855, 261696060
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 19 2022

Keywords

Examples

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

Crossrefs

Programs

  • Maple
    f:= proc(n) local S,k,x,s;
      S:= mul(1 + x^(2*k^3),k=1..n);
      s:= sum(k^3,k=1..n);
      coeff(S,x,s) + coeff(S,x,s+1)
    end proc:
    map(f, [$0..50]); # Robert Israel, Mar 15 2023
  • 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(0, n) + b(1, n)
    print([a(n) for n in range(46)]) # Michael S. Branicky, Jan 19 2022

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

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

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 3, 5, 17, 31, 61, 139, 309, 701, 1651, 3849, 8929, 22295, 53777, 131025, 335619, 837999, 2107947, 5484373, 14071891, 36275323, 95881995, 250956301, 659257445, 1763642977, 4685724391, 12496708267, 33766814039, 90846586161, 245197523769
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 20 2024

Keywords

Comments

All terms are odd.

Crossrefs

Programs

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

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

Original entry on oeis.org

0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 1, 0, 0, 6, 1, 0, 0, 12, 344, 0, 0, 1140, 713, 0, 0, 4384, 5956, 0, 0, 48774, 197767, 0, 0, 1147500, 1097442, 0, 0, 6499466, 11844316, 0, 0, 85185855, 261696060, 0, 0, 1649383741, 2039067290, 0, 0, 13301106607, 25603704324
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 30 2024

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Coefficient[Product[(x^(k^3) + 1/x^(k^3)), {k, 1, n}], x, 1], {n, 0, 50}]

Formula

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

A292522 Number of solutions to +- 1^3 +- 3^3 +- 5^3 +- 7^3 +- ... +- (4*n-1)^3 = 0.

Original entry on oeis.org

1, 0, 0, 0, 0, 0, 0, 0, 2, 6, 2, 10, 118, 88, 254, 3308, 2558, 9578, 84568, 121804, 496396, 3312400, 5755724, 19021024, 116780256, 241754350, 883730786, 4923089216, 11668601596, 42357336066, 205859270250, 538878582526, 1974181071852, 9194146886086, 26277093562150
Offset: 0

Views

Author

Seiichi Manyama, Sep 18 2017

Keywords

Examples

			For n=8 the 2 solutions are
+1^3-3^3-5^3+7^3-9^3+11^3+13^3-15^3-17^3+19^3+21^3-23^3+25^3-27^3-29^3+31^3 = 0 and
-1^3+3^3+5^3-7^3+9^3-11^3-13^3+15^3+17^3-19^3-21^3+23^3-25^3+27^3+29^3-31^3 = 0.
		

Crossrefs

Formula

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

Extensions

a(29)-a(34) from Alois P. Heinz, Sep 18 2017
Showing 1-10 of 10 results.