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-20 of 48 results. Next

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

A326178 Number of subsets of {1..n} whose product is equal to their sum.

Original entry on oeis.org

0, 1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67
Offset: 0

Views

Author

Gus Wiseman, Jun 13 2019

Keywords

Comments

Same as A001477 (the nonnegative integers) with 3 removed.

Examples

			The a(1) = 1 through a(9) = 10 subsets:
  {1}  {1}  {1}      {1}      {1}      {1}      {1}      {1}      {1}
       {2}  {2}      {2}      {2}      {2}      {2}      {2}      {2}
            {3}      {3}      {3}      {3}      {3}      {3}      {3}
            {1,2,3}  {4}      {4}      {4}      {4}      {4}      {4}
                     {1,2,3}  {5}      {5}      {5}      {5}      {5}
                              {1,2,3}  {6}      {6}      {6}      {6}
                                       {1,2,3}  {7}      {7}      {7}
                                                {1,2,3}  {8}      {8}
                                                         {1,2,3}  {9}
                                                                  {1,2,3}
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Times@@#==Plus@@#&]],{n,0,10}]

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

Original entry on oeis.org

1, 1, 0, 0, 2, 3, 0, 0, 12, 21, 0, 0, 113, 202, 0, 0, 1218, 2241, 0, 0, 14326, 26776, 0, 0, 177714, 335607, 0, 0, 2287975, 4353975, 0, 0, 30282850, 57965473, 0, 0, 409476546, 787414730, 0, 0, 5631955466, 10870618388, 0, 0, 78545902971, 152074824054, 0, 0
Offset: 0

Views

Author

Vladeta Jovovic, Aug 28 2001

Keywords

Examples

			a(8) = 12 because 8 = 1+2+3+4+5-6+7-8 = -1+2+3+4-5+6+7-8 = 1-2+3-4+5+6+7-8 = -1-2-3+4+5+6+7-8 = -1+2+3+4+5-6-7+8 = 1-2+3+4-5+6-7+8 = 1+2-3-4+5+6-7+8 = -1-2+3-4+5+6-7+8 = 1+2-3+4-5-6+7+8 = -1-2+3+4-5-6+7+8 = -1+2-3-4+5-6+7+8 = 1-2-3-4-5+6+7+8.
		

Crossrefs

Programs

  • 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, n]
    nmax = 44; d = {1}; a1 = {1};
    Do[
      d = PadLeft[d, Length[d] + 2 n] + PadRight[d, Length[d] + 2 n];
      i = Ceiling[Length[d]/2] + n;
      AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
      , {n, nmax}];
    a1 (* Ray Chandler, Mar 25 2014 *)

Formula

a(n) = [x^n] Product_{k=1..n} (x^k + 1/x^k). - Ilya Gutkovskiy, Jan 28 2022

Extensions

More terms from Dean Hickerson, Aug 30 2001

A326172 Number of nonempty subsets of {2..n} whose product is divisible by their sum.

Original entry on oeis.org

0, 0, 1, 2, 3, 6, 12, 21, 34, 69, 140, 278, 561, 1144, 2367, 4936, 9503, 19368, 38202, 77911, 156458, 318911, 651462, 1329624, 2596458, 5144833, 10494839, 20500025, 40923643, 83620258, 164982516, 335873558, 651383048, 1310551707, 2655240565, 5295397093, 10338145110, 21052407259, 42748787713, 86078893923, 169349494068
Offset: 0

Views

Author

Gus Wiseman, Jun 11 2019

Keywords

Examples

			The a(2) = 1 through a(7) = 21 subsets:
  {2}  {2}  {2}  {2}      {2}          {2}
       {3}  {3}  {3}      {3}          {3}
            {4}  {4}      {4}          {4}
                 {5}      {5}          {5}
                 {2,3,5}  {6}          {6}
                 {3,4,5}  {3,6}        {7}
                          {2,3,5}      {3,6}
                          {2,4,6}      {2,3,5}
                          {3,4,5}      {2,4,6}
                          {4,5,6}      {2,5,7}
                          {3,4,5,6}    {3,4,5}
                          {2,3,4,5,6}  {3,4,7}
                                       {3,5,7}
                                       {4,5,6}
                                       {2,3,6,7}
                                       {2,5,6,7}
                                       {3,4,5,6}
                                       {3,5,6,7}
                                       {2,3,4,5,6}
                                       {2,3,4,5,7}
                                       {2,4,5,6,7}
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[2,n],{1,n}],Divisible[Times@@#,Plus@@#]&]],{n,0,10}]

Extensions

a(21)-a(29) from Alois P. Heinz, Jun 13 2019
a(30)-a(40) from Bert Dobbelaere, Jun 22 2019

A059529 For 1 < x, each c(i) is "multiply" (*) or "divide" (/); a(n) is number of choices for c(0),...,c(n-1) so that 1 c(0) x^1 c(1) x^2,.., c(n-1) x^n is an integer.

Original entry on oeis.org

1, 1, 2, 5, 9, 16, 32, 68, 135, 256, 512, 1059, 2110, 4096, 8192, 16745, 33425, 65536, 131072, 266254, 531924, 1048576, 2097152, 4244214, 8482454, 16777216, 33554432, 67741466, 135417620, 268435456, 536870912, 1082015434, 2163280087, 4294967296, 8589934592
Offset: 0

Views

Author

Naohiro Nomoto, Feb 16 2001

Keywords

Comments

From Gus Wiseman, Jul 04 2019: (Start)
Also the number of subsets of {1..n} whose sum is less than or equal to the sum of their complement. For example, the a(0) = 1 through a(5) = 16 subsets are:
{} {} {} {} {} {}
{1} {1} {1} {1}
{2} {2} {2}
{3} {3} {3}
{1,2} {4} {4}
{1,2} {5}
{1,3} {1,2}
{1,4} {1,3}
{2,3} {1,4}
{1,5}
{2,3}
{2,4}
{2,5}
{3,4}
{1,2,3}
{1,2,4}
(End)

Examples

			x = 3: for n = 2 there are 2 possibilities: 1*3*9=27 and 1/3*9=3. For n = 4 there are 9 possibilities: 1*3*9*27*81 1/3*9*27*81 1*3/9*27*81 1/3/9*27*81 1*3*9/27*81 1*3*9*27/81 1/3*9/27*81 1/3*9*27/81 1*3/9/27*81
		

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Plus@@Complement[Range[n],#]>=Plus@@#&]],{n,0,10}] (* Gus Wiseman, Jul 04 2019 *)

Formula

a(0)=1; for 0A058377(n)+2^(n-1).

Extensions

More terms from Alois P. Heinz, Jun 13 2019

A083527 a(n) is the number of times that sums 1+-4+-9+-16+-...+-n^2 of the first n squares is zero. There are 2^(n-1) choices for the sign patterns.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 1, 5, 0, 0, 43, 57, 0, 0, 239, 430, 0, 0, 2904, 5419, 0, 0, 27813, 50213, 0, 0, 348082, 649300, 0, 0, 3913496, 7287183, 0, 0, 50030553, 93696497, 0, 0, 611793542, 1161079907, 0, 0, 8009933135, 15176652567, 0, 0
Offset: 1

Views

Author

T. D. Noe, Apr 29 2003

Keywords

Comments

The frequency of each possible sum is computed by the Mathematica program without explicitly computing the individual sums.
a(n) is the maximal number of subsets of the first n squares that share the same sum. Cf. A025591, A083309.
a(n)=0 when n==1 or 2 (mod 4).

Examples

			a(7) = 1 because there is only one sign pattern of the first seven squares that yields zero: 1+4-9+16-25-36+49.
		

Crossrefs

Programs

  • Maple
    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, b(n^2, n-1)):
    seq(a(n), n=1..40);  # Alois P. Heinz, Oct 31 2011
  • Mathematica
    d={1, 1}; nMax=60; zeroLst={0}; Do[p=n^2; d=PadLeft[d, Length[d]+p]+PadRight[d, Length[d]+p]; If[1==Mod[Length[d], 2], AppendTo[zeroLst, d[[(Length[d]+1)/2]]], AppendTo[zeroLst, 0]], {n, 2, nMax}]; zeroLst/2
    p = 1; t = {}; Do[p = Expand[p(x^(n^2) + x^(-n^2))]; AppendTo[t, Select[p, NumberQ[ # ] &]/2], {n, 51}]; t (* Robert G. Wilson v, Oct 31 2005 *)
  • PARI
    a(n)=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

Formula

a(n) is half the coefficient of x^0 in the product_{k=1..n} x^(k^2)+x^(k^-2).
a(n) = A158092(n)/2.
a(n) = [x^(n^2)] Product_{k=1..n-1} (x^(k^2) + 1/x^(k^2)). - Ilya Gutkovskiy, Feb 01 2024

A225310 T(n,k)=Number of nXk -1,1 arrays such that the sum over i=1..n,j=1..k of i*x(i,j) is zero and rows are nondecreasing (ways to put k thrusters pointing east or west at each of n positions 1..n distance from the hinge of a south-pointing gate without turning the gate).

Original entry on oeis.org

0, 1, 0, 0, 1, 2, 1, 0, 3, 2, 0, 3, 6, 7, 0, 1, 0, 9, 16, 15, 0, 0, 3, 12, 31, 0, 35, 8, 1, 0, 17, 52, 113, 0, 87, 14, 0, 5, 22, 83, 0, 443, 474, 217, 0, 1, 0, 27, 122, 427, 0, 1787, 1576, 547, 0, 0, 5, 34, 175, 0, 2341, 5304, 7445, 0, 1417, 70, 1, 0, 41, 238, 1165, 0, 13333, 26498
Offset: 1

Views

Author

R. H. Hardin May 05 2013

Keywords

Comments

Table starts
..0....1....0......1.....0.......1......0........1......0.........1.......0
..0....1....0......3.....0.......3......0........5......0.........5.......0
..2....3....6......9....12......17.....22.......27.....34........41......48
..2....7...16.....31....52......83....122......175....238.......317.....410
..0...15....0....113.....0.....427......0.....1165......0......2591.......0
..0...35....0....443.....0....2341......0.....8221......0.....22351.......0
..8...87..474...1787..5304...13333..29638....60007.112790....199669..336342
.14..217.1576...7445.26498...77721.197440...449693.939130...1828785.3360554
..0..547....0..31593.....0..461973......0..3437315......0..17085339.......0
..0.1417....0.136351.....0.2791167......0.26700429......0.162204059.......0

Examples

			Some solutions for n=4 k=4
..1..1..1..1...-1.-1..1..1...-1.-1.-1..1....1..1..1..1...-1..1..1..1
..1..1..1..1...-1..1..1..1...-1.-1.-1..1...-1.-1.-1.-1...-1.-1..1..1
.-1.-1.-1.-1....1..1..1..1...-1..1..1..1....1..1..1..1...-1..1..1..1
.-1.-1..1..1...-1.-1.-1.-1...-1.-1..1..1...-1.-1.-1..1...-1.-1.-1..1
		

Crossrefs

Column 1 is A063865
Column 2 is A007576
Row 3 is A008810(n+1)

Formula

Empirical for row n:
n=1: a(n) = a(n-2)
n=2: a(n) = a(n-2) +a(n-4) -a(n-6)
n=3: a(n) = 2*a(n-1) -a(n-2) +a(n-3) -2*a(n-4) +a(n-5)
n=4: a(n) = a(n-1) +a(n-2) -2*a(n-5) +a(n-8) +a(n-9) -a(n-10)
n=5: [order 18]
n=6: [order 42]
n=7: [order 24]
n=8: [order 36]

A158118 Number of solutions of +-1+-2^3+-3^3..+-n^3=0.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 4, 2, 0, 0, 4, 124, 0, 0, 536, 712, 0, 0, 4574, 2260, 0, 0, 10634, 73758, 0, 0, 406032, 638830, 0, 0, 4249160, 3263500, 0, 0, 21907736, 82561050, 0, 0, 485798436, 945916970, 0, 0, 5968541478, 6839493576, 0, 0
Offset: 1

Views

Author

Pietro Majer, Mar 12 2009

Keywords

Comments

Constant term in the expansion of (x + 1/x)(x^8 + 1/x^8)..(x^n^3 + 1/x^n^3).
a(n) = 0 for any n=1 (mod 4) or n=2 (mod 4).
The expansion above and the integral representation formula below are due to Andrica & Tomescu. The asymptotic formula is a conjecture; see Andrica & Ionascu. - Jonathan Sondow, Nov 06 2013

Examples

			Example: For n=12 the a(12) = 2 solutions are:
+1+8-27+64-125-216-343+512+729-1000-1331+1728=0,
-1-8+27-64+125+216+343-512-729+1000+1331-1728=0.
		

Crossrefs

Equals twice A113263.
Cf. A063865, A158092, A019568. - Pietro Majer, Mar 15 2009

Programs

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

Formula

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

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

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

Original entry on oeis.org

1, 0, 2, 2, 8, 20, 68, 206, 692, 2306, 7930, 27492, 96792, 343670, 1231932, 4447510, 16164914, 59086618, 217091832, 801247614, 2969432270, 11045446688, 41224168020, 154329373022, 579377940390, 2180684278698, 8227240466520, 31107755899600
Offset: 0

Views

Author

Seiichi Manyama, Sep 17 2017

Keywords

Examples

			For n=2 the 2 solutions are +1-3-5+7 = 0 and -1+3+5-7 = 0.
For n=3 the 2 solutions are +1+3+5-7+9-11 = 0 and -1-3-5+7-9+11 = 0.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := SeriesCoefficient[Product[x^(2k - 1) + 1/x^(2k - 1), {k, 1, 2n}], {x, 0, 0}];
    Table[a[n], {n, 0, 27}] (* Jean-François Alcover, Mar 10 2023 *)
  • PARI
    {a(n) = polcoeff(prod(k=1, 2*n, x^(2*k-1)+1/x^(2*k-1)), 0)}

Formula

Constant term in the expansion of Product_{k=1..2*n} (x^(2*k-1)+1/x^(2*k-1)).
a(n) = 2*A156700(n) for n > 0.
Previous Showing 11-20 of 48 results. Next