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 21-30 of 40 results. Next

A047997 Triangle of numbers a(n,k) = number of balance positions when k equal weights are placed at a k-subset of the points {-n, -(n-1), ..., n-1, n} on a centrally pivoted rod.

Original entry on oeis.org

1, 1, 2, 1, 3, 5, 1, 4, 8, 12, 1, 5, 13, 24, 32, 1, 6, 18, 43, 73, 94, 1, 7, 25, 69, 141, 227, 289, 1, 8, 32, 104, 252, 480, 734, 910, 1, 9, 41, 150, 414, 920, 1656, 2430, 2934, 1, 10, 50, 207, 649, 1636, 3370, 5744, 8150, 9686, 1, 11, 61, 277, 967
Offset: 1

Views

Author

Keywords

Comments

Also the number of k-subsets of {1..2n-1} with mean n. - Gus Wiseman, Apr 16 2023

Examples

			From _Gus Wiseman_, Apr 18 2023: (Start)
Triangle begins:
    1
    1    2
    1    3    5
    1    4    8   12
    1    5   13   24   32
    1    6   18   43   73   94
    1    7   25   69  141  227  289
    1    8   32  104  252  480  734  910
    1    9   41  150  414  920 1656 2430 2934
Row n = 4 counts the following balanced subsets:
  {0}  {-1,1}  {-1,0,1}   {-3,0,1,2}
       {-2,2}  {-2,0,2}   {-4,0,1,3}
       {-3,3}  {-3,0,3}   {-2,-1,0,3}
       {-4,4}  {-3,1,2}   {-2,-1,1,2}
               {-4,0,4}   {-3,-1,0,4}
               {-4,1,3}   {-3,-1,1,3}
               {-2,-1,3}  {-3,-2,1,4}
               {-3,-1,4}  {-3,-2,2,3}
                          {-4,-1,1,4}
                          {-4,-1,2,3}
                          {-4,-2,2,4}
                          {-4,-3,3,4}
(End)
		

Crossrefs

Last column is a(n,n) = A002838(n).
Row sums are A212352(n) = A047653(n)-1 = A000980(n)/2-1.
A007318 counts subsets by length, A327481 by mean, A013580 by median.
A327475 counts subsets with integer mean.

Programs

  • Mathematica
    a[n_, k_] := Length[ IntegerPartitions[ n*(2k - n + 1)/2, n, Range[2k - n + 1]]]; Flatten[ Table[ a[n, k], {k, 1, 11}, {n, 1, k}]] (* Jean-François Alcover, Jan 02 2012 *)
    Table[Length[Select[Subsets[Range[-n,n]],Length[#]==k&&Total[#]==0&]],{n,8},{k,n}] (* Gus Wiseman, Apr 16 2023 *)

Formula

Equivalent to number of partitions of n(2k-n+1)/2 into up to n parts each no more than 2k-n+1 so a(n, k)=A067059(n, n(2k-n+1)/2); row sums are A047653(n)-1 = A212352(n). - Henry Bottomley, Aug 11 2001

A307354 a(n) = Sum_{0<=i<=j<=n} (-1)^(i+j) * (i+j)!/(i!*j!).

Original entry on oeis.org

1, 2, 6, 19, 65, 231, 841, 3110, 11628, 43834, 166298, 634140, 2428336, 9331688, 35967462, 138987715, 538287881, 2088842463, 8119916647, 31613327405, 123251518641, 481125828853, 1880262896537, 7355767408395, 28803717914791, 112887697489907, 442784607413427
Offset: 0

Views

Author

Seiichi Manyama, Apr 03 2019

Keywords

Crossrefs

Partial sums of A026641. - Seiichi Manyama, Jan 30 2023

Programs

  • Mathematica
    Table[Sum[Sum[(-1)^(i + j)*(i + j)!/(i!*j!), {i, 0, j}], {j, 0, n}], {n, 0, 25}] (* Vaclav Kotesovec, Apr 04 2019 *)
  • PARI
    a(n) = sum(i=0, n, sum(j=i, n, (-1)^(i+j)*(i+j)!/(i!*j!)));
    
  • PARI
    a(n) = sum(k=0, n\3, (-1)^k*binomial(2*n-3*k, n)); \\ Seiichi Manyama, Jan 29 2023
    
  • PARI
    my(N=30, x='x+O('x^N)); Vec(1/(sqrt(1-4*x)*(1+x^3*(2/(1+sqrt(1-4*x)))^3))) \\ Seiichi Manyama, Jan 29 2023

Formula

a(n) = (A006134(n) + A120305(n))/2.
From Vaclav Kotesovec, Apr 04 2019: (Start)
Recurrence: 2*n*a(n) = (9*n-4)*a(n-1) - (3*n-2)*a(n-2) - 2*(2*n-1)*a(n-3).
a(n) ~ 2^(2*n+3) / (9*sqrt(Pi*n)). (End)
From Seiichi Manyama, Jan 29 2023: (Start)
a(n) = Sum_{k=0..floor(n/3)} (-1)^k * binomial(2*n-3*k,n).
G.f.: 1 / ( sqrt(1-4*x) * (1 + x^3 * c(x)^3) ), where c(x) is the g.f. of A000108. (End)
a(n) = [x^n] 1/((1+x^3) * (1-x)^(n+1)). - Seiichi Manyama, Apr 08 2024

A337238 Number k such that k and k+1 are both digitally balanced numbers in base 2 (A031443).

Original entry on oeis.org

9, 37, 41, 49, 141, 149, 153, 165, 169, 177, 197, 201, 209, 225, 541, 557, 565, 569, 589, 597, 601, 613, 617, 625, 653, 661, 665, 677, 681, 689, 709, 713, 721, 737, 781, 789, 793, 805, 809, 817, 837, 841, 849, 865, 901, 905, 913, 929, 961, 2109, 2141, 2157, 2165
Offset: 1

Views

Author

Amiram Eldar, Nov 21 2020

Keywords

Comments

All the terms are of the form 4*k + 1, where k is a digitally balanced number in base 2. Therefore, there are no 3 consecutive numbers that are digitally balanced in base 2.
The number of terms below 2^k is A079309(floor(k/2)-1) for k > 3.

Examples

			9 is a term since the binary representation of 9 is 1001, which contains 2 0's and 2 1's, and the binary representation of 9 + 1 = 10 is 1010, which also contains 2 0's and 2 1's.
		

Crossrefs

A206374 \ {2} is a subsequence.

Programs

  • Mathematica
    digBalQ[n_] := Module[{d = IntegerDigits[n, 2], m}, EvenQ@(m = Length@d) && Count[d, 1] == m/2]; Select[Range[2000], digBalQ[#] && digBalQ[# + 1] &]

Formula

a(n) = 4*A031443(n) + 1.

A371964 a(n) is the sum of all symmetric valleys in the set of Catalan words of length n.

Original entry on oeis.org

0, 0, 0, 0, 1, 7, 35, 155, 650, 2652, 10660, 42484, 168454, 665874, 2627130, 10353290, 40775045, 160534895, 631970495, 2487938015, 9795810125, 38576953505, 151957215305, 598732526105, 2359771876175, 9303298456451, 36688955738099, 144732209103699, 571117191135799
Offset: 0

Views

Author

Stefano Spezia, Apr 14 2024

Keywords

Examples

			a(4) = 1 because there is 1 Catalan word of length 4 with one symmetric valley: 0101.
a(5) = 7 because there are 7 Catalan words of length 5 with one symmetric valley: 00101, 01001, 01010, 01011, 01012, 01101, and 01212 (see example at p. 16 in Baril et al.).
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<4, 0,
          a(n-1)+binomial(2*n-4, n-4))
        end:
    seq(a(n), n=0..28);  # Alois P. Heinz, Apr 15 2024
  • Mathematica
    CoefficientList[Series[(1-4x+2x^2-(1-2x)Sqrt[1-4x])/(2(1-x) Sqrt[1-4x]),{x,0,29}],x]
  • Python
    from math import comb
    def A371964(n): return sum(comb((n-i<<1)-4,n-i-4) for i in range(n-3)) # Chai Wah Wu, Apr 15 2024

Formula

G.f.: (1 - 4*x + 2*x^2 - (1 - 2*x)*sqrt(1 - 4*x))/(2*(1 - x)*sqrt(1 - 4*x)).
a(n) = (3*n - 2)*A000108(n-1) - A079309(n) for n > 0.
a(n) ~ 2^(2*n)/(12*sqrt(Pi*n)).
a(n)/A371963(n) ~ 1/2.
a(n) - a(n-1) = A002694(n-2).

A263134 a(n) = Sum_{k=0..n} binomial(3*k+1,k).

Original entry on oeis.org

1, 5, 26, 146, 861, 5229, 32361, 202905, 1284480, 8191380, 52543545, 338641305, 2191124301, 14224347181, 92603307541, 604342068085, 3952451061076, 25898039418496, 169977746765071, 1117287239602471, 7353933943361866, 48461930821297546
Offset: 0

Views

Author

Bruno Berselli, Oct 10 2015

Keywords

Comments

Primes in sequence: 5, 92603307541, 52176309488123582020412161, ...
a(n) is divisible by n for n = 1, 2, 8, 55, 82, 171, 210, 1060, 1141, ...

Crossrefs

Partial sums of A045721.
Cf. A079309: Sum_{k=0..n} binomial(2*k+1,k).
Cf. A188675: Sum_{k=0..n} binomial(3*k,k).
Cf. A087413: Sum_{k=0..n} binomial(3*k+2,k).

Programs

  • Magma
    [&+[Binomial(3*k+1,k): k in [0..n]]: n in [0..25]];
    
  • Mathematica
    Table[Sum[Binomial[3 k + 1, k], {k, 0, n}], {n, 0, 25}]
  • Maxima
    makelist(sum(binomial(3*k+1,k),k,0,n),n,0,25);
    
  • PARI
    a(n) = sum(k=0, n, binomial(3*k+1,k)) \\ Colin Barker, Oct 16 2015
  • Sage
    [sum(binomial(3*k+1,k) for k in (0..n)) for n in (0..25)]
    

Formula

Recurrence: 2*n*(2*n + 1)*a(n) = (31*n^2 + 2*n - 3)*a(n-1) - 3*(3*n - 1)*(3*n + 1)*a(n-2). - Vaclav Kotesovec, Oct 11 2015
a(n) ~ 27^(n + 3/2)/(23*sqrt(Pi*n)*4^(n + 1)). - Vaclav Kotesovec, Oct 11 2015

A362049 Number of integer partitions of n such that (length) = 2*(median).

Original entry on oeis.org

0, 1, 0, 0, 0, 0, 1, 3, 3, 3, 3, 3, 3, 4, 5, 9, 12, 19, 22, 29, 32, 39, 43, 51, 57, 70, 81, 101, 123, 153, 185, 230, 272, 328, 386, 454, 526, 617, 708, 824, 951, 1106, 1277, 1493, 1727, 2020, 2344, 2733, 3164, 3684, 4245, 4914, 5647, 6502, 7438, 8533, 9730
Offset: 1

Views

Author

Gus Wiseman, Apr 10 2023

Keywords

Comments

The median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length). All of these partitions have even length, because an odd-length multiset cannot have fractional median.

Examples

			The a(13) = 3 through a(15) = 5 partitions:
  (7,2,2,2)  (8,2,2,2)      (9,2,2,2)
  (8,2,2,1)  (9,2,2,1)      (10,2,2,1)
  (8,3,1,1)  (9,3,1,1)      (10,3,1,1)
             (3,3,3,3,1,1)  (3,3,3,3,2,1)
                            (4,3,3,3,1,1)
		

Crossrefs

For maximum instead of median we have A237753.
For minimum instead of median we have A237757.
For maximum instead of length we have A361849, ranks A361856.
This is the equal case of A362048.
These partitions have ranks A362050.
A000041 counts integer partitions, strict A000009.
A000975 counts subsets with integer median.
A325347 counts partitions with integer median, complement A307683.
A359893 and A359901 count partitions by median.
A360005 gives twice median of prime indices, distinct A360457.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Length[#]==2*Median[#]&]],{n,30}]

A307352 a(n) = Sum_{0<=i<=j<=k<=n} (i+j+k)!/(i!*j!*k!).

Original entry on oeis.org

1, 10, 152, 2857, 59258, 1299434, 29540536, 688792297, 16365424655, 394524030964, 9621387028097, 236859068544553, 5876752849424588, 146774130990116924, 3686474939260449666, 93044751867820344115, 2358431594464812420404, 60004708149086107604240
Offset: 0

Views

Author

Seiichi Manyama, Apr 03 2019

Keywords

Crossrefs

Programs

  • Mathematica
    Table[Sum[Sum[Sum[(i+j+k)!/(i!*j!*k!), {i, 0, j}], {j, 0, k}], {k, 0, n}], {n, 0, 20}] (* Vaclav Kotesovec, Apr 04 2019 *)
  • PARI
    {a(n) = sum(i=0, n, sum(j=i, n, sum(k=j, n, (i+j+k)!/(i!*j!*k!))))}

Formula

From Vaclav Kotesovec, Apr 04 2019: (Start)
Recurrence: 3*(n-1)*n^2*(2*n + 1)*(15680*n^7 - 198268*n^6 + 1049184*n^5 - 3003295*n^4 + 5004388*n^3 - 4830736*n^2 + 2483598*n - 518661)*a(n)=(n-1)*(2*n - 1)*(1238720*n^9 - 15631812*n^8 + 82366948*n^7 - 233558317*n^6 + 380532743*n^5 - 345530522*n^4 + 141797620*n^3 + 8081106*n^2 - 23913486*n + 4762800)*a(n-1) + 2*(909440*n^11 - 14525784*n^10 + 100260068*n^9 - 390684898*n^8 + 940603537*n^7 - 1433395699*n^6 + 1346188538*n^5 - 691297162*n^4 + 97138838*n^3 + 77570673*n^2 - 37619991*n + 4762800)*a(n-2) - 2*(1662080*n^11 - 24324888*n^10 + 154076996*n^9 - 552269110*n^8 + 1226963821*n^7 - 1732162636*n^6 + 1512829217*n^5 - 721942210*n^4 + 86052929*n^3 + 81957789*n^2 - 37651608*n + 4762800)*a(n-3) - (2*n - 3)*(862400*n^10 - 12613860*n^9 + 77917844*n^8 - 263521873*n^7 + 527376397*n^6 - 624837256*n^5 + 401742338*n^4 - 90648379*n^3 - 35886325*n^2 + 22963194*n - 3175200)*a(n-4) + 3*(n-3)*(2*n - 5)*(3*n - 8)*(3*n - 7)*(15680*n^7 - 88508*n^6 + 188856*n^5 - 182595*n^4 + 66488*n^3 + 9758*n^2 - 11818*n + 1890)*a(n-5).
a(n) ~ 3^(3*n + 13/2) / (832*Pi*n).
(End)

A361800 Number of integer partitions of n with the same length as median.

Original entry on oeis.org

1, 0, 0, 2, 0, 0, 1, 2, 3, 3, 3, 3, 4, 6, 9, 13, 14, 15, 18, 21, 27, 32, 40, 46, 55, 62, 72, 82, 95, 111, 131, 157, 186, 225, 264, 316, 366, 430, 495, 578, 663, 768, 880, 1011, 1151, 1316, 1489, 1690, 1910, 2158, 2432, 2751, 3100, 3505, 3964, 4486, 5079, 5764
Offset: 1

Views

Author

Gus Wiseman, Apr 07 2023

Keywords

Comments

The median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length).

Examples

			The a(1) = 1 through a(15) = 9 partitions (A=10, B=11):
  1  .  .  22  .  .  331  332  333  433  533  633  733   833   933
           31             431  432  532  632  732  832   932   A32
                               531  631  731  831  931   A31   B31
                                                   4441  4442  4443
                                                         5441  5442
                                                         5531  5532
                                                               6441
                                                               6531
                                                               6621
		

Crossrefs

For minimum instead of median we have A006141, for twice minimum A237757.
For maximum instead of median we have A047993, for twice length A237753.
For maximum instead of length we have A053263, for twice median A361849.
For mean instead of median we have A206240 (zeros removed).
For minimum instead of length we have A361860.
For twice median we have A362049, ranks A362050.
A000041 counts integer partitions, strict A000009.
A000975 counts subsets with integer median.
A325347 counts partitions with integer median, complement A307683.
A359893 and A359901 count partitions by median.
A360005 gives twice median of prime indices.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Length[#]==Median[#]&]],{n,30}]

A361850 Number of strict integer partitions of n such that the maximum is twice the median.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 2, 0, 2, 1, 3, 3, 4, 2, 5, 4, 7, 8, 10, 6, 11, 11, 15, 16, 21, 18, 25, 23, 28, 32, 40, 40, 51, 51, 58, 60, 73, 75, 93, 97, 113, 123, 139, 141, 164, 175, 199, 217, 248, 263, 301, 320, 356, 383, 426, 450, 511, 551, 613, 664, 737
Offset: 1

Views

Author

Gus Wiseman, Apr 02 2023

Keywords

Comments

The median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length).

Examples

			The a(7) = 1 through a(20) = 4 strict partitions (A..C = 10..12):
  421  .  .  631  632   .  841   842  843   A51    A52    A53   A54   C62
                  5321     6421       7431  7432   8531   8532  C61   9542
                                      7521  64321  8621         9541  9632
                                                   65321        9631  85421
                                                                9721
The partition (7,4,3,1) has maximum 7 and median 7/2, so is counted under a(15).
The partition (8,6,2,1) has maximum 8 and median 4, so is counted under a(17).
		

Crossrefs

For minimum instead of median we have A241035, non-strict A237824.
For length instead of median we have A241087, non-strict A237755.
The non-strict version is A361849, ranks A361856.
The non-strict complement is counted by A361857, ranks A361867.
A000041 counts integer partitions, strict A000009.
A000975 counts subsets with integer median.
A008284 counts partitions by length, A058398 by mean.
A325347 counts partitions with integer median, complement A307683.
A359893 and A359901 count partitions by median, odd-length A359902.
A359907 counts strict partitions with integer median
A360005 gives median of prime indices (times two), distinct A360457.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],UnsameQ@@#&&Max@@#==2*Median[#]&]],{n,30}]

A054113 T(2*n,n), array T as in A054110.

Original entry on oeis.org

1, 5, 17, 57, 197, 701, 2549, 9413, 35153, 132393, 501905, 1912769, 7321081, 28122281, 108355481, 418590521, 1620751301, 6287963741, 24438234341, 95128761941, 370821819581, 1447337568461, 5655535495901, 22122396951101, 86617604317301, 339438817192805, 1331275883089013
Offset: 0

Views

Author

Keywords

Crossrefs

Programs

  • Mathematica
    CoefficientList[Series[( -1+4x+2*Sqrt[1-4x])/((1-x)(1-4x)),{x,0,26}],x] (* Stefano Spezia, May 11 2024 *)

Formula

G.f.: (-1+4*x+2*sqrt(1-4*x))/((1-x)*(1-4*x)). - Ralf Stephan, Apr 03 2004
a(n) = 4*s(n) + 1, with s(n) = A079309(n) = Sum_{k=1..n} C(2k+1, k+1). - Ralf Stephan, Apr 03 2004
Previous Showing 21-30 of 40 results. Next