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.

A008967 Coefficients of Gaussian polynomials q_binomial(n-2, 2). Also triangle of distribution of rank sums: Wilcoxon's statistic. Irregular triangle read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 2, 2, 1, 1, 1, 1, 2, 2, 3, 2, 2, 1, 1, 1, 1, 2, 2, 3, 3, 3, 2, 2, 1, 1, 1, 1, 2, 2, 3, 3, 4, 3, 3, 2, 2, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 4, 4, 3, 3, 2, 2, 1, 1, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 5, 4, 4, 3, 3, 2, 2, 1, 1
Offset: 4

Views

Author

Keywords

Comments

Rows are numbers of dominoes with k spots where each half-domino has zero to n spots (in standard domino set: n=6, there are 28 dominoes and row is 1,1,2,2,3,3,4,3,3,2,2,1,1). - Henry Bottomley, Aug 23 2000
These numbers appear in the solution of Cayley's counting problem on covariants as N(p,2,w) = [x^p,q^w] Phi(q,x) with the o.g.f. Phi(q,x) = 1/((1-x)(1-qx)(1-q^2x)) given by Peter Bala in the formula section. See the Hawkins reference, p. 264, were also references are given. - Wolfdieter Lang, Nov 30 2012
The entry a(p,w), p >= 0, w = 0,1,...,2*p, of this irregular triangle is the number of nonnegative solutions of m_0 + m_1 + m_2 = p and 1*m_1 + 2*m_2 = w. See the Hawkins reference p. 264, (4.8). N(p,2,w) there is a(p,w). See also the Cayley reference p. 110, 35. with m = 2, Theta = p and q = w. - Wolfdieter Lang, Dec 01 2012
From Gus Wiseman, Sep 20 2023: (Start)
Also the number of unordered pairs of distinct positive integers up to n with sum k. For example, row n = 9 counts the following pairs:
12 13 14 15 16 17 18 19 29 39 49 59 69 79 89
23 24 25 26 27 28 38 48 58 68 78
34 35 36 37 47 57 67
45 46 56
Allowing repeated parts (x,x) gives A004737.
For strict partitions instead of just pairs we have A053632.
(End)

Examples

			1;
1,1,1;
1,1,2,1,1;
1,1,2,2,2,1,1;
1,1,2,2,3,2,2,1,1;
1,1,2,2,3,3,3,2,2,1,1;
...
Partitions: row p=2 and column w=2 has entry 2 because the 2 solutions of the two equations mentioned in a comment above are: m_0 = 0, m_1 = 2, m_2 = 0 and m_0 = 1, m_1 = 0, m_2 = 1. - _Wolfdieter Lang_, Dec 01 2012
		

References

  • G. E. Andrews, The Theory of Partitions, Addison-Wesley, 1976, p. 242.
  • F. N. David, M. G. Kendall and D. E. Barton, Symmetric Function and Allied Tables, Cambridge, 1966, p. 236.
  • T. Hawkins, Emergence of the Theory of Lie Groups, Springer 2000, ch. 7.4, p. 260-5.

Crossrefs

A version with zeros is A219238.
This is the case of A365541 counting only length-2 subsets.

Programs

  • Maple
    qBinom := proc(n,m,q)
            mul((1-q^(n-i))/(1-q^(i+1)),i=0..m-1) ;
            factor(%) ;
            expand(%) ;
    end proc:
    A008967 := proc(n,k)
            coeftayl( qBinom(n,2,q),q=0,k ) ;
    end proc:
    seq(seq( A008967(n,k),k=0..2*n-4),n=2..10) ; # assumes offset 2. R. J. Mathar, Oct 13 2011
  • Mathematica
    rmax = 11; f[r_] := Product[(x^i - x^(r+1))/(1-x^i), {i, 1, r-2}]/  x^((r-1)*(r-2)/2); row[r_] := CoefficientList[ Series[ f[r], {x, 0, 2rmax}], x]; Flatten[ Table[ row[r], {r, 2, rmax}]] (* Jean-François Alcover, Oct 13 2011, after given formula *)
    T[n_, k_] := SeriesCoefficient[QBinomial[n - 2, 2, q], {q, 0, k}];
    Table[T[n, k], {n, 4, 13}, {k, 0, 2 n - 8}] // Flatten (* Jean-François Alcover, Aug 20 2019 *)
    Table[Length[Select[Subsets[Range[n],{2}],Total[#]==k&]],{n,2,15},{k,3,2n-1}] (* Gus Wiseman, Sep 20 2023 *)
  • SageMath
    print(flatten([q_binomial(n-2, 2).list() for n in (4..13)])) # Peter Luschny, Oct 23 2019

Formula

Let f(r) = Product( (x^i-x^(r+1))/(1-x^i), i = 1..r-2) / x^((r-1)*(r-2)/2); then expanding f(r) in powers of x and taking coefficients gives the successive rows of this triangle (with a different offset).
Expanding (q^n - 1)(q^(n+1) - 1)/((q - 1)(q^2 - 1)) in powers of q and taking coefficients gives the n-th row of the triangle. Ordinary generating function: 1/((1-x)(1-qx)(1-q^2x)) = 1 + x(1 + q + q^2) + x^2(1 + q + 2q^2 + q^3 + q^4) + .... - Peter Bala, Sep 23 2007
For n >= 2, let a(n,i) denote the i-th entry of the (n-1)-st row of this triangle; for every 0 <= i <= n-2, a(n,i) = a(n,2(n-2)-i) = ceiling((i+1)/2). - Christian Barrientos, Aug 08 2019

Extensions

More terms from Christian Barrientos, Aug 08 2019

A036561 Nicomachus triangle read by rows, T(n, k) = 2^(n - k)*3^k, for 0 <= k <= n.

Original entry on oeis.org

1, 2, 3, 4, 6, 9, 8, 12, 18, 27, 16, 24, 36, 54, 81, 32, 48, 72, 108, 162, 243, 64, 96, 144, 216, 324, 486, 729, 128, 192, 288, 432, 648, 972, 1458, 2187, 256, 384, 576, 864, 1296, 1944, 2916, 4374, 6561, 512, 768, 1152, 1728, 2592, 3888, 5832, 8748, 13122, 19683
Offset: 0

Views

Author

Keywords

Comments

The triangle pertaining to this sequence has the property that every row, every column and every diagonal contains a nontrivial geometric progression. More interestingly every line joining any two elements contains a nontrivial geometric progression. - Amarnath Murthy, Jan 02 2002
Kappraff states (pp. 148-149): "I shall refer to this as Nicomachus' table since an identical table of numbers appeared in the Arithmetic of Nicomachus of Gerasa (circa 150 A.D.)" The table was rediscovered during the Italian Renaissance by Leon Battista Alberti, who incorporated the numbers in dimensions of his buildings and in a system of musical proportions. Kappraff states "Therefore a room could exhibit a 4:6 or 6:9 ratio but not 4:9. This ensured that ratios of these lengths would embody musical ratios". - Gary W. Adamson, Aug 18 2003
After Nichomachus and Alberti several Renaissance authors described this table. See for instance Pierre de la Ramée in 1569 (facsimile of a page of his Arithmetic Treatise in Latin in the links section). - Olivier Gérard, Jul 04 2013
The triangle sums, see A180662 for their definitions, link Nicomachus's table with eleven different sequences, see the crossrefs. It is remarkable that these eleven sequences can be described with simple elegant formulas. The mirror of this triangle is A175840. - Johannes W. Meijer, Sep 22 2010
The diagonal sums Sum_{k} T(n - k, k) give A167762(n + 2). - Michael Somos, May 28 2012
Where d(n) is the divisor count function, then d(T(i,j)) = A003991, the rows of which sum to the tetrahedral numbers A000292(n+1). For example, the sum of the divisors of row 4 of this triangle (i = 4), gives d(16) + d(24) + d(36) + d(54) + d(81) = 5 + 8 + 9 + 8 + 5 = 35 = A000292(5). In fact, where p and q are distinct primes, the aforementioned relationship to the divisor function and tetrahedral numbers can be extended to any triangle of numbers in which the i-th row is of form {p^(i-j)*q^j, 0<=j<=i}; i >= 0 (e.g., A003593, A003595). - Raphie Frank, Nov 18 2012, corrected Dec 07 2012
Sequence (or tree) generated by these rules: 1 is in S, and if x is in S, then 2*x and 3*x are in S, and duplicates are deleted as they occur; see A232559. - Clark Kimberling, Nov 28 2013
Partial sums of rows produce Stirling numbers of the 2nd kind: A000392(n+2) = Sum_{m=1..(n^2+n)/2} a(m). - Fred Daniel Kline, Sep 22 2014
A permutation of A003586. - L. Edson Jeffery, Sep 22 2014
Form a word of length i by choosing a (possibly empty) word on alphabet {0,1} then concatenating a word of length j on alphabet {2,3,4}. T(i,j) is the number of such words. - Geoffrey Critzer, Jun 23 2016
Form of Zorach additive triangle (see A035312) where each number is sum of west and northwest numbers, with the additional condition that each number is GCD of the two numbers immediately below it. - Michel Lagneau, Dec 27 2018

Examples

			The start of the sequence as a triangular array read by rows:
   1
   2   3
   4   6   9
   8  12  18  27
  16  24  36  54  81
  32  48  72 108 162 243
  ...
The start of the sequence as a table T(n,k) n, k > 0:
    1    2    4    8   16   32 ...
    3    6   12   24   48   96 ...
    9   18   36   72  144  288 ...
   27   54  108  216  432  864 ...
   81  162  324  648 1296 2592 ...
  243  486  972 1944 3888 7776 ...
  ...
- _Boris Putievskiy_, Jan 08 2013
		

References

  • Jay Kappraff, Beyond Measure, World Scientific, 2002, p. 148.
  • Flora R. Levin, The Manual of Harmonics of Nicomachus the Pythagorean, Phanes Press, 1994, p. 114.

Crossrefs

Cf. A001047 (row sums), A000400 (central terms), A013620, A007318.
Triangle sums (see the comments): A001047 (Row1); A015441 (Row2); A005061 (Kn1, Kn4); A016133 (Kn2, Kn3); A016153 (Fi1, Fi2); A016140 (Ca1, Ca4); A180844 (Ca2, Ca3); A180845 (Gi1, Gi4); A180846 (Gi2, Gi3); A180847 (Ze1, Ze4); A016185 (Ze2, Ze3). - Johannes W. Meijer, Sep 22 2010, Sep 10 2011
Antidiagonal cumulative sum: A000392; square arrays cumulative sum: A160869. Antidiagonal products: 6^A000217; antidiagonal cumulative products: 6^A000292; square arrays products: 6^A005449; square array cumulative products: 6^A006002.

Programs

  • Haskell
    a036561 n k = a036561_tabf !! n !! k
    a036561_row n = a036561_tabf !! n
    a036561_tabf = iterate (\xs@(x:_) -> x * 2 : map (* 3) xs) [1]
    -- Reinhard Zumkeller, Jun 08 2013
    
  • Magma
    /* As triangle: */ [[(2^(i-j)*3^j)/3: j in [1..i]]: i in [1..10]]; // Vincenzo Librandi, Oct 17 2014
  • Maple
    A036561 := proc(n,k): 2^(n-k)*3^k end:
    seq(seq(A036561(n,k),k=0..n),n=0..9);
    T := proc(n,k) option remember: if k=0 then 2^n elif k>=1 then procname(n,k-1) + procname(n-1,k-1) fi: end: seq(seq(T(n,k),k=0..n),n=0..9);
    # Johannes W. Meijer, Sep 22 2010, Sep 10 2011
  • Mathematica
    Flatten[Table[ 2^(i-j) 3^j, {i, 0, 12}, {j, 0, i} ]] (* Flatten added by Harvey P. Dale, Jun 07 2011 *)
  • PARI
    for(i=0,9,for(j=0,i,print1(3^j<<(i-j)", "))) \\ Charles R Greathouse IV, Dec 22 2011
    
  • PARI
    {T(n, k) = if( k<0 || k>n, 0, 2^(n - k) * 3^k)} /* Michael Somos, May 28 2012 */
    

Formula

T(n,k) = A013620(n,k)/A007318(n,k). - Reinhard Zumkeller, May 14 2006
T(n,k) = T(n,k-1) + T(n-1,k-1) for n>=1 and 1<=k<=n with T(n,0) = 2^n for n>=0. - Johannes W. Meijer, Sep 22 2010
T(n,k) = 2^(k-1)*3^(n-1), n, k > 0 read by antidiagonals. - Boris Putievskiy, Jan 08 2013
a(n) = 2^(A004736(n)-1)*3^(A002260(n)-1), n > 0, or a(n) = 2^(j-1)*3^(i-1) n > 0, where i=n-t*(t+1)/2, j=(t*t+3*t+4)/2-n, t=floor[(-1+sqrt(8*n-7))/2]. - Boris Putievskiy, Jan 08 2013
G.f.: 1/((1-2x)(1-3yx)). - Geoffrey Critzer, Jun 23 2016
T(n,k) = (-1)^n * Sum_{q=0..n} (-1)^q * C(k+3*q, q) * C(n+2*q, n-q). - Marko Riedel, Jul 01 2024

A068911 Number of n-step walks (each step +-1 starting from 0) which are never more than 2 or less than -2.

Original entry on oeis.org

1, 2, 4, 6, 12, 18, 36, 54, 108, 162, 324, 486, 972, 1458, 2916, 4374, 8748, 13122, 26244, 39366, 78732, 118098, 236196, 354294, 708588, 1062882, 2125764, 3188646, 6377292, 9565938, 19131876, 28697814, 57395628, 86093442, 172186884, 258280326, 516560652
Offset: 0

Views

Author

Henry Bottomley, Mar 06 2002

Keywords

Comments

From Johannes W. Meijer, May 29 2010: (Start)
a(n) is the number of ways White can force checkmate in exactly (n+1) moves, n >= 0, ignoring the fifty-move and the triple repetition rules, in the following chess position: White Ka1, Ra8, Bc1, Nb8, pawns a6, a7, b2, c6, d2, f6, g5 and h6; Black Ke8, Nh8, pawns b3, c7, d3, f7, g6 and h7. (After Noam D. Elkies, see link; diagram 5).
Counts all paths of length n, n >= 0, starting at the third node on the path graph P_5, see the Maple program. (End)
From Alec Jones, Feb 25 2016: (Start)
The a(n) are the n-th terms in a "Fibonacci snake" drawn on a rectilinear grid. The n-th term is computed as the sum of the previous terms in cells adjacent to the n-th cell (diagonals included). (This sequence excludes the first term of the snake.)
For example:
1 ... 1 1 ... 1 4 1 4 6 ... 1 4 6 1 4 6 ... and so on.
1 ... 1 2 1 2 ... 1 2 1 2 12 ... 1 2 12 18 (End)
From Gus Wiseman, Oct 06 2023: (Start)
Also the number of subsets of {1..n} containing no two distinct elements summing to n. The a(0) = 1 through a(4) = 12 subsets are:
{} {} {} {} {}
{1} {1} {1} {1}
{2} {2} {2}
{1,2} {3} {3}
{1,3} {4}
{2,3} {1,2}
{1,4}
{2,3}
{2,4}
{3,4}
{1,2,4}
{2,3,4}
For n+1 instead of n we have A038754, complement A167762.
Including twins gives A117855, complement A366131.
The complement is counted by A365544.
For all subsets (not just pairs) we have A365377, complement A365376. (End)

Examples

			The a(3) = 6 walks: (0,-1,-2,-1), (0,-1,0,-1), (0,-1,0,1), (0,1,0,-1), (0,1,0,1), (0,1,2,1). - _Gus Wiseman_, Oct 10 2023
		

Crossrefs

Cf. A000007, A016116 (without initial term), A068912, A068913 for similar.
Equals A060647(n-1)+1.
First differences are A117855.

Programs

  • Magma
    [Floor((5-(-1)^n)*3^Floor(n/2)/3): n in [0..40]]; // Bruno Berselli, Feb 26 2016, after Charles R Greathouse IV
    
  • Maple
    with(GraphTheory): G:= PathGraph(5): A:=AdjacencyMatrix(G): nmax:=34; for n from 0 to nmax do B(n):=A^n; a(n):=add(B(n)[3,k], k=1..5) od: seq(a(n), n=0..nmax); # Johannes W. Meijer, May 29 2010
    # second Maple program:
    a:= proc(n) a(n):= `if`(n<2, n+1, (4-irem(n, 2))/2*a(n-1)) end:
    seq(a(n), n=0..40);  # Alois P. Heinz, Feb 03 2019
  • Mathematica
    Join[{1},Transpose[NestList[{Last[#],3First[#]}&,{2,4},40]][[1]]] (* Harvey P. Dale, Oct 24 2011 *)
    Table[Length[Select[Subsets[Range[n]],FreeQ[Total/@Subsets[#,{2}],n]&]],{n,0,15}] (* Gus Wiseman, Oct 06 2023 *)
  • PARI
    a(n)=[4,6][n%2+1]*3^(n\2)\3 \\ Charles R Greathouse IV, Feb 26 2016
    
  • Python
    def A068911(n): return 3**(n>>1)<<1 if n&1 else (3**(n-1>>1)<<2 if n else 1) # Chai Wah Wu, Aug 30 2024

Formula

a(n) = A068913(2, n) = 2*A038754(n-1) = 3*a(n-2) = a(n-1)*a(n-2)/a(n-3) starting with a(0)=1, a(1)=2, a(2)=4 and a(3)=6.
For n>0: a(2n) = 4*3^(n-1) = 2*a(2n-1); a(2n+1) = 2*3^n = 3*a(2n)/2 = 2*a(2n)-A000079(n-2).
From Paul Barry, Feb 17 2004: (Start)
G.f.: (1+x)^2/(1-3x^2).
a(n) = 2*3^((n+1)/2)*((1-(-1)^n)/6 + sqrt(3)*(1+(-1)^n)/9) - (1/3)*0^n.
The sequence 0, 1, 2, 4, ... has a(n) = 2*3^(n/2)*((1+(-1)^n)/6 + sqrt(3)*(1-(-1)^n)/9) - (2/3)*0^n + (1/3)*Sum_{k=0..n} binomial(n, k)*k*(-1)^k. (End)
a(n) = 2^((3 + (-1)^n)/2)*3^((2*n - 3 - (-1)^n)/4) - ((1 - (-1)^(2^n)))/6. - Luce ETIENNE, Aug 30 2014
For n > 2, indexing from 0, a(n) = a(n-1) + a(n-2) if n is odd, a(n-1) + a(n-2) + a(n-3) if n is even. - Alec Jones, Feb 25 2016
a(n) = 2*a(n-1) if n is even, a(n-1) + a(n-2) if n is odd. - Vincenzo Librandi, Feb 26 2016
E.g.f.: (4*cosh(sqrt(3)*x) + 2*sqrt(3)*sinh(sqrt(3)*x) - 1)/3. - Stefano Spezia, Feb 17 2022

A365541 Irregular triangle read by rows where T(n,k) is the number of subsets of {1..n} containing two distinct elements summing to k = 3..2n-1.

Original entry on oeis.org

1, 2, 2, 2, 4, 4, 7, 4, 4, 8, 8, 14, 14, 14, 8, 8, 16, 16, 28, 28, 37, 28, 28, 16, 16, 32, 32, 56, 56, 74, 74, 74, 56, 56, 32, 32, 64, 64, 112, 112, 148, 148, 175, 148, 148, 112, 112, 64, 64, 128, 128, 224, 224, 296, 296, 350, 350, 350, 296, 296, 224, 224, 128, 128
Offset: 2

Views

Author

Gus Wiseman, Sep 15 2023

Keywords

Comments

Rows are palindromic.

Examples

			Triangle begins:
    1
    2    2    2
    4    4    7    4    4
    8    8   14   14   14    8    8
   16   16   28   28   37   28   28   16   16
   32   32   56   56   74   74   74   56   56   32   32
Row n = 4 counts the following subsets:
  {1,2}      {1,3}      {1,4}      {2,4}      {3,4}
  {1,2,3}    {1,2,3}    {2,3}      {1,2,4}    {1,3,4}
  {1,2,4}    {1,3,4}    {1,2,3}    {2,3,4}    {2,3,4}
  {1,2,3,4}  {1,2,3,4}  {1,2,4}    {1,2,3,4}  {1,2,3,4}
                        {1,3,4}
                        {2,3,4}
                        {1,2,3,4}
		

Crossrefs

Row lengths are A005408.
The case counting only length-2 subsets is A008967.
Column k = n + 1 appears to be A167762.
The version for all subsets (instead of just pairs) is A365381.
Column k = n is A365544.
A000009 counts subsets summing to n.
A007865/A085489/A151897 count certain types of sum-free subsets.
A046663 counts partitions with no submultiset summing to k, strict A365663.
A093971/A088809/A364534 count certain types of sum-full subsets.
A365543 counts partitions with a submultiset summing to k, strict A365661.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]], MemberQ[Total/@Subsets[#,{2}],k]&]], {n,2,11}, {k,3,2n-1}]

A365544 Number of subsets of {1..n} containing two distinct elements summing to n.

Original entry on oeis.org

0, 0, 0, 2, 4, 14, 28, 74, 148, 350, 700, 1562, 3124, 6734, 13468, 28394, 56788, 117950, 235900, 484922, 969844, 1979054, 3958108, 8034314, 16068628, 32491550, 64983100, 131029082, 262058164, 527304974, 1054609948, 2118785834, 4237571668, 8503841150, 17007682300
Offset: 0

Views

Author

Gus Wiseman, Sep 20 2023

Keywords

Examples

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

Crossrefs

For strict partitions we have A140106 shifted left.
The version for partitions is A004526.
The complement is counted by A068911.
For all subsets of elements we have A365376.
Main diagonal k = n of A365541.
A000009 counts subsets summing to n.
A007865/A085489/A151897 count certain types of sum-free subsets.
A093971/A088809/A364534 count certain types of sum-full subsets.
A365381 counts subsets with a subset summing to k.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],MemberQ[Total/@Subsets[#,{2}],n]&]],{n,0,10}]
  • Python
    def A365544(n): return (1<>1)<<1 if n&1 else 3**(n-1>>1)<<2) if n else 0 # Chai Wah Wu, Aug 30 2024

Formula

a(n) = 2^n - A068911(n).
From Alois P. Heinz, Aug 30 2024: (Start)
G.f.: 2*x^3/((2*x-1)*(3*x^2-1)).
a(n) = 2 * A167762(n-1) for n>=1. (End)

A117855 Number of nonzero palindromes of length n (in base 3).

Original entry on oeis.org

2, 2, 6, 6, 18, 18, 54, 54, 162, 162, 486, 486, 1458, 1458, 4374, 4374, 13122, 13122, 39366, 39366, 118098, 118098, 354294, 354294, 1062882, 1062882, 3188646, 3188646, 9565938, 9565938, 28697814, 28697814, 86093442, 86093442, 258280326, 258280326, 774840978
Offset: 1

Views

Author

Martin Renner, May 02 2006

Keywords

Comments

See A225367 for the sequence that counts all base 3 palindromes, including 0 (and thus also the number of n-digit terms in A006072). -- A nonzero palindrome of length L=2k-1 or of length L=2k is determined by the first k digits, which then determine the last k digits by symmetry. Since the first digit cannot be 0, there are 2*3^(k-1) possibilities. - M. F. Hasler, May 05 2013
From Gus Wiseman, Oct 18 2023: (Start)
Also the number of subsets of {1..n} with n not the sum of two subset elements (possibly the same). For example, the a(0) = 1 through a(4) = 6 subsets are:
{} {} {} {} {}
{1} {2} {1} {1}
{2} {3}
{3} {4}
{1,3} {1,4}
{2,3} {3,4}
For subsets with no subset summing to n we have A365377.
Requiring pairs to be distinct gives A068911, complement A365544.
The complement is counted by A366131.
(End) [Edited by Peter Munn, Nov 22 2023]

Examples

			The a(3)=6 palindromes of length 3 are: 101, 111, 121, 202, 212, and 222. - _M. F. Hasler_, May 05 2013
		

Crossrefs

Cf. A050683 and A070252.
Bisections are both A025192.
A093971/A088809/A364534 count certain types of sum-full subsets.
A108411 lists powers of 3 repeated, complement A167936.

Programs

  • Mathematica
    With[{c=NestList[3#&,2,20]},Riffle[c,c]] (* Harvey P. Dale, Mar 25 2018 *)
    Table[Length[Select[Subsets[Range[n]],!MemberQ[Total/@Tuples[#,2],n]&]],{n,0,10}] (* Gus Wiseman, Oct 18 2023 *)
  • PARI
    A117855(n)=2*3^((n-1)\2) \\ - M. F. Hasler, May 05 2013
    
  • Python
    def A117855(n): return 3**(n-1>>1)<<1 # Chai Wah Wu, Oct 28 2024

Formula

a(n) = 2*3^floor((n-1)/2).
a(n) = 2*A108411(n-1).
From Colin Barker, Feb 15 2013: (Start)
a(n) = 3*a(n-2).
G.f.: -2*x*(x+1)/(3*x^2-1). (End)

Extensions

More terms from Colin Barker, Feb 15 2013

A085350 Binomial transform of poly-Bernoulli numbers A027649.

Original entry on oeis.org

1, 5, 23, 101, 431, 1805, 7463, 30581, 124511, 504605, 2038103, 8211461, 33022991, 132623405, 532087943, 2133134741, 8546887871, 34230598205, 137051532983, 548593552421, 2195536471151, 8785632669005, 35152991029223
Offset: 0

Views

Author

Paul Barry, Jun 24 2003

Keywords

Comments

Binomial transform is A085351.
a(n) mod 10 = period 4:repeat 1,5,3,1 = A132400. - Paul Curtz, Nov 13 2009

Crossrefs

a(n-1) = A080643(n)/2 = A081674(n+1) - A081674(n).
Cf. A000244 (3^n).

Programs

  • Magma
    [2*4^n-3^n: n in [0..30]]; // Vincenzo Librandi, Aug 13 2011
  • Mathematica
    LinearRecurrence[{4,9,-36},{1,5,23},30] (* Harvey P. Dale, Nov 30 2011 *)
    LinearRecurrence[{7, -12},{1, 5},23] (* Ray Chandler, Aug 03 2015 *)

Formula

G.f.: (1-2x)/((1-3x)(1-4x)).
E.g.f.: 2exp(4x) - exp(3x).
a(n) = 2*4^n-3^n.
From Paul Curtz, Nov 13 2009: (Start)
a(n) = 4*a(n-1) + 9*a(n-2) - 36*a(n-3);
a(n) = 4*a(n-1) + 3^(n-1), both like A005061 (note for A005061 dual formula a(n) = 3*a(n-1) + 4^(n-1) = 3*a(n-1) + A000302(n-1)).
a(n) = 3*a(n-1) + 2^(2n+1) = 3*a(n-1) + A004171(n).
a(n) = A005061(n) + A000302(n).
b(n) = mix(A005061, A085350) = 0,1,1,5,7,23,... = differences of (A167762 = 0,0,1,2,7,14,37,...); b(n) differences = A167784. (End)

A167936 a(n) = 2^n - A108411(n).

Original entry on oeis.org

0, 1, 1, 5, 7, 23, 37, 101, 175, 431, 781, 1805, 3367, 7463, 14197, 30581, 58975, 124511, 242461, 504605, 989527, 2038103, 4017157, 8211461, 16245775, 33022991, 65514541, 132623405, 263652487, 532087943, 1059392917, 2133134741, 4251920575, 8546887871
Offset: 0

Views

Author

Paul Curtz, Nov 15 2009

Keywords

Comments

The binomial transform of (0 followed by A077917).

Crossrefs

Programs

  • Magma
    I:=[0,1,1]; [n le 3 select I[n] else 2*Self(n-1) +3*Self(n-2) -6*Self(n-3): n in [1..40]]; // G. C. Greubel, Sep 10 2023
    
  • Mathematica
    LinearRecurrence[{2,3,-6}, {0,1,1}, 50] (* G. C. Greubel, Jul 01 2016 *)
  • Python
    def A167936(n): return (1<>1) # Chai Wah Wu, Nov 14 2023
  • SageMath
    def A167936(n): return 2^n - ((n+1)%2)*3^(n//2) - (n%2)*3^((n-1)//2)
    [A167936(n) for n in range(41)] # G. C. Greubel, Sep 10 2023
    

Formula

a(n) = A167762(n+1) - A167762(n).
a(n+1) - a(n) = A167784(n).
a(n) = 2*a(n-1) + 3*a(n-2) - 6*a(n-3).
G.f.: x*(1-x)/((1-2*x)*(1-3*x^2)).
a(2n) = A005061(n), a(2n+1) = A085350(n).
a(n) - 2*a(n-1) = (-1)^(n+1)*A083658(n+1).
From G. C. Greubel, Sep 10 2023: (Start)
a(n) = (1/2)*(2^(n+1) - (1+(-1)^n)*3^(n/2) - (1-(-1)^n)*3^((n-1)/2)).
E.g.f.: exp(2*x) - cosh(sqrt(3)*x) - (1/sqrt(3))*sinh(sqrt(3)*x). (End)

Extensions

Edited and extended by R. J. Mathar, Feb 27 2010

A366131 Number of subsets of {1..n} with two elements (possibly the same) summing to n.

Original entry on oeis.org

0, 0, 2, 2, 10, 14, 46, 74, 202, 350, 862, 1562, 3610, 6734, 14926, 28394, 61162, 117950, 249022, 484922, 1009210, 1979054, 4076206, 8034314, 16422922, 32491550, 66045982, 131029082, 265246810, 527304974, 1064175886, 2118785834, 4266269482, 8503841150, 17093775742, 34101458042, 68461196410, 136664112494
Offset: 0

Views

Author

Gus Wiseman, Oct 07 2023

Keywords

Examples

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

Crossrefs

The complement is counted by A117855.
For pairs summing to n + 1 we have A167936.
A068911 counts subsets of {1..n} w/o two distinct elements summing to n.
A093971/A088809/A364534 count certain types of sum-full subsets.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],MemberQ[Total/@Tuples[#,2],n]&]],{n,0,10}]
  • Python
    def A366131(n): return (1<>1)<<1) if n else 0 # Chai Wah Wu, Nov 14 2023

Formula

From Chai Wah Wu, Nov 14 2023: (Start)
a(n) = 2*a(n-1) + 3*a(n-2) - 6*a(n-3) for n > 3.
G.f.: 2*x^2*(1 - x)/((2*x - 1)*(3*x^2 - 1)). (End)

A366130 Number of subsets of {1..n} with a subset summing to n + 1.

Original entry on oeis.org

0, 0, 1, 2, 7, 15, 38, 79, 184, 378, 823, 1682, 3552, 7208, 14948, 30154, 61698, 124302, 252125, 506521, 1022768, 2051555, 4127633, 8272147, 16607469, 33258510, 66680774, 133467385, 267349211, 535007304, 1071020315, 2142778192, 4288207796
Offset: 0

Views

Author

Gus Wiseman, Oct 07 2023

Keywords

Examples

			The subset S = {1,2,4} has subset {1,4} with sum 4+1 and {2,4} with sum 5+1 and {1,2,4} with sum 6+1, so S is counted under a(4), a(5), and a(6).
The a(0) = 0 through a(5) = 15 subsets:
  .  .  {1,2}  {1,3}    {1,4}      {1,5}
               {1,2,3}  {2,3}      {2,4}
                        {1,2,3}    {1,2,3}
                        {1,2,4}    {1,2,4}
                        {1,3,4}    {1,2,5}
                        {2,3,4}    {1,3,5}
                        {1,2,3,4}  {1,4,5}
                                   {2,3,4}
                                   {2,4,5}
                                   {1,2,3,4}
                                   {1,2,3,5}
                                   {1,2,4,5}
                                   {1,3,4,5}
                                   {2,3,4,5}
                                   {1,2,3,4,5}
		

Crossrefs

For pairs summing to n + 1 we have A167762, complement A038754.
For n instead of n + 1 we have A365376, for pairs summing to n A365544.
The complement is counted by A365377 shifted.
The complement for pairs summing to n is counted by A365377.
A068911 counts subsets of {1..n} w/o two distinct elements summing to n.
A093971/A088809/A364534 count certain types of sum-full subsets.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],MemberQ[Total/@Subsets[#],n+1]&]],{n,0,10}]
  • Python
    from itertools import combinations
    from sympy.utilities.iterables import partitions
    def A366130(n):
        a = tuple(set(p.keys()) for p in partitions(n+1,k=n) if max(p.values(),default=0)==1)
        return sum(1 for k in range(2,n+1) for w in (set(d) for d in combinations(range(1,n+1),k)) if any(s<=w for s in a)) # Chai Wah Wu, Nov 24 2023

Formula

Diagonal k = n + 1 of A365381.

Extensions

a(20)-a(32) from Chai Wah Wu, Nov 24 2023
Showing 1-10 of 10 results.