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

A332401 Irregular triangle read by rows: T(n,k) is the number of simple connected graphs on n unlabeled nodes with domination number k, n >= 1, 1 <= k <= A065033(n+1).

Original entry on oeis.org

1, 1, 2, 4, 2, 11, 10, 34, 76, 2, 156, 655, 42, 1044, 9162, 905, 6, 12346, 219823, 28720, 191, 274668, 9864065, 1568173, 9644, 21
Offset: 1

Views

Author

Andrew Howroyd, Feb 11 2020

Keywords

Comments

Bivariate inverse Euler transform of A263284. This sequence can be derived from A263284 because the domination number of a disconnected graph is the sum of the domination numbers of its components.
Connected graphs with greatest domination number include the path graph.

Examples

			Triangle begins:
      1;
      1;
      2;
      4,      2;
     11,     10;
     34,     76,     2;
    156,    655,    42;
   1044,   9162,   905,   6;
  12346, 219823, 28720, 191;
   ....
		

Crossrefs

Row sums are A001349.
Column k=1 is A000088(n-1).

A339833 Irregular triangle read by rows: T(n,k) is the number of unlabeled trees on n vertices with domination number k, n >= 1, 1 <= k <= A065033(n+1).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 4, 1, 1, 5, 5, 1, 7, 13, 2, 1, 8, 27, 11, 1, 10, 47, 45, 3, 1, 11, 72, 124, 27, 1, 13, 103, 287, 141, 6, 1, 14, 140, 553, 528, 65, 1, 16, 182, 966, 1537, 446, 11, 1, 17, 230, 1538, 3712, 2080, 163, 1, 19, 284, 2323, 7788, 7516, 1366, 23
Offset: 1

Views

Author

Andrew Howroyd, Dec 19 2020

Keywords

Comments

A star graph has a domination number of 1 and for n > 1 a path on n nodes has domination number floor(n/2) which is the maximum possible for a connected graph.
A minimum dominating set can be found in a tree using a greedy algorithm. First choose any node to be the root and perform a depth first search from the root. Exclude all leaves from the dominating set (except possibly the root) and also greedily exclude any other node if all children are either in the dominating set or dominated by one of their children. This method can be converted into an algorithm to compute the number of trees by domination number. See the PARI program for technical details.

Examples

			Triangle begins:
  1;
  1;
  1;
  1,  1;
  1,  2;
  1,  4,  1;
  1,  5,  5;
  1,  7, 13,  2;
  1,  8, 27, 11;
  1, 10, 47, 45, 3;
  ...
There are 3 trees with 5 nodes:
    o                                     o
    |                                     |
    x---x---o    o---x---o---x---o    o---x---o
    |                                     |
    o                                     o
The first 2 of these have a minimum dominating set of 2 nodes and the last has a minimum dominating set of 1 node, so T(5,2)=2 and T(5,1)=1.
		

Crossrefs

Row sums are A000055.
Cf. A065033, A332401 (connected graphs), A339829 (independence number), A339834, A339835.

Programs

  • PARI
    EulerMT(u)={my(n=#u, p=x*Ser(u), vars=variables(p)); Vec(exp( sum(i=1, n, substvec(p + O(x*x^(n\i)), vars, apply(v->v^i, vars))/i ))-1, -n)}
    \\ In the following, u,v,w count rooted trees weighted by domination number: u is root in set, v is root not in the set but dominatated by a child, w is root in set and not yet dominated.
    T(n)={my(u=[0], v=[0], w=[1]); for(n=2, n, my(t1=EulerMT(v), t2=EulerMT(u+v)); u=y*concat([0], EulerMT(u+v+w)-t2); v=concat([0], t2-t1); w=concat([1], t1)); w*=y; my(g=x*Ser(u+v+w), gu=x*Ser(u), gw=x*Ser(w), r=Vec(g + (substvec(g, [x,y],[x^2,y^2]) - (1-1/y)*substvec(gw, [x,y], [x^2,y^2]) - g^2 + (1-1/y)*gw*(gw+2*gu) )/2)); vector(#r, n, Vecrev(r[n]/y))}

A008619 Positive integers repeated.

Original entry on oeis.org

1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38
Offset: 0

Views

Author

Keywords

Comments

The floor of the arithmetic mean of the first n+1 positive integers. - Cino Hilliard, Sep 06 2003
Number of partitions of n into powers of 2 where no power is used more than three times, or 4th binary partition function (see A072170).
Number of partitions of n in which the greatest part is at most 2. - Robert G. Wilson v, Jan 11 2002
Number of partitions of n into at most 2 parts. - Jon Perry, Jun 16 2003
a(n) = #{k=0..n: k+n is even}. - Paul Barry, Sep 13 2003
Number of symmetric Dyck paths of semilength n+2 and having two peaks. E.g., a(6)=4 because we have UUUUUUU*DU*DDDDDDD, UUUUUU*DDUU*DDDDDD, UUUUU*DDDUUU*DDDDD and UUUU*DDDDUUUU*DDDD, where U=(1,1), D=(1,-1) and * indicates a peak. - Emeric Deutsch, Jan 12 2004
Smallest positive integer whose harmonic mean with another positive integer is n (for n > 0). For example, a(6)=4 is already given (as 4 is the smallest positive integer such that the harmonic mean of 4 (with 12) is 6) - but the harmonic mean of 2 (with -6) is also 6 and 2 < 4, so the two positive integer restrictions need to be imposed to rule out both 2 and -6.
Second outermost diagonal of Losanitsch's triangle (A034851). - Alonso del Arte, Mar 12 2006
Arithmetic mean of n-th row of A080511. - Amarnath Murthy, Mar 20 2003
a(n) is the number of ways to pay n euros (or dollars) with coins of one and two euros (respectively dollars). - Richard Choulet and Robert G. Wilson v, Dec 31 2007
Inverse binomial transform of A045623. - Philippe Deléham, Dec 30 2008
Coefficient of q^n in the expansion of (m choose 2)_q as m goes to infinity. - Y. Kelly Itakura (yitkr(AT)mta.ca), Aug 21 2002
Binomial transform of (-1)^n*A034008(n) = [1,0,1,-2,4,-8,16,-32,...]. - Philippe Deléham, Nov 15 2009
From Jon Perry_, Nov 16 2010: (Start)
Column sums of:
1 1 1 1 1 1...
1 1 1 1...
1 1...
..............
--------------
1 1 2 2 3 3... (End)
This sequence is also the half-convolution of the powers of 1 sequence A000012 with itself. For the definition of half-convolution see a comment on A201204, where also the rule for the o.g.f. is given. - Wolfdieter Lang, Jan 09 2012
a(n) is also the number of roots of the n-th Bernoulli polynomial in the right half-plane for n>0. - Michel Lagneau, Nov 08 2012
a(n) is the number of symmetry-allowed, linearly-independent terms at n-th order in the series expansion of the Exe vibronic perturbation matrix, H(Q) (cf. Viel & Eisfeld). - Bradley Klee, Jul 21 2015
a(n) is the number of distinct integers in the n-th row of Pascal's triangle. - Melvin Peralta, Feb 03 2016
a(n+1) for n >= 3 is the diameter of the Generalized Petersen Graph G(n, 1). - Nick Mayers, Jun 06 2016
The arithmetic function v_1(n,2) as defined in A289198. - Robert Price, Aug 22 2017
Also, this sequence is the second column in the triangle of the coefficients of the sum of two consecutive Fibonacci polynomials F(n+1, x) and F(n, x) (n>=0) in ascending powers of x. - Mohammad K. Azarian, Jul 18 2018
a(n+2) is the least k such that given any k integers, there exist two of them whose sum or difference is divisible by n. - Pablo Hueso Merino, May 09 2020
Column k = 2 of A051159. - John Keith, Jun 28 2021

References

  • D. J. Benson, Polynomial Invariants of Finite Groups, Cambridge, 1993, p. 100.
  • L. Comtet, Advanced Combinatorics, Reidel, 1974, p. 109, Eq. [6c]; p. 116, P(n,2).
  • D. Parisse, 'The tower of Hanoi and the Stern-Brocot Array', Thesis, Munich 1997

Crossrefs

Essentially same as A004526.
Harmonic mean of a(n) and A056136 is n.
a(n)=A010766(n+2, 2).
Cf. A010551 (partial products).
Cf. A263997 (a block spiral).
Cf. A289187.
Column 2 of A235791.

Programs

  • Haskell
    a008619 = (+ 1) . (`div` 2)
    a008619_list = concatMap (\x -> [x,x]) [1..]
    -- Reinhard Zumkeller, Apr 02 2012
    
  • Magma
    I:=[1,1,2]; [n le 3 select I[n] else Self(n-1)+Self(n-2)-Self(n-3): n in [1..100]]; // Vincenzo Librandi, Feb 04 2015
    
  • Maple
    a:= n-> iquo(n+2, 2): seq(a(n), n=0..75);
  • Mathematica
    Flatten[Table[{n,n},{n,35}]] (* Harvey P. Dale, Sep 20 2011 *)
    With[{c=Range[40]},Riffle[c,c]] (* Harvey P. Dale, Feb 23 2013 *)
    CoefficientList[Series[1/(1 - x - x^2 + x^3), {x, 0, 75}], x] (* Robert G. Wilson v, Feb 05 2015 *)
    LinearRecurrence[{1, 1, -1}, {1, 1, 2}, 75] (* Robert G. Wilson v, Feb 05 2015 *)
    Table[QBinomial[n, 2, -1], {n, 2, 75}] (* John Keith, Jun 28 2021 *)
  • PARI
    a(n)=n\2+1
    
  • Python
    def A008619(n): return (n>>1)+1 # Chai Wah Wu, Jul 07 2022
  • Sage
    a = lambda n: 1 if n==0 else a(n-1)+1 if 2.divides(n) else a(n-1) # Peter Luschny, Feb 05 2015
    
  • Scala
    (2 to 99).map( / 2) // _Alonso del Arte, May 09 2020
    

Formula

Euler transform of [1, 1].
a(n) = 1 + floor(n/2).
G.f.: 1/((1-x)(1-x^2)).
E.g.f.: ((3+2*x)*exp(x) + exp(-x))/4.
a(n) = a(n-1) + a(n-2) - a(n-3) = -a(-3-n).
a(0) = a(1) = 1 and a(n) = floor( (a(n-1) + a(n-2))/2 + 1 ).
a(n) = (2*n + 3 + (-1)^n)/4. - Paul Barry, May 27 2003
a(n) = Sum_{k=0..n} Sum_{j=0..k} Sum_{i=0..j} binomial(j, i)*(-2)^i. - Paul Barry, Aug 26 2003
E.g.f.: ((1+x)*exp(x) + cosh(x))/2. - Paul Barry, Sep 13 2003
a(n) = A108299(n-1,n)*(-1)^floor(n/2) for n > 0. - Reinhard Zumkeller, Jun 01 2005
a(n) = A108561(n+2,n) for n > 0. - Reinhard Zumkeller, Jun 10 2005
a(n) = A125291(A125293(n)) for n>0. - Reinhard Zumkeller, Nov 26 2006
a(n) = ceiling(n/2), n >= 1. - Mohammad K. Azarian, May 22 2007
INVERT transformation yields A006054 without leading zeros. INVERTi transformation yields negative of A124745 with the first 5 terms there dropped. - R. J. Mathar, Sep 11 2008
a(n) = A026820(n,2) for n > 1. - Reinhard Zumkeller, Jan 21 2010
a(n) = n - a(n-1) + 1 (with a(0)=1). - Vincenzo Librandi, Nov 19 2010
a(n) = A000217(n) / A110654(n). - Reinhard Zumkeller, Aug 24 2011
a(n+1) = A181971(n,n). - Reinhard Zumkeller, Jul 09 2012
1/(1+2/(2+3/(3+4/(4+5/(5+...(continued fraction))))) = 1/(e-1), see A073333. - Philippe Deléham, Mar 09 2013
a(n) = floor(A000217(n)/n), n > 0. - L. Edson Jeffery, Jul 26 2013
a(n) = n*a(n-1) mod (n+1) = -a(n-1) mod (n+1), the least positive residue modulo n+1 for each expression for n > 0, with a(0) = 1 (basically restatements of Vincenzo Librandi's formula). - Rick L. Shepherd, Apr 02 2014
a(n) = (a(0) + a(1) + ... + a(n-1))/a(n-1), where a(0) = 1. - Melvin Peralta, Jun 16 2015
a(n) = Sum_{k=0..n} (-1)^(n-k) * (k+1). - Rick L. Shepherd, Sep 18 2020
a(n) = a(n-2) + 1 for n >= 2. - Vladimír Modrák, Sep 29 2020
a(n) = A004526(n)+1. - Chai Wah Wu, Jul 07 2022

Extensions

Additional remarks from Daniele Parisse
Edited by N. J. A. Sloane, Sep 06 2009
Partially edited by Joerg Arndt, Mar 11 2010

A000119 Number of representations of n as a sum of distinct Fibonacci numbers.

Original entry on oeis.org

1, 1, 1, 2, 1, 2, 2, 1, 3, 2, 2, 3, 1, 3, 3, 2, 4, 2, 3, 3, 1, 4, 3, 3, 5, 2, 4, 4, 2, 5, 3, 3, 4, 1, 4, 4, 3, 6, 3, 5, 5, 2, 6, 4, 4, 6, 2, 5, 5, 3, 6, 3, 4, 4, 1, 5, 4, 4, 7, 3, 6, 6, 3, 8, 5, 5, 7, 2, 6, 6, 4, 8, 4, 6, 6, 2, 7, 5, 5, 8, 3, 6, 6, 3, 7, 4, 4, 5, 1, 5, 5, 4, 8, 4, 7, 7, 3, 9, 6, 6, 9, 3, 8, 8, 5
Offset: 0

Views

Author

Keywords

Comments

Number of partitions into distinct Fibonacci parts (1 counted as single Fibonacci number).
Inverse Euler transform of sequence has generating function Sum_{n>1} (x^F(n) - x^(2*F(n))) where F() are the Fibonacci numbers.
a(n) = 1 if and only if n+1 is a Fibonacci number. The length of such a quasi-period (from Fib(i)-1 to Fib(i+1)-1, inclusive) is a Fibonacci number + 1. The maximum value of a(n) within each subsequent quasi-period increases by a Fibonacci number. For example, from n = 143 to n = 232, the maximum is 13. From 232 to 376, the maximum is 16, an increase of 3. From 376 to 609, 21, an increase of 5. From 609 to 986, 26, increasing by 5 again. Each two subsequent maxima seem to increase by the same increment, the next Fibonacci number. - Kerry Mitchell, Nov 14 2009
The maxima of the quasi-periods are in A096748. - Max Barrentine, Sep 13 2015
Stockmeyer proves that a(n) <= sqrt(n+1) with equality iff n = Fibonacci(m)^2 - 1 for some m >= 2 (cf. A080097). - Michel Marcus, Mar 02 2016

References

  • M. Bicknell-Johnson, pp. 53-60 in "Applications of Fibonacci Numbers", volume 8, ed: F. T. Howard, Kluwer (1999); see Theorem 3.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A007000, A003107, A000121, A080097, A096748. Least inverse is A013583.

Programs

  • Haskell
    a000119 = p $ drop 2 a000045_list where
       p _      0 = 1
       p (f:fs) m = if m < f then 0 else p fs (m - f) + p fs m
    -- Reinhard Zumkeller, Dec 28 2012, Oct 21 2011
  • Maple
    with(combinat): p := product((1+x^fibonacci(i)), i=2..25): s := series(p,x,1000): for k from 0 to 250 do printf(`%d,`,coeff(s,x,k)) od: # James Sellers, May 29 2000
  • Mathematica
    CoefficientList[ Normal@Series[ Product[ 1+z^Fibonacci[ k ], {k, 2, 13} ], {z, 0, 233} ], z ]
    nmax = 104; s = Union@Table[Fibonacci[n], {n, nmax}];
    Table[Length@Select[IntegerPartitions[n, All, s], DeleteDuplicates[#] == # &], {n, 0, nmax}] (* Robert Price, Aug 17 2020 *)
  • PARI
    a(n)=local(A,m,f); if(n<0,0,A=1+x*O(x^n); m=2; while((f=fibonacci(m))<=n,A*=1+x^f; m++); polcoeff(A,n))
    
  • PARI
    f(x,y,z)=if(xCharles R Greathouse IV, Dec 14 2015
    

Formula

a(A000045(n)) = A065033(n).
a(n) = (1/n)*Sum_{k=1..n} b(k)*a(n-k), b(k) = Sum_{f} (-1)^(k/f+1)*f, where the last sum is taken over all Fibonacci numbers f dividing k. - Vladeta Jovovic, Aug 28 2002
a(n) = 1, if n <= 2; a(n) = a(Fibonacci(i-2)+k)+a(k) if n>2 and 0<=k2 and Fibonacci(i-3)<=kA000045) <= n and k=n-Fibonacci(i). [Bicknell-Johnson] - Ron Knott, Dec 06 2004
a(n) = f(n,1,1) with f(x,y,z) = if xReinhard Zumkeller, Nov 11 2009
G.f.: Product_{n>=1} 1 + q^F(n+1) = 1 + Sum_{n>=1} ( q^F(n+1) * Product_{k=1..n-1} 1 + q^F(k+1) ). - Joerg Arndt, Oct 20 2012
a(A000071(n)) = 1. - Reinhard Zumkeller, Dec 28 2012

Extensions

More terms from James Sellers, May 29 2000

A000097 Number of partitions of n if there are two kinds of 1's and two kinds of 2's.

Original entry on oeis.org

1, 2, 5, 9, 17, 28, 47, 73, 114, 170, 253, 365, 525, 738, 1033, 1422, 1948, 2634, 3545, 4721, 6259, 8227, 10767, 13990, 18105, 23286, 29837, 38028, 48297, 61053, 76926, 96524, 120746, 150487, 187019, 231643, 286152, 352413, 432937, 530383, 648245
Offset: 0

Views

Author

Keywords

Comments

Also number of partitions of 2*n with exactly 2 odd parts (offset 1). - Vladeta Jovovic, Jan 12 2005
Also number of transitions from one partition of n+2 to another, where a transition consists of replacing any two parts with their sum. Remove all 1' and 2' from the partition, replacing them with ((number of 2') + 1) and ((number of 1') + (number of 2') + 1); these are the two parts being summed. Number of partitions of n into parts of 2 kinds with at most 2 parts of the second kind, or of n+2 into parts of 2 kinds with exactly 2 parts of the second kind. - Franklin T. Adams-Watters, Mar 20 2006
From Christian Gutschwager (gutschwager(AT)math.uni-hannover.de), Feb 10 2010: (Start)
a(n) is also the number of pairs of partitions of n+2 which differ by only one box (for bijection see the first Gutschwager link).
a(n) is also the number of partitions of n with two parts marked.
a(n) is also the number of partitions of n+1 with two different parts marked. (End)
Convolution of A000041 and A008619. - Vaclav Kotesovec, Aug 18 2015
a(n) = P(/2,n), a particular case of P(/k,n) defined as follows: P(/0,n) = A000041(n) and P(/k,n) = P(/k-1, n) + P(/k-1,n-k) + P(/k-1, n-2k) + ... Also, P(/k,n) = the convolution of A000041 and the partitions of n with exactly k parts, and g.f. P(/k,n) = (g.f. for P(n)) * 1/(1-x)...(1-x^k). - Gregory L. Simay, Mar 22 2018
a(n) is also the sum of binomial(D(p),2) in partitions p of (n+3), where D(p)= number of different sizes of parts in p. - Emily Anible, Apr 03 2018
Also partitions of 2*(n+1) with alternating sum 2. Also partitions of 2*(n+1) with reverse-alternating sum -2 or 2. - Gus Wiseman, Jun 21 2021
Define the distance graph of the partitions of n using the distance function in A366156 as follows: two vertices (partitions) share an edge if and only if the distance between the vertices is 2. Then a(n) is the number of edges in the distance graph of the partitions of n. - Clark Kimberling, Oct 12 2023

Examples

			a(3) = 9 because we have 3, 2+1, 2+1', 2'+1, 2'+1', 1+1+1, 1+1+1', 1+1'+1' and 1'+1'+1'.
From _Gus Wiseman_, Jun 22 2021: (Start)
The a(0) = 1 through a(4) = 9 partitions of 2*(n+1) with exactly 2 odd parts:
  (1,1)  (3,1)    (3,3)      (5,3)
         (2,1,1)  (5,1)      (7,1)
                  (3,2,1)    (3,3,2)
                  (4,1,1)    (4,3,1)
                  (2,2,1,1)  (5,2,1)
                             (6,1,1)
                             (3,2,2,1)
                             (4,2,1,1)
                             (2,2,2,1,1)
The a(0) = 1 through a(4) = 9 partitions of 2*(n+1) with alternating sum 2:
  (2)  (3,1)    (4,2)        (5,3)
       (2,1,1)  (2,2,2)      (3,3,2)
                (3,2,1)      (4,3,1)
                (3,1,1,1)    (3,2,2,1)
                (2,1,1,1,1)  (4,2,1,1)
                             (2,2,2,1,1)
                             (3,2,1,1,1)
                             (3,1,1,1,1,1)
                             (2,1,1,1,1,1,1)
(End)
		

References

  • H. Gupta et al., Tables of Partitions. Royal Society Mathematical Tables, Vol. 4, Cambridge Univ. Press, 1958, p. 90.
  • J. Riordan, Combinatorial Identities, Wiley, 1968, p. 199.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

First differences are in A024786.
Third column of Riordan triangle A008951 and of triangle A103923.
The case of reverse-alternating sum 1 or alternating sum 0 is A000041.
The case of reverse-alternating sum -1 or alternating sum 1 is A000070.
The normal case appears to be A004526 or A065033.
The strict case is A096914.
The case of reverse-alternating sum 2 is A120452.
The case of reverse-alternating sum -2 is A344741.
A001700 counts compositions with alternating sum 2.
A035363 counts partitions into even parts.
A058696 counts partitions of 2n.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A124754 gives alternating sums of standard compositions (reverse: A344618).
A316524 is the alternating sum of the prime indices of n (reverse: A344616).
A344610 counts partitions by sum and positive reverse-alternating sum.
A344611 counts partitions of 2n with reverse-alternating sum >= 0.
Shift of A093695.

Programs

  • Maple
    with(numtheory): etr:= proc(p) local b; b:=proc(n) option remember; local d,j; if n=0 then 1 else add(add(d*p(d), d=divisors(j)) *b(n-j), j=1..n)/n fi end end: a:= etr(n->`if`(n<3,2,1)): seq(a(n), n=0..40); # Alois P. Heinz, Sep 08 2008
  • Mathematica
    CoefficientList[Series[1/((1 - x) (1 - x^2) Product[1 - x^k, {k, 1, 100}]), {x, 0, 100}], x] (* Ben Branman, Mar 07 2012 *)
    etr[p_] := Module[{b}, b[n_] := b[n] = If[n == 0, 1, Sum[Sum[d*p[d], {d, Divisors[j]}]*b[n - j], {j, 1, n}]/n]; b]; a = etr[If[# < 3, 2, 1]&]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Apr 09 2014, after Alois P. Heinz *)
    (1/((1 - x) (1 - x^2) QPochhammer[x]) + O[x]^50)[[3]] (* Vladimir Reshetnikov, Nov 22 2016 *)
    Table[Length@IntegerPartitions[n,All,Join[{1,2},Range[n]]],{n,0,15}] (* Robert Price, Jul 28 2020 and Jun 21 2021 *)
    T[n_, 0] := PartitionsP[n];
    T[n_, m_] /; (n >= m (m + 1)/2) := T[n, m] = T[n - m, m - 1] + T[n - m, m];
    T[, ] = 0;
    a[n_] := T[n + 3, 2];
    Table[a[n], {n, 0, 60}] (* Jean-François Alcover, May 30 2021 *)
    ats[y_]:=Sum[(-1)^(i-1)*y[[i]],{i,Length[y]}];Table[Length[Select[IntegerPartitions[n],ats[#]==2&]],{n,0,30,2}] (* Gus Wiseman, Jun 21 2021 *)
  • PARI
    my(x = 'x + O('x^66)); Vec( 1/((1-x)*(1-x^2)*eta(x)) ) \\ Joerg Arndt, Apr 29 2013

Formula

Euler transform of 2 2 1 1 1 1 1...
G.f.: 1/( (1-x) * (1-x^2) * Product_{k>=1} (1-x^k) ).
a(n) = Sum_{j=0..floor(n/2)} A000070(n-2*j), n>=0.
a(n) = A014153(n)/2 + A087787(n)/4 + A000070(n)/4. - Vaclav Kotesovec, Nov 05 2016
a(n) ~ sqrt(3) * exp(Pi*sqrt(2*n/3)) / (4*Pi^2) * (1 + 35*Pi/(24*sqrt(6*n))). - Vaclav Kotesovec, Aug 18 2015, extended Nov 05 2016
a(n) = A120452(n) + A344741(n). - Gus Wiseman, Jun 21 2021

Extensions

More terms from Pab Ter (pabrlos(AT)yahoo.com), May 04 2004
Edited by Emeric Deutsch, Mar 23 2005
More terms from Franklin T. Adams-Watters, Mar 20 2006
Edited by Charles R Greathouse IV, Apr 20 2010

A110654 a(n) = ceiling(n/2), or: a(2*k) = k, a(2*k+1) = k+1.

Original entry on oeis.org

0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 15, 15, 16, 16, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 29, 29, 30, 30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36, 36, 37, 37, 38
Offset: 0

Views

Author

Reinhard Zumkeller, Aug 05 2005

Keywords

Comments

The number of partitions of 2n into exactly 2 odd parts. - Wesley Ivan Hurt, Jun 01 2013
Number of nonisomorphic outer planar graphs of order n >= 3 and size n+1. - Christian Barrientos and Sarah Minion, Feb 27 2018
Also the clique covering number of the n-dipyramidal graph for n >= 3. - Eric W. Weisstein, Jun 27 2018

Examples

			G.f. = x + x^2 + 2*x^3 + 2*x^4 + 3*x^5 + 3*x^6 + 4*x^7 + 4*x^8 + 5*x^9 + ...
		

Crossrefs

Essentially the same sequence as A008619 and A123108.
Cf. A014557, A275416 (multisets).
Cf. A298648 (number of smallest coverings of dipyramidal graphs by maximal cliques).

Programs

Formula

a(n) = floor(n/2) + n mod 2.
a(n) = A004526(n+1) = A001057(n)*(-1)^(n+1).
For n > 0: a(n) = A008619(n-1).
A110655(n) = a(a(n)), A110656(n) = a(a(a(n))).
a(n) = A109613(n) - A028242(n) = A110660(n) / A028242(n).
a(n) = A001222(A029744(n)). - Reinhard Zumkeller, Feb 16 2006
a(n) = a(n-1) + a(n-2) - a(n-3) for n > 2, a(2) = a(1) = 1, a(0) = 0. - Reinhard Zumkeller, May 22 2006
First differences of quarter-squares: a(n) = A002620(n+1) - A002620(n). - Reinhard Zumkeller, Aug 06 2009
a(n) = A007742(n) - A173511(n). - Reinhard Zumkeller, Feb 20 2010
a(n) = A000217(n) / A008619(n). - Reinhard Zumkeller, Aug 24 2011
From Michael Somos, Sep 19 2006: (Start)
Euler transform of length 2 sequence [1, 1].
G.f.: x/((1-x)*(1-x^2)).
a(-1-n) = -a(n). (End)
a(n) = floor((n+1)/2) = |Sum_{m=1..n} Sum_{k=1..m} (-1)^k|, where |x| is the absolute value of x. - William A. Tedeschi, Mar 21 2008
a(n) = A065033(n) for n > 0. - R. J. Mathar, Aug 18 2008
a(n) = ceiling(n/2) = smallest integer >= n/2. - M. F. Hasler, Nov 17 2008
If n is zero then a(n) is zero, else a(n) = a(n-1) + (n mod 2). - R. J. Cano, Jun 15 2014
G.f. A(x) satisfies 0 = f(A(x), A(x^2)) where f(u, v) = (1 + x) * u * v - (u^2 - v) / 2. - Michael Somos, Jun 15 2014
Given g.f. A(x) then 2 * x^3 * (1 + x) * A(x) * A(x^2) is the g.f. of A014557. - Michael Somos, Jun 15 2014
a(n) = (n + (n mod 2)) / 2. - Fred Daniel Kline, Jun 08 2016
E.g.f.: (sinh(x) + x*exp(x))/2. - Ilya Gutkovskiy, Jun 08 2016
Satisfies the nested recurrence a(n) = a(a(n-2)) + a(n-a(n-1)) with a(1) = a(2) = 1. Cf. A004001. - Peter Bala, Aug 30 2022

Extensions

Deleted wrong formula and added formula. - M. F. Hasler, Nov 17 2008

A349060 Number of integer partitions of n that are constant or whose part multiplicities, except possibly the first and last, are all even.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 10, 13, 18, 22, 29, 35, 45, 53, 68, 77, 98, 112, 140, 157, 195, 218, 270, 298, 367, 404, 495, 542, 658, 721, 873, 949, 1145, 1245, 1494, 1615, 1934, 2091, 2492, 2688, 3188, 3436, 4068, 4369, 5155, 5537, 6511, 6976, 8186, 8763, 10251, 10962
Offset: 0

Views

Author

Gus Wiseman, Dec 06 2021

Keywords

Comments

Also the number of weakly alternating integer partitions of n, where we define a sequence to be weakly alternating if it is alternately weakly increasing and weakly decreasing, starting with either. This sequence looks at the somewhat degenerate case where no strict increases are allowed.

Examples

			The a(1) = 1 through a(7) = 13 partitions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)
       (11)  (21)   (22)    (32)     (33)      (43)
             (111)  (31)    (41)     (42)      (52)
                    (211)   (221)    (51)      (61)
                    (1111)  (311)    (222)     (322)
                            (2111)   (411)     (331)
                            (11111)  (2211)    (511)
                                     (3111)    (2221)
                                     (21111)   (4111)
                                     (111111)  (22111)
                                               (31111)
                                               (211111)
                                               (1111111)
		

Crossrefs

Alternating: A025047, ranked by A345167, also A025048 and A025049.
The strong case is A065033, ranked by A167171.
A directed version is A096441.
Non-alternating: A345192, ranked by A345168.
Weakly alternating: A349052, also A129852 and A129853.
Non-weakly alternating: A349053, ranked by A349057.
A version for ordered factorizations is A349059, strong A348610.
The complement is counted by A349061, strong A349801.
These partitions are ranked by the complement of A349794.
The non-strict case is A349795.
A000041 counts integer partitions, ordered A011782.
A001250 counts alternating permutations, complement A348615.
A344604 counts alternating compositions with twins.
A345170 counts partitions w/ an alternating permutation, ranked by A345172.

Programs

  • Mathematica
    Table[Length[Select[IntegerPartitions[n], SameQ@@#||And@@EvenQ/@Take[Length/@Split[#],{2,-2}]&]],{n,0,30}]
  • PARI
    A_x(N)={my(x='x+O('x^N), g= 1 + sum(i=1, N, (x^i/(1-x^i)) * (1 + sum(j=i+1, N-i, (x^j/((1-x^j))) / prod(k=1, j-i-1, 1-x^(2*(i+k)))))));
    Vec(g)}
    A_x(52) \\ John Tyler Rascoe, Mar 20 2024

Formula

G.f.: 1 + Sum_{i>0} (x^i/(1-x^i)) * (1 + Sum_{j>i} (x^j/(1-x^j)) / Product_{k=1..j-i-1} (1-x^(2*(i+k)))). - John Tyler Rascoe, Mar 20 2024

A344741 Number of integer partitions of 2n with reverse-alternating sum -2.

Original entry on oeis.org

0, 0, 1, 2, 4, 8, 14, 24, 39, 62, 95, 144, 212, 309, 442, 626, 873, 1209, 1653, 2245, 3019, 4035, 5348, 7051, 9229, 12022, 15565, 20063, 25722, 32847, 41746, 52862, 66657, 83768, 104873, 130889, 162797, 201902, 249620, 307789, 378428, 464122, 567721, 692828, 843448
Offset: 0

Views

Author

Gus Wiseman, Jun 08 2021

Keywords

Comments

The reverse-alternating sum of a partition (y_1,...,y_k) is Sum_i (-1)^(k-i) y_i. This is equal to (-1)^(r-1) times the number of odd parts, where r is the greatest part, so a(n) is the number of integer partitions of 2n with exactly two odd parts, neither of which is the greatest.
Also the number of reversed integer partitions of 2n with alternating sum -2.

Examples

			The a(2) = 1 through a(6) = 14 partitions:
  (31)  (42)    (53)      (64)        (75)
        (3111)  (3221)    (3331)      (4332)
                (4211)    (4222)      (4431)
                (311111)  (4321)      (5322)
                          (5311)      (5421)
                          (322111)    (6411)
                          (421111)    (322221)
                          (31111111)  (333111)
                                      (422211)
                                      (432111)
                                      (531111)
                                      (32211111)
                                      (42111111)
                                      (3111111111)
		

Crossrefs

The version for -1 instead of -2 is A000070.
The non-reversed negative version is A000097.
The ordered version appears to be A001700.
The version for 1 instead of -2 is A035363.
The whole set of partitions of 2n is counted by A058696.
The strict case appears to be A065033.
The version for -1 instead of -2 is A306145.
The version for 2 instead of -2 is A344613.
A000041 counts partitions of 2n with alternating sum 0, ranked by A000290.
A103919 counts partitions by sum and alternating sum (reverse: A344612).
A124754 gives alternating sums of standard compositions (reverse: A344618).
A316524 is the alternating sum of the prime indices of n (reverse: A344616).
A344610 counts partitions by sum and positive reverse-alternating sum.
A344611 counts partitions of 2n with reverse-alternating sum >= 0.

Programs

  • Mathematica
    sats[y_]:=Sum[(-1)^(i-Length[y])*y[[i]],{i,Length[y]}];
    Table[Length[Select[IntegerPartitions[n],sats[#]==-2&]],{n,0,30,2}]
    - or -
    Table[Length[Select[IntegerPartitions[n],EvenQ[Max[#]]&&Count[#,_?OddQ]==2&]],{n,0,30,2}]

Extensions

More terms from Bert Dobbelaere, Jun 12 2021

A349054 Number of alternating strict compositions of n. Number of alternating (up/down or down/up) permutations of strict integer partitions of n.

Original entry on oeis.org

1, 1, 1, 3, 3, 5, 9, 11, 15, 21, 35, 41, 59, 75, 103, 155, 193, 255, 339, 443, 569, 841, 1019, 1365, 1743, 2295, 2879, 3785, 5151, 6417, 8301, 10625, 13567, 17229, 21937, 27509, 37145, 45425, 58345, 73071, 93409, 115797, 147391, 182151, 229553, 297061, 365625
Offset: 0

Views

Author

Gus Wiseman, Dec 21 2021

Keywords

Comments

A strict composition of n is a finite sequence of distinct positive integers summing to n.
A sequence is alternating if it is alternately strictly increasing and strictly decreasing, starting with either.
The case starting with an increase (or decrease, it doesn't matter in the enumeration) is counted by A129838.

Examples

			The a(1) = 1 through a(7) = 11 compositions:
  (1)  (2)  (3)    (4)    (5)    (6)      (7)
            (1,2)  (1,3)  (1,4)  (1,5)    (1,6)
            (2,1)  (3,1)  (2,3)  (2,4)    (2,5)
                          (3,2)  (4,2)    (3,4)
                          (4,1)  (5,1)    (4,3)
                                 (1,3,2)  (5,2)
                                 (2,1,3)  (6,1)
                                 (2,3,1)  (1,4,2)
                                 (3,1,2)  (2,1,4)
                                          (2,4,1)
                                          (4,1,2)
		

Crossrefs

Ranking sequences are put in parentheses below.
This is the strict case of A025047/A025048/A025049 (A345167).
This is the alternating case of A032020 (A233564).
The unordered case (partitions) is A065033.
The directed case is A129838.
A001250 = alternating permutations (A349051), complement A348615 (A350250).
A003242 = Carlitz (anti-run) compositions, complement A261983.
A011782 = compositions, unordered A000041.
A345165 = partitions without an alternating permutation (A345171).
A345170 = partitions with an alternating permutation (A345172).
A345192 = non-alternating compositions (A345168).
A345195 = non-alternating anti-run compositions (A345169).
A349800 = weakly but not strongly alternating compositions (A349799).
A349052 = weakly alternating compositions, complement A349053 (A349057).

Programs

  • Maple
    g:= proc(u, o) option remember;
          `if`(u+o=0, 1, add(g(o-1+j, u-j), j=1..u))
        end:
    b:= proc(n, k) option remember; `if`(k<0 or n<0, 0,
          `if`(k=0, `if`(n=0, 2, 0), b(n-k, k)+b(n-k, k-1)))
        end:
    a:= n-> add(b(n, k)*g(k, 0), k=0..floor((sqrt(8*n+1)-1)/2))-1:
    seq(a(n), n=0..46);  # Alois P. Heinz, Dec 22 2021
  • Mathematica
    wigQ[y_]:=Or[Length[y]==0,Length[Split[y]]==Length[y]&&Length[Split[Sign[Differences[y]]]]==Length[y]-1];
    Table[Length[Select[Join@@Permutations/@Select[IntegerPartitions[n],UnsameQ@@#&],wigQ]],{n,0,15}]

Formula

a(n) = 2 * A129838(n) - 1.
G.f.: Sum_{n>0} A001250(n)*x^(n*(n+1)/2)/Product_{k=1..n}(1-x^k).

A258280 Number T(n,k) of partitions of k copies of n into distinct parts; triangle T(n,k), n>=0, 0<=k<=max(1,ceiling(n/2)), read by rows.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 2, 1, 1, 3, 3, 1, 1, 4, 4, 1, 1, 5, 7, 4, 1, 1, 6, 9, 5, 1, 1, 8, 16, 13, 5, 1, 1, 10, 21, 18, 7, 1, 1, 12, 33, 37, 20, 6, 1, 1, 15, 46, 56, 31, 8, 1, 1, 18, 68, 103, 75, 29, 7, 1, 1, 22, 95, 154, 118, 47, 10, 1, 1, 27, 140, 279, 266, 134, 40, 8, 1
Offset: 0

Views

Author

Alois P. Heinz, May 25 2015

Keywords

Examples

			T(7,0) = 1: [].
T(7,1) = 5: [7], [6,1], [5,2], [4,3], [4,2,1].
T(7,2) = 7: [7;6,1], [7;5,2], [7;4,3], [7;4,2,1], [6,1;5,2], [6,1;4,3], [5,2;4,3].
T(7,3) = 4: [7;6,1;5,2], [7;6,1;4,3], [7;5,2;4,3], [6,1;5,2;4,3].
T(7,4) = 1: [7;6,1;5,2;4,3].
T(8,4) = 1: [8;7,1;6,2;5,3].
Triangle T(n,k) begins:
00  :  1,  1;
01  :  1,  1;
02  :  1,  1;
03  :  1,  2,   1;
04  :  1,  2,   1;
05  :  1,  3,   3,   1;
06  :  1,  4,   4,   1;
07  :  1,  5,   7,   4,   1;
08  :  1,  6,   9,   5,   1;
09  :  1,  8,  16,  13,   5,   1;
10  :  1, 10,  21,  18,   7,   1;
11  :  1, 12,  33,  37,  20,   6,  1;
12  :  1, 15,  46,  56,  31,   8,  1;
13  :  1, 18,  68, 103,  75,  29,  7, 1;
14  :  1, 22,  95, 154, 118,  47, 10, 1;
15  :  1, 27, 140, 279, 266, 134, 40, 8, 1;
       ...
		

Crossrefs

Row sums give 1 + A258289.
Row lengths give 1 + A065033.
T(n^2,n) gives A284824.

Programs

  • Maple
    b:= proc() option remember; local m; m:= args[nargs];
         `if`(nargs=1, 1, `if`(args[1]=0, b(args[t] $t=2..nargs),
         `if`(m=0 or add(args[i], i=1..nargs-1)> m*(m+1)/2, 0,
          b(args[t] $t=1..nargs-1, m-1) +add(`if`(args[j]-m<0, 0,
          b(sort([seq(args[i] -`if`(i=j, m, 0), i=1..nargs-1)])[]
          , m-1)), j=1..nargs-1))))
        end:
    T:= (n, k)-> b(n$k+1)/k!:
    seq(seq(T(n, k), k=0..max(1, ceil(n/2))), n=0..15);
  • Mathematica
    disParts[n_] := disParts[n] = Select[IntegerPartitions[n], Length[#] == Length[Union[#]]&];
    T[n_, k_] := Select[Subsets[disParts[n], {k}], Length[Flatten[#]] == Length[Union[Flatten[#]]]&] // Length;
    Table[T[n, k], {n, 0, 15}, {k, 0, Max[1, Ceiling[n/2]]}] // Flatten (* Jean-François Alcover, Feb 17 2021 *)

Formula

T(n,k) = 1/k! * [Product_{i=1..k} x_i^n] Product_{j>0} (1+Sum_{i=1..k} x_i^j).
Showing 1-10 of 23 results. Next