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 11 results. Next

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

A326156 Number of nonempty subsets of {1..n} whose product is divisible by their sum.

Original entry on oeis.org

0, 1, 2, 4, 5, 10, 19, 34, 64, 129, 267, 541, 1104, 2253, 4694, 9804, 18894, 38539, 76063, 155241, 311938, 636120, 1299869, 2653853, 5183363, 10272289, 20958448, 40945577, 81745769, 167048919, 329598054, 671038751, 1301431524, 2618590422, 5305742557, 10582105199, 20660489585, 42075929255, 85443680451, 172057673225, 338513788818
Offset: 0

Views

Author

Gus Wiseman, Jun 11 2019

Keywords

Examples

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

Crossrefs

Programs

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

Extensions

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

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

Original entry on oeis.org

1, 1, 1, 2, 5, 12, 27, 69, 178, 457, 1194, 3178, 8538, 23062, 62726, 171804, 473069, 1308397, 3634075, 10133154, 28352421, 79575702, 223981549, 632101856, 1788172541, 5069879063, 14403962756, 41001479103, 116921037003, 333971884899, 955443681814, 2737387314548, 7853533625522, 22560919253095, 64890249175438, 186854616134794
Offset: 0

Views

Author

Paul D. Hanna, Jul 10 2018

Keywords

Comments

a(n) is the coefficient of both x^n and 1/x^n in Product_{k=1..n} (1/x^k + 1 + x^k), while A007576 gives the constant term in the symmetric product.

Crossrefs

Programs

  • Mathematica
    nmax = 40; p = 1; Flatten[{1, Table[Coefficient[p = Expand[p*(1/x^n + 1 + x^n)], x^n], {n, 1, nmax}]}] (* Vaclav Kotesovec, Jul 11 2018 *)
  • PARI
    {a(n) = polcoeff( prod(k=1,n, 1/x^k + 1 + x^k) + x*O(x^n),n)}
    for(n=0,40, print1(a(n),", "))
    
  • Python
    from collections import Counter
    def A316706(n):
        c = {0:1}
        for k in range(1,n+1):
            b = Counter(c)
            for j in c:
                a = c[j]
                b[j+k] += a
                b[j-k] += a
            c = b
        return c[n] # Chai Wah Wu, Feb 05 2024

Formula

a(n) = [x^n] Product_{k=1..n} (1/x^k + 1 + x^k).
a(n) = [x^(n*(n-1)/2)] Product_{k=1..n} (1 + x^k + x^(2*k)).
a(n) = [x^(n*(n+3)/2)] Product_{k=1..n} (1 + x^k + x^(2*k)).
a(n) ~ 3^(n + 1) / (2 * sqrt(Pi) * n^(3/2)). - Vaclav Kotesovec, Jul 11 2018

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

A326174 Number of subsets of {1..n} containing n whose sum is greater than or equal to the sum of their complement.

Original entry on oeis.org

1, 2, 4, 7, 13, 25, 50, 98, 186, 366, 739, 1457, 2822, 5589, 11258, 22304, 43629, 86658, 174257, 346180, 680955, 1354829, 2721296, 5414787, 10689261, 21290468, 42730228, 85112982, 168430866, 335726276, 673421519, 1342347992, 2661053796, 5307062034, 10640664164
Offset: 1

Views

Author

Gus Wiseman, Jun 11 2019

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],MemberQ[#,n]&&Plus@@#>=Plus@@Complement[Range[n],#]&]],{n,10}]

Extensions

a(21)-a(42) from Bert Dobbelaere, Jun 22 2019

A326173 Number of maximal subsets of {1..n} whose sum is less than or equal to the sum of their complement.

Original entry on oeis.org

1, 1, 1, 2, 4, 5, 8, 16, 24, 44, 77, 133, 240, 429, 772, 1414, 2588, 4742, 8761, 16273, 30255, 56392, 105581, 198352, 373228, 703409, 1329633, 2519927, 4781637, 9084813, 17298255, 33001380, 63023204, 120480659, 230702421, 442423139, 849161669, 1631219288, 3137595779, 6042247855, 11644198080, 22455871375, 43351354727
Offset: 0

Views

Author

Gus Wiseman, Jun 11 2019

Keywords

Comments

Also the number of minimal subsets of {1..n} whose sum is greater than or equal to the sum of their complement. For example, the a(0) = 1 through a(7) = 16 subsets are:
{} {1} {2} {3} {1,4} {3,5} {5,6} {1,6,7}
{1,2} {2,3} {4,5} {1,4,6} {2,5,7}
{2,4} {1,2,5} {2,3,6} {2,6,7}
{3,4} {1,3,4} {2,4,5} {3,4,7}
{2,3,4} {2,4,6} {3,5,6}
{3,4,5} {3,5,7}
{3,4,6} {3,6,7}
{1,2,3,5} {4,5,6}
{4,5,7}
{4,6,7}
{5,6,7}
{1,2,4,7}
{1,2,5,6}
{1,3,4,6}
{2,3,4,5}
{2,3,4,6}

Examples

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

Crossrefs

The non-maximal case is A059529.

Programs

  • Mathematica
    fasmax[y_]:=Complement[y,Union@@(Most[Subsets[#]]&/@y)];
    Table[Length[fasmax[Select[Subsets[Range[n]],Plus@@Complement[Range[n],#]>=Plus@@#&]]],{n,0,10}]

Extensions

a(16)-a(42) from Bert Dobbelaere, Jun 22 2019

A326175 Number of minimal subsets of {1..n} containing n whose sum is greater than or equal to the sum of their complement.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 10, 14, 25, 44, 71, 128, 231, 411, 740, 1352, 2481, 4570, 8390, 15550, 29103, 54345, 101312, 190316, 359827, 679051, 1279956, 2426200, 4621174, 8789565, 16701225, 31871629, 61052515, 116818123, 223333533, 428435056, 824395640, 1584833707, 3044562148, 5865073390, 11326741619, 21857561924
Offset: 1

Views

Author

Gus Wiseman, Jun 11 2019

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    fasmin[y_]:=Complement[y,Union@@Table[Union[s,#]&/@Rest[Subsets[Complement[Union@@y,s]]],{s,y}]];
    Table[Length[fasmin[Select[Subsets[Range[n]],MemberQ[#,n]&&Plus@@#>=Plus@@Complement[Range[n],#]&]]],{n,10}]

Extensions

a(15)-a(42) from Bert Dobbelaere, Jun 22 2019

A326441 Number of subsets of {1..n} whose sum is equal to the product of their complement.

Original entry on oeis.org

0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 3, 1, 2, 1, 3, 3, 3, 3, 1, 4, 4, 3, 2, 2, 4, 3, 5, 3, 2, 4, 5, 4, 5, 6, 1, 4, 2, 5, 4, 7, 4, 4, 3, 3, 6, 14, 3, 4, 10, 6, 3, 6, 4, 4, 4, 8, 7, 6, 8, 7, 10, 5, 11, 8, 5, 11, 4, 7, 7, 5, 8, 12, 5, 6, 9, 8, 11, 8, 5, 8, 9, 8, 10, 8
Offset: 0

Views

Author

Gus Wiseman, Jul 07 2019

Keywords

Comments

Essentially the same as A178830. - R. J. Mathar, Jul 12 2019

Examples

			The initial terms count the following subsets:
   1: {1}
   3: {1,2}
   5: {3,5}
   6: {3,4,5}
   7: {2,4,5,7}
   8: {2,4,5,6,7}
   9: {2,3,5,6,7,9}
  10: {4,5,6,8,9,10}
  10: {2,3,5,6,7,8,9}
  10: {1,2,3,4,5,8,9,10}
Also the number of subsets of {1..n} whose product is equal to the sum of their complement. For example, the initial terms count the following subsets:
   1: {}
   3: {3}
   5: {1,2,4}
   6: {1,2,6}
   7: {1,3,6}
   8: {1,3,8}
   9: {1,4,8}
  10: {6,7}
  10: {1,4,10}
  10: {1,2,3,7}
		

Crossrefs

Programs

  • Maple
    b:= proc(n, s, p)
          `if`(s=p, 1, `if`(n<1, 0, b(n-1, s, p)+
          `if`(s-n b(n, n*(n+1)/2, 1):
    seq(a(n), n=0..100);  # Alois P. Heinz, Jul 12 2019
  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Plus@@#==Times@@Complement[Range[n],#]&]],{n,0,10}]

Extensions

a(21)-a(83) from Giovanni Resta, Jul 08 2019

A326179 Number of subsets of {1..n} containing n whose product is divisible by their sum.

Original entry on oeis.org

0, 1, 1, 2, 1, 5, 9, 15, 30, 65, 138, 274, 563, 1149, 2441, 5110, 9090, 19645, 37524, 79178, 156697, 324182, 663749, 1353984, 2529510, 5088926, 10686159, 19987129, 40800192, 85303150, 162549135, 341440697, 630392773, 1317158898, 2687152135, 5276362642, 10078384386, 21415439670, 43367751196, 86613992774, 166456115593
Offset: 0

Views

Author

Gus Wiseman, Jun 13 2019

Keywords

Examples

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

Crossrefs

Programs

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

Extensions

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

A326180 Number of maximal subsets of {1..n} containing n whose product is divisible by their sum.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 3, 1, 1, 1, 11, 1, 16, 1, 1, 1, 27, 1
Offset: 0

Views

Author

Gus Wiseman, Jun 13 2019

Keywords

Examples

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

Crossrefs

Programs

  • Mathematica
    fasmax[y_]:=Complement[y,Union@@(Most[Subsets[#]]&/@y)];
    Table[Length[fasmax[Select[Subsets[Range[n],{1,n}],MemberQ[#,n]&&Divisible[Times@@#,Plus@@#]&]]],{n,0,10}]

Formula

a(A060462(n)) = 1.
Showing 1-10 of 11 results. Next