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

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

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}]

A367216 Number of subsets of {1..n} whose cardinality is equal to the sum of some subset.

Original entry on oeis.org

1, 2, 3, 5, 10, 20, 40, 82, 169, 348, 716, 1471, 3016, 6171, 12605, 25710, 52370, 106539, 216470, 439310, 890550, 1803415, 3648557, 7375141, 14896184, 30065129, 60639954, 122231740, 246239551, 495790161, 997747182, 2006969629, 4035274292, 8110185100, 16293958314, 32724456982
Offset: 0

Views

Author

Gus Wiseman, Nov 12 2023

Keywords

Examples

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

Crossrefs

The following sequences count and rank integer partitions and finite sets according to whether their length is a subset-sum or linear combination of the parts. The current sequence is starred.
sum-full sum-free comb-full comb-free
-------------------------------------------
A000009 counts subsets summing to n.
A000124 counts distinct possible sums of subsets of {1..n}.
A002865 counts partitions whose length is a part, complement A229816.
A007865/A085489/A151897 count certain types of sum-free subsets.
A088809/A093971/A364534 count certain types of sum-full subsets.
A237668 counts sum-full partitions, ranks A364532.
A240855 counts strict partitions whose length is a part, complement A240861.
A364272 counts sum-full strict partitions, sum-free A364349.
A365046 counts combination-full subsets, differences of A364914.
Triangles:
A365381 counts sets with a subset summing to k, without A366320.
A365541 counts sets containing two distinct elements summing to k.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]], MemberQ[Total/@Subsets[#], Length[#]]&]], {n,0,10}]

Formula

a(n) = 2^n - A367217(n). - Chai Wah Wu, Nov 14 2023

Extensions

a(16)-a(28) from Chai Wah Wu, Nov 14 2023
a(29)-a(35) from Max Alekseyev, Feb 25 2025

A367222 Number of subsets of {1..n} whose cardinality can be written as a nonnegative linear combination of the elements.

Original entry on oeis.org

1, 2, 3, 6, 12, 24, 49, 101, 207, 422, 859, 1747, 3548, 7194, 14565, 29452, 59496, 120086, 242185, 488035, 982672, 1977166, 3975508, 7989147, 16047464, 32221270, 64674453, 129775774, 260337978, 522124197, 1046911594, 2098709858, 4206361369, 8429033614, 16887728757, 33829251009, 67755866536, 135687781793, 271693909435
Offset: 0

Views

Author

Gus Wiseman, Nov 14 2023

Keywords

Examples

			The set {1,2,4} has 3 = (2)+(1) or 3 = (1+1+1) so is counted under a(4).
The a(0) = 1 through a(4) = 12 subsets:
  {}  {}   {}     {}       {}
      {1}  {1}    {1}      {1}
           {1,2}  {1,2}    {1,2}
                  {1,3}    {1,3}
                  {2,3}    {1,4}
                  {1,2,3}  {2,3}
                           {2,4}
                           {1,2,3}
                           {1,2,4}
                           {1,3,4}
                           {2,3,4}
                           {1,2,3,4}
		

Crossrefs

The following sequences count and rank integer partitions and finite sets according to whether their length is a subset-sum or linear combination of the parts. The current sequence is starred.
sum-full sum-free comb-full comb-free
-------------------------------------------
A002865 counts partitions whose length is a part, complement A229816.
A007865/A085489/A151897 count certain types of sum-free subsets.
A088809/A093971/A364534 count certain types of sum-full subsets.
A124506 appears to count combination-free subsets, differences of A326083.
A326020 counts complete subsets.
A365046 counts combination-full subsets, differences of A364914.
Triangles:
A008284 counts partitions by length, strict A008289.
A365381 counts sets with a subset summing to k, without A366320.
A365541 counts subsets containing two distinct elements summing to k.

Programs

  • Mathematica
    combs[n_,y_]:=With[{s=Table[{k,i},{k,y}, {i,0,Floor[n/k]}]}, Select[Tuples[s], Total[Times@@@#]==n&]];
    Table[Length[Select[Subsets[Range[n]], combs[Length[#], Union[#]]!={}&]], {n,0,10}]
  • Python
    from itertools import combinations
    from sympy.utilities.iterables import partitions
    def A367222(n):
        c, mlist = 1, []
        for m in range(1,n+1):
            t = set()
            for p in partitions(m):
                t.add(tuple(sorted(p.keys())))
            mlist.append([set(d) for d in t])
        for k in range(1,n+1):
            for w in combinations(range(1,n+1),k):
                ws = set(w)
                for s in mlist[k-1]:
                    if s <= ws:
                        c += 1
                        break
        return c # Chai Wah Wu, Nov 16 2023

Formula

a(n) = 2^n - A367223(n).

Extensions

a(13)-a(33) from Chai Wah Wu, Nov 15 2023
a(34)-a(38) from Max Alekseyev, Feb 25 2025

A366738 Number of semi-sums of integer partitions of n.

Original entry on oeis.org

0, 0, 1, 2, 5, 9, 17, 28, 46, 72, 111, 166, 243, 352, 500, 704, 973, 1341, 1819, 2459, 3277, 4363, 5735, 7529, 9779, 12685, 16301, 20929, 26638, 33878, 42778, 53942, 67583, 84600, 105270, 130853, 161835, 199896, 245788, 301890, 369208, 451046, 549002, 667370
Offset: 0

Views

Author

Gus Wiseman, Nov 06 2023

Keywords

Comments

We define a semi-sum of a multiset to be any sum of a 2-element submultiset. This is different from sums of pairs of elements. For example, 2 is the sum of a pair of elements of {1}, but there are no semi-sums.

Examples

			The partitions of 6 and their a(6) = 17 semi-sums:
       (6) ->
      (51) -> 6
      (42) -> 6
     (411) -> 2,5
      (33) -> 6
     (321) -> 3,4,5
    (3111) -> 2,4
     (222) -> 4
    (2211) -> 2,3,4
   (21111) -> 2,3
  (111111) -> 2
		

Crossrefs

The non-binary version is A304792.
The strict non-binary version is A365925.
For prime indices instead of partitions we have A366739.
The strict case is A366741.
A000041 counts integer partitions, strict A000009.
A001358 lists semiprimes, squarefree A006881, conjugate A065119.
A126796 counts complete partitions, ranks A325781, strict A188431.
A276024 counts positive subset-sums of partitions, strict A284640.
A365924 counts incomplete partitions, ranks A365830, strict A365831.

Programs

  • Mathematica
    Table[Total[Length[Union[Total/@Subsets[#,{2}]]]&/@IntegerPartitions[n]],{n,0,15}]

Extensions

More terms from Alois P. Heinz, Nov 06 2023

A167762 a(n) = 2*a(n-1)+3*a(n-2)-6*a(n-3) starting a(0)=a(1)=0, a(2)=1.

Original entry on oeis.org

0, 0, 1, 2, 7, 14, 37, 74, 175, 350, 781, 1562, 3367, 6734, 14197, 28394, 58975, 117950, 242461, 484922, 989527, 1979054, 4017157, 8034314, 16245775, 32491550, 65514541, 131029082, 263652487, 527304974, 1059392917, 2118785834, 4251920575, 8503841150
Offset: 0

Views

Author

Paul Curtz, Nov 11 2009

Keywords

Comments

Inverse binomial transform yields two zeros followed by A077917 (a signed variant of A127864).
a(n) mod 10 is zero followed by a sequence with period length 8: 0, 1, 2, 7, 4, 7, 4, 5 (repeat).
a(n) is the number of length n+1 binary words with some prefix w such that w contains three more 1's than 0's and no prefix of w contains three more 0's than 1's. - Geoffrey Critzer, Dec 13 2013
From Gus Wiseman, Oct 06 2023: (Start)
Also the number of subsets of {1..n} with two distinct elements summing to n + 1. For example, the a(2) = 1 through a(5) = 14 subsets are:
{1,2} {1,3} {1,4} {1,5}
{1,2,3} {2,3} {2,4}
{1,2,3} {1,2,4}
{1,2,4} {1,2,5}
{1,3,4} {1,3,5}
{2,3,4} {1,4,5}
{1,2,3,4} {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}
The complement is counted by A038754.
Allowing twins gives A167936, complement A108411.
For n instead of n + 1 we have A365544, complement A068911.
The version for all subsets (not just pairs) is A366130.
(End)

Crossrefs

First differences are A167936, complement A108411.

Programs

  • Mathematica
    LinearRecurrence[{2,3,-6},{0,0,1},40] (* Harvey P. Dale, Sep 17 2013 *)
    CoefficientList[Series[x^2/((2 x - 1) (3 x^2 - 1)), {x, 0, 50}], x] (* Vincenzo Librandi, Sep 17 2013 *)
    Table[Length[Select[Subsets[Range[n]],MemberQ[Total/@Subsets[#,{2}],n+1]&]],{n,0,10}] (* Gus Wiseman, Oct 06 2023 *)

Formula

a(n) mod 9 = A153130(n), n>3 (essentially the same as A154529, A146501 and A029898).
a(n+1)-2*a(n) = 0 if n even, = A000244((1+n)/2) if n odd.
a(2*n) = A005061(n). a(2*n+1) = 2*A005061(n).
G.f.: x^2/((2*x-1)*(3*x^2-1)). a(n) = 2^n - A038754(n). - R. J. Mathar, Nov 12 2009
G.f.: x^2/(1-2*x-3*x^2+6*x^3). - Philippe Deléham, Nov 11 2009

Extensions

Edited and extended by R. J. Mathar, Nov 12 2009

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

A365659 Number of strict integer partitions of n that either have (1) length 2, or (2) greatest part n/2.

Original entry on oeis.org

0, 0, 0, 1, 1, 2, 3, 3, 4, 4, 6, 5, 8, 6, 10, 7, 12, 8, 15, 9, 18, 10, 21, 11, 25, 12, 29, 13, 34, 14, 40, 15, 46, 16, 53, 17, 62, 18, 71, 19, 82, 20, 95, 21, 109, 22, 125, 23, 144, 24, 165, 25, 189, 26, 217, 27, 248, 28, 283, 29, 324
Offset: 0

Views

Author

Gus Wiseman, Sep 16 2023

Keywords

Comments

Also the number of strict integer partitions of n containing two possibly equal elements summing to n.

Examples

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

Crossrefs

Without repeated parts we have A140106.
The non-strict version is A238628.
For subsets instead of strict partitions we have A365544.
A000009 counts subsets summing to n.
A365046 counts combination-full subsets, differences of A364914.
A365543 counts partitions of n with a submultiset summing to k.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], UnsameQ@@#&&(Length[#]==2||Max@@#==n/2)&]], {n,0,30}]
  • Python
    from sympy.utilities.iterables import partitions
    def A365659(n): return n>>1 if n&1 or n==0 else (m:=n>>1)+sum(1 for p in partitions(m) if max(p.values(),default=1)==1)-2 # Chai Wah Wu, Sep 18 2023

Formula

a(n) = (n-1)/2 if n is odd. a(n) = n/2 + A000009(n/2) - 2 if n is even and n > 0. - Chai Wah Wu, Sep 18 2023

A365825 Number of integer partitions of n that are not of length 2 and do not contain n/2.

Original entry on oeis.org

1, 1, 1, 2, 2, 5, 6, 12, 14, 26, 31, 51, 61, 95, 114, 169, 202, 289, 347, 481, 576, 782, 936, 1244, 1487, 1946, 2323, 2997, 3570, 4551, 5414, 6827, 8103, 10127, 11997, 14866, 17575, 21619, 25507, 31166, 36692, 44563, 52362, 63240, 74152, 89112, 104281, 124731
Offset: 0

Views

Author

Gus Wiseman, Sep 19 2023

Keywords

Comments

Also the number of integer partitions of n with no two possibly equal parts summing to n.

Examples

			The a(1) = 1 through a(8) = 14 partitions:
  (1)  (2)  (3)    (4)     (5)      (6)       (7)        (8)
            (111)  (1111)  (221)    (222)     (322)      (332)
                           (311)    (411)     (331)      (521)
                           (2111)   (2211)    (421)      (611)
                           (11111)  (21111)   (511)      (2222)
                                    (111111)  (2221)     (3221)
                                              (3211)     (3311)
                                              (4111)     (5111)
                                              (22111)    (22211)
                                              (31111)    (32111)
                                              (211111)   (221111)
                                              (1111111)  (311111)
                                                         (2111111)
                                                         (11111111)
		

Crossrefs

First condition alone is A058984, complement A004526, ranks A100959.
Second condition alone is A086543, complement A035363, ranks !A344415.
The complement is counted by A238628.
The strict case is A365826, complement A365659.
A000041 counts integer partitions, strict A000009.
A046663 counts partitions with no submultiset summing to k, strict A365663.
A140106 counts strict partitions of length 2, complement A365827.
A182616 counts partitions of 2n that do not contain n, strict A365828.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n],Length[#]!=2&&FreeQ[#,n/2]&]],{n,0,15}]
  • Python
    from sympy import npartitions
    def A365825(n): return npartitions(n)-(m:=n>>1)-(0 if n&1 else npartitions(m)-1) # Chai Wah Wu, Sep 23 2023

Formula

Heinz numbers are A100959 /\ !A344415.
a(n) = A000041(n)-(n-1)/2 if n is odd. a(n) = A000041(n)-n/2-A000041(n/2)+1 if n is even. - Chai Wah Wu, Sep 23 2023

Extensions

a(31)-a(47) from Chai Wah Wu, Sep 23 2023
Showing 1-10 of 12 results. Next