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

A000975 a(2n) = 2*a(2n-1), a(2n+1) = 2*a(2n)+1 (also a(n) is the n-th number without consecutive equal binary digits).

Original entry on oeis.org

0, 1, 2, 5, 10, 21, 42, 85, 170, 341, 682, 1365, 2730, 5461, 10922, 21845, 43690, 87381, 174762, 349525, 699050, 1398101, 2796202, 5592405, 11184810, 22369621, 44739242, 89478485, 178956970, 357913941, 715827882, 1431655765, 2863311530, 5726623061, 11453246122
Offset: 0

Views

Author

Keywords

Comments

Might be called the "Lichtenberg sequence" after Georg Christoph Lichtenberg, who discussed it in 1769 in connection with the Chinese Rings puzzle (baguenaudier). - Andreas M. Hinz, Feb 15 2017
Number of steps to change from a binary string of n 0's to n 1's using a Gray code. - Jon Stadler (jstadler(AT)coastal.edu)
Popular puzzles such as Spin-Out and The Brain Puzzler are based on the Gray binary system and require a(n) steps to complete for some number n.
Conjecture: {a(n)} also gives all j for which A048702(j) = A000217(j); i.e., if we take the a(n)-th triangular number (a(n)^2 + a(n))/2 and multiply it by 3, we get a(n)-th even-length binary palindrome A048701(a(n)) concatenated from a(n) and its reverse. E.g., a(4) = 10, which is 1010 in binary; the tenth triangular number is 55, and 55*3 = 165 = 10100101 in binary. - Antti Karttunen, circa 1999. (This has been now proved by Paul K. Stockmeyer in his arXiv:1608.08245 paper.) - Antti Karttunen, Aug 31 2016
Number of ways to tie a tie of n or fewer half turns, excluding mirror images. Also number of walks of length n or less on a triangular lattice with the following restrictions; given l, r and c as the lattice axes. 1. All steps are taken in the positive axis direction. 2. No two consecutive steps are taken on the same axis. 3. All walks begin with l. 4. All walks end with rlc or lrc. - Bill Blewett, Dec 21 2000
a(n) is the minimal number of vertices to be selected in a vertex-cover of the balanced tree B_n. - Sen-peng Eu, Jun 15 2002
A087117(a(n)) = A038374(a(n)) = 1 for n > 1; see also A090050. - Reinhard Zumkeller, Nov 20 2003
Intersection of A003754 and A003714; complement of A107907. - Reinhard Zumkeller, May 28 2005
Equivalently, numbers m whose binary representation is effectively, for some number k, both the lazy Fibonacci and the Zeckendorf representation of k (in which case k = A022290(m)). - Peter Munn, Oct 06 2022
a(n+1) gives row sums of Riordan array (1/(1-x), x(1+2x)). - Paul Barry, Jul 18 2005
Total number of initial 01's in all binary words of length n+1. Example: a(3) = 5 because the binary words of length 4 that start with 01 are (01)00, (01)(01), (01)10 and (01)11 and the total number of initial 01's is 5 (shown between parentheses). a(n) = Sum_{k >= 0} k*A119440(n+1, k). - Emeric Deutsch, May 19 2006
In Norway we call the 10-ring puzzle "strikketoy" or "knitwear" (see link). It takes 682 moves to free the two parts. - Hans Isdahl, Jan 07 2008
Equals A002450 and A020988 interlaced. - Zak Seidov, Feb 10 2008
For n > 1, let B_n = the complete binary tree with vertex set V where |V| = 2^n - 1. If VC is a minimum-size vertex cover of B_n, Sen-Peng Eu points out that a(n) = |VC|. It also follows that if IS = V\VC, a(n+1) = |IS|. - K.V.Iyer, Apr 13 2009
Starting with 1 and convolved with [1, 2, 2, 2, ...] = A000295. - Gary W. Adamson, Jun 02 2009
a(n) written in base 2 is sequence A056830(n). - Jaroslav Krizek, Aug 05 2009
This is the sequence A(0, 1; 1, 2; 1) of the family of sequences [a,b:c,d:k] considered by G. Detlefs, and treated as A(a,b;c,d;k) in the W. Lang link given below. - Wolfdieter Lang, Oct 18 2010
From Vladimir Shevelev, Jan 30 2012, Feb 13 2012: (Start)
1) Denote by {n, k} the number of permutations of 1, ..., n with the up-down index k (for definition, see comment in A203827). Then max_k{n, k} = {n, a(n)} = A000111(n).
2) a(n) is the minimal number > a(n-1) with the Hamming distance d_H(a(n-1), a(n)) = n. Thus this sequence is the Hamming analog of triangular numbers 0, 1, 3, 6, 10, ... (End)
From Hieronymus Fischer, Nov 22 2012: (Start)
Represented in binary form each term after the second one contains every previous term as a substring.
The terms a(2) = 2 and a(3) = 5 are the only primes. Proof: For even n we get a(n) = 2*(2^(2*n) - 1)/3, which shows that a(n) is even, too, and obviously a(n) > 2 for all even n > 2. For odd n we have a(n) = (2^(n+1) - 1)/3 = (2^((n+1)/2) - 1) * (2^((n+1)/2) + 1)/3. Evidently, at least one of these factors is divisible by 3, both are greater than 6, provided n > 3. Hence it follows that a(n) is composite for all odd n > 3.
Represented as a binary number, a(n+1) has exactly n prime substrings. Proof: Evidently, a(1) = 1_2 has zero and a(2) = 10_2 has 1 prime substring. Let n > 1. Written in binary, a(n+1) is 101010101...01 (if n + 1 is odd) and is 101010101...10 (if n + 1 is even) with n + 1 digits. Only the 2- and 3-digits substrings 10_2 (=2) and 101_2 (=5) are prime substrings. All the other substrings are nonprime since every substring is a previous term and all terms unequal to 2 and 5 are nonprime. For even n + 1, the number of prime substrings equal to 2 = 10_2 is (n+1)/2, and the number of prime substrings equal to 5 = 101_2 is (n-1)/2, makes a sum of n. For odd n + 1 we get n/2 for both, the number of 2's and 5's prime substrings, in any case, the sum is n. (End)
Number of different 3-colorings for the vertices of all triangulated planar polygons on a base with n+2 vertices if the colors of the two base vertices are fixed. - Patrick Labarque, Feb 09 2013
A090079(a(n)) = a(n) and A090079(m) <> a(n) for m < a(n). - Reinhard Zumkeller, Feb 16 2013
a(n) is the number of length n binary words containing at least one 1 and ending in an even number (possibly zero) of 0's. a(3) = 5 because we have: 001, 011, 100, 101, 111. - Geoffrey Critzer, Dec 15 2013
a(n) is the number of permutations of length n+1 having exactly one descent such that the first element of the permutation is an even number. - Ran Pan, Apr 18 2015
a(n) is the sequence of the last row of the Hadamard matrix H(2^n) obtained via Sylvester's construction: H(2) = [1,1;1,-1], H(2^n) = H(2^(n-1))*H(2), where * is the Kronecker product. - William P. Orrick, Jun 28 2015
Conjectured record values of A264784: a(n) = A264784(A155051(n-1)). - Reinhard Zumkeller, Dec 04 2015. (This is proved by Paul K. Stockmeyer in his arXiv:1608.08245 paper.) - Antti Karttunen, Aug 31 2016
Decimal representation of the x-axis, from the origin to the right edge, of the n-th stage of growth of the two-dimensional cellular automaton defined by "Rule 131", based on the 5-celled von Neumann neighborhood. See A279053 for references and links. - Robert Price, Dec 05 2016
For n > 4, a(n-2) is the second-largest number in row n of A127824. - Dmitry Kamenetsky, Feb 11 2017
Conjecture: a(n+1) is the number of compositions of n with two kinds of parts, n and n', where the order of the 1 and 1' does not matter. For n=2, a(3) = 5 compositions, enumerated as follows: 2; 2'; 1,1; 1',1 = 1',1; 1',1'. - Gregory L. Simay, Sep 02 2017
Conjecture proved by recognizing the appropriate g.f. is x/(1 - x)(1 - x)(1 - 2*x^2 - 2x^3 - ...) = x/(1 - 2*x - x^2 + 2x^3). - Gregory L. Simay, Sep 10 2017
a(n) = 2^(n-1) + 2^(n-3) + 2^(n-5) + ... a(2*k -1) = A002450(k) is the sum of the powers of 4. a(2*k) = 2*A002450(k). - Gregory L. Simay, Sep 27 2017
a(2*n) = n times the string [10] in binary representation, a(2*n+1) = n times the string [10] followed with [1] in binary representation. Example: a(7) = 85 = (1010101) in binary, a(8) = 170 = (10101010) in binary. - Ctibor O. Zizka, Nov 06 2018
Except for 0, these are the positive integers whose binary expansion has cuts-resistance 1. For the operation of shortening all runs by 1, cuts-resistance is the number of applications required to reach an empty word. Cuts-resistance 2 is A329862. - Gus Wiseman, Nov 27 2019
From Markus Sigg, Sep 14 2020: (Start)
Let s(k) be the length of the Collatz orbit of k, e.g. s(1) = 1, s(2) = 2, s(3) = 5. Then s(a(n)) = n+3 for n >= 3. Proof by induction: s(a(3)) = s(5) = 6 = 3+3. For odd n >= 5 we have s(a(n)) = s(4*a(n-2)+1) = s(12*a(n-2)+4)+1 = s(3*a(n-2)+1)+3 = s(a(n-2))+2 = (n-2)+3+2 = n+3, and for even n >= 4 this gives s(a(n)) = s(2*a(n-1)) = s(a(n-1))+1 = (n-1)+3+1 = n+3.
Conjecture: For n >= 3, a(n) is the second largest natural number whose Collatz orbit has length n+3. (End)
From Gary W. Adamson, May 14 2021: (Start)
With offset 1 the sequence equals the numbers of 1's from n = 1 to 3, 3 to 7, 7 to 15, ...; of A035263; as shown below:
..1 3 7 15...
..1 0 1 1 1 0 1 0 1 0 1 1 1 0 1...
..1.....2...........5......................10...; a(n) = Sum_(k=1..2n-1)A035263(k)
.....1...........2.......................5...; as to zeros.
..1's in the Tower of Hanoi game represent CW moves On disks in the pattern:
..0, 1, 2, 0, 1, 2, ... whereas even numbered disks move in the pattern:
..0, 2, 1, 0, 2, 1, ... (End)
Except for 0, numbers that are repunits in Gray-code representation (A014550). - Amiram Eldar, May 21 2021
From Gus Wiseman, Apr 20 2023: (Start)
Also the number of nonempty subsets of {1..n} with integer median, where the median of a multiset is the middle part in the odd-length case, and the average of the two middle parts in the even-length case. For example, the a(1) = 1 through a(4) = 10 subsets are:
{1} {1} {1} {1}
{2} {2} {2}
{3} {3}
{1,3} {4}
{1,2,3} {1,3}
{2,4}
{1,2,3}
{1,2,4}
{1,3,4}
{2,3,4}
The complement is counted by A005578.
For mean instead of median we have A051293, counting empty sets A327475.
For normal multisets we have A056450, strongly normal A361202.
For partitions we have A325347, strict A359907, complement A307683.
(End)

Examples

			a(4)=10 since 0001, 0011, 0010, 0110, 0111, 0101, 0100, 1100, 1101, 1111 are the 10 binary strings switching 0000 to 1111.
a(3) = 1 because "lrc" is the only way to tie a tie with 3 half turns, namely, pass the business end of the tie behind the standing part to the left, bring across the front to the right, then behind to the center. The final motion of tucking the loose end down the front behind the "lr" piece is not considered a "step".
a(4) = 2 because "lrlc" is the only way to tie a tie with 4 half turns. Note that since the number of moves is even, the first step is to go to the left in front of the tie, not behind it. This knot is the standard "four in hand", the most commonly known men's tie knot. By contrast, the second most well known tie knot, the Windsor, is represented by "lcrlcrlc".
a(n) = (2^0 - 1) XOR (2^1 - 1) XOR (2^2 - 1) XOR (2^3 - 1) XOR ... XOR (2^n - 1). - _Paul D. Hanna_, Nov 05 2011
G.f. = x + 2*x^2 + 5*x^3 + 10*x^4 + 21*x^5 + 42*x^6 + 85*x^7 + 170*x^8 + ...
a(9) = 341 = 2^8 + 2^6 + 2^4 + 2^2 + 2^0 = 4^4 + 4^3 + 4^2 + 4^1 + 4^0 = A002450(5). a(10) = 682 = 2*a(9) = 2*A002450(5). - _Gregory L. Simay_, Sep 27 2017
		

References

  • Thomas Fink and Yong Mao, The 85 Ways to Tie a Tie, Broadway Books, New York (1999), p. 138.
  • Clifford A. Pickover, The Math Book, From Pythagoras to the 57th Dimension, 250 Milestones in the History of Mathematics, Sterling Publ., NY, 2009.

Crossrefs

Partial sums of A001045.
Row sums of triangle A013580.
Equals A026644/2.
Union of the bijections A002450 and A020988. - Robert G. Wilson v, Jun 09 2014
Column k=3 of A261139.
Complement of A107907.
Row 3 of A300653.
Other sequences that relate to the binary representation of the terms: A003714, A003754, A007088, A022290, A056830, A104161, A107909.

Programs

  • GAP
    List([0..35],n->(2^(n+1)-2+(n mod 2))/3); # Muniru A Asiru, Nov 01 2018
    
  • Haskell
    a000975 n = a000975_list !! n
    a000975_list = 0 : 1 : map (+ 1)
       (zipWith (+) (tail a000975_list) (map (* 2) a000975_list))
    -- Reinhard Zumkeller, Mar 07 2012
    
  • Magma
    [(2^(n+1) - 2 + (n mod 2))/3: n in [0..40]]; // Vincenzo Librandi, Mar 18 2015
    
  • Maple
    A000975 := proc(n) option remember; if n <= 1 then n else if n mod 2 = 0 then 2*A000975(n-1) else 2*A000975(n-1)+1 fi; fi; end;
    seq(iquo(2^n,3),n=1..33); # Zerinvary Lajos, Apr 20 2008
    f:=n-> if n mod 2 = 0 then (2^n-1)/3 else (2^n-2)/3; fi; [seq(f(n),n=0..40)]; # N. J. A. Sloane, Mar 21 2017
  • Mathematica
    Array[Ceiling[2(2^# - 1)/3] &, 41, 0]
    RecurrenceTable[{a[0] == 0, a[1] == 1, a[n] == a[n - 1] + 2a[n - 2] + 1}, a, {n, 40}] (* or *)
    LinearRecurrence[{2, 1, -2}, {0, 1, 2}, 40] (* Harvey P. Dale, Aug 10 2013 *)
    f[n_] := Block[{exp = n - 2}, Sum[2^i, {i, exp, 0, -2}]]; Array[f, 33] (* Robert G. Wilson v, Oct 30 2015 *)
    f[s_List] := Block[{a = s[[-1]]}, Append[s, If[OddQ@ Length@ s, 2a + 1, 2a]]]; Nest[f, {0}, 32] (* Robert G. Wilson v, Jul 20 2017 *)
    NestList[2# + Boole[EvenQ[#]] &, 0, 39] (* Alonso del Arte, Sep 21 2018 *)
  • PARI
    {a(n) = if( n<0, 0, 2 * 2^n \ 3)}; /* Michael Somos, Sep 04 2006 */
    
  • PARI
    a(n)=if(n<=0,0,bitxor(a(n-1),2^n-1)) \\ Paul D. Hanna, Nov 05 2011
    
  • PARI
    concat(0, Vec(x/(1-2*x-x^2+2*x^3) + O(x^100))) \\ Altug Alkan, Oct 30 2015
    
  • PARI
    {a(n) = (4*2^n - 3 - (-1)^n) / 6}; /* Michael Somos, Jul 23 2017 */
    
  • Python
    def a(n): return (2**(n+1) - 2 + (n%2))//3
    print([a(n) for n in range(35)]) # Michael S. Branicky, Dec 19 2021

Formula

a(n) = ceiling(2*(2^n-1)/3).
Alternating sum transform (PSumSIGN) of {2^n - 1} (A000225).
a(n) = a(n-1) + 2*a(n-2) + 1.
a(n) = 2*2^n/3 - 1/2 - (-1)^n/6.
a(n) = Sum_{i = 0..n} A001045(i), partial sums of A001045. - Bill Blewett
a(n) = n + 2*Sum_{k = 1..n-2} a(k).
G.f.: x/((1+x)*(1-x)*(1-2*x)) = x/(1-2*x-x^2+2*x^3). - Paul Barry, Feb 11 2003
a(n) = 2*a(n-1) + a(n-2) - 2*a(n-3). - Paul Barry, Feb 11 2003
a(n) = Sum_{k = 0..floor((n-1)/2)} 2^(n-2*k-1). - Paul Barry, Nov 11 2003
a(n+1) = Sum_{k=0..floor(n/2)} 2^(n-2*k); a(n+1) = Sum_{k = 0..n} Sum_{j = 0..k} (-1)^(j+k)*2^j. - Paul Barry, Nov 12 2003
(-1)^(n+1)*a(n) = Sum_{i = 0..n} Sum_{k = 1..i} k!*k* Stirling2(i, k)*(-1)^(k-1) = (1/3)*(-2)^(n+1)-(1/6)(3*(-1)^(n+1)-1). - Mario Catalani (mario.catalani(AT)unito.it), Dec 22 2003
a(n+1) = (n!/3)*Sum_{i - (-1)^i + j = n, i = 0..n, j = 0..n} 1/(i - (-1)^i)!/j!. - Benoit Cloitre, May 24 2004
a(n) = A001045(n+1) - A059841(n). - Paul Barry, Jul 22 2004
a(n) = Sum_{k = 0..n} 2^(n-k-1)*(1-(-1)^k), row sums of A130125. - Paul Barry, Jul 28 2004
a(n) = Sum_{k = 0..n} binomial(k, n-k+1)2^(n-k); a(n) = Sum_{k = 0..floor(n/2)} binomial(n-k, k+1)2^k. - Paul Barry, Oct 07 2004
a(n) = A107909(A104161(n)); A007088(a(n)) = A056830(n). - Reinhard Zumkeller, May 28 2005
a(n) = floor(2^(n+1)/3) = ceiling(2^(n+1)/3) - 1 = A005578(n+1) - 1. - Paul Barry, Oct 08 2005
Convolution of "Number of fixed points in all 231-avoiding involutions in S_n." (A059570) with "1-n" (A024000), treating the result as if offset was 0. - Graeme McRae, Jul 12 2006
a(n) = A081254(n) - 2^n. - Philippe Deléham, Oct 15 2006
Starting (1, 2, 5, 10, 21, 42, ...), these are the row sums of triangle A135228. - Gary W. Adamson, Nov 23 2007
Let T = the 3 X 3 matrix [1,1,0; 1,0,1; 0,1,1]. Then T^n * [1,0,0] = [A005578(n), A001045(n), a(n-1)]. - Gary W. Adamson, Dec 25 2007
2^n = 2*A005578(n-1) + 2*A001045(n) + 2*a(n-2). - Gary W. Adamson, Dec 25 2007
If we define f(m,j,x) = Sum_{k=j..m} binomial(m,k)*stirling2(k,j)*x^(m-k) then a(n-3) = (-1)^(n-1)*f(n,3,-2), (n >= 3). - Milan Janjic, Apr 26 2009
a(n) + A001045(n) = A166920(n). a(n) + A001045(n+2) = A051049(n+1). - Paul Curtz, Oct 29 2009
a(n) = floor(A051049(n+1)/3). - Gary Detlefs, Dec 19 2010
a(n) = round((2^(n+2)-3)/6) = floor((2^(n+1)-1)/3) = round((2^(n+1)-2)/3); a(n) = a(n-2) + 2^(n-1), n > 1. - Mircea Merca, Dec 27 2010
a(n) = binary XOR of 2^k-1 for k=0..n. - Paul D. Hanna, Nov 05 2011
E.g.f.: 2/3*exp(2*x) - 1/2*exp(x) - 1/6*exp(-x) = 2/3*U(0); U(k) = 1 - 3/(4*(2^k) - 4*(2^k)/(1+3*(-1)^k - 24*x*(2^k)/(8*x*(2^k)*(-1)^k - (k+1)/U(k+1)))); (continued fraction). - Sergei N. Gladkovskii, Nov 21 2011
Starting with "1" = triangle A059260 * [1, 2, 2, 2, ...] as a vector. - Gary W. Adamson, Mar 06 2012
a(n) = 2*(2^n - 1)/3, for even n; a(n) = (2^(n+1) - 1)/3 = (1/3)*(2^((n+1)/2) - 1)*(2^((n+1)/2) + 1), for odd n. - Hieronymus Fischer, Nov 22 2012
a(n) + a(n+1) = 2^(n+1) - 1. - Arie Bos, Apr 03 2013
G.f.: Q(0)/(3*(1-x)), where Q(k) = 1 - 1/(4^k - 2*x*16^k/(2*x*4^k - 1/(1 + 1/(2*4^k - 8*x*16^k/(4*x*4^k + 1/Q(k+1)))))); (continued fraction). - Sergei N. Gladkovskii, May 21 2013
floor(a(n+2)*3/5) = A077854(n), for n >= 0. - Armands Strazds, Sep 21 2014
a(n) = (2^(n+1) - 2 + (n mod 2))/3. - Paul Toms, Mar 18 2015
a(0) = 0, a(n) = 2*(a(n-1)) + (n mod 2). - Paul Toms, Mar 18 2015
Binary: a(n) = (a(n-1) shift left 1) + (a(n-1)) NOR (...11110). - Paul Toms, Mar 18 2015
Binary: for n > 1, a(n) = 2*a(n-1) OR a(n-2). - Stanislav Sykora, Nov 12 2015
a(n) = A266613(n) - 20*2^(n-5), for n > 2. - Andres Cicuttin, Mar 31 2016
From Michael Somos, Jul 23 2017: (Start)
a(n) = -(2^n)*a(-n) for even n; a(n) = -(2^(n+1))*a(-n) + 1 for odd n.
0 = +a(n)*(+2 +4*a(n) -4*a(n+1)) + a(n+1)*(-1 +a(n+1)) for all n in Z. (End)
G.f.: (x^1+x^3+x^5+x^7+...)/(1-2*x). - Gregory L. Simay, Sep 27 2017
a(n+1) = A051049(n) + A001045(n). - Yuchun Ji, Jul 12 2018
a(n) = A153772(n+3)/4. - Markus Sigg, Sep 14 2020
a(4*k+d) = 2^(d+1)*a(4*k-1) + a(d), a(n+4) = a(n) + 2^n*10, a(0..3) = [0,1,2,5]. So the last digit is always 0,1,2,5 repeated. - Yuchun Ji, May 22 2023

Extensions

Additional comments from Barry E. Williams, Jan 10 2000

A006134 a(n) = Sum_{k=0..n} binomial(2*k,k).

Original entry on oeis.org

1, 3, 9, 29, 99, 351, 1275, 4707, 17577, 66197, 250953, 956385, 3660541, 14061141, 54177741, 209295261, 810375651, 3143981871, 12219117171, 47564380971, 185410909791, 723668784231, 2827767747951, 11061198475551, 43308802158651, 169719408596403, 665637941544507
Offset: 0

Views

Author

Keywords

Comments

The expression a(n) = B^n*Sum_{ k=0..n } binomial(2*k,k)/B^k gives A006134 for B=1, A082590 (B=2), A132310 (B=3), A002457 (B=4), A144635 (B=5). - N. J. A. Sloane, Jan 21 2009
T(n+1,1) from table A045912 of characteristic polynomial of negative Pascal matrix. - Michael Somos, Jul 24 2002
p divides a((p-3)/2) for p=11, 13, 23, 37, 47, 59, 61, 71, 73, 83, 97, 107, 109, 131, 157, 167, ...: A097933. Also primes congruent to {1, 2, 3, 11} mod 12 or primes p such that 3 is a square mod p (excluding 2 and 3) A038874. - Alexander Adamchuk, Jul 05 2006
Partial sums of the even central binomial coefficients. For p prime >=5, a(p-1) = 1 or -1 (mod p) according as p = 1 or -1 (mod 3) (see Pan and Sun link). - David Callan, Nov 29 2007
First column of triangle A187887. - Michel Marcus, Jun 23 2013
From Gus Wiseman, Apr 20 2023: (Start)
Also the number of nonempty subsets of {1,...,2n+1} with median n+1, where the median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length). The odd/even-length cases are A000984 and A006134(n-1). For example, the a(0) = 1 through a(2) = 9 subsets are:
{1} {2} {3}
{1,3} {1,5}
{1,2,3} {2,4}
{1,3,4}
{1,3,5}
{2,3,4}
{2,3,5}
{1,2,4,5}
{1,2,3,4,5}
Alternatively, a(n-1) is the number of nonempty subsets of {1,...,2n-1} with median n.
(End)

Examples

			1 + 3*x + 9*x^2 + 29*x^3 + 99*x^4 + 351*x^5 + 1275*x^6 + 4707*x^7 + 17577*x^8 + ...
		

References

  • Marko Petkovsek, Herbert Wilf and Doron Zeilberger, A=B, A K Peters, 1996, p. 22.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A000984 (first differences), A097933, A038874, A132310.
Equals A066796 + 1.
Odd bisection of A100066.
Row sums of A361654 (also column k = 2).
A007318 counts subsets by length, A231147 by median, A013580 by integer median.
A359893 and A359901 count partitions by median.

Programs

  • MATLAB
    n=10; x=pascal(n); trace(x)
    
  • Magma
    &cat[ [&+[ Binomial(2*k, k): k in [0..n]]]: n in [0..30]]; // Vincenzo Librandi, Aug 13 2015
  • Maple
    A006134 := proc(n) sum(binomial(2*k,k),k=0..n); end;
    a := n -> -binomial(2*(n+1),n+1)*hypergeom([1,n+3/2],[n+2], 4) - I/sqrt(3):
    seq(simplify(a(n)), n=0..24); # Peter Luschny, Oct 29 2015
    # third program:
    A006134 := series(exp(2*x)*BesselI(0, 2*x) + exp(x)*int(BesselI(0, 2*x)*exp(x), x), x = 0, 25):
    seq(n!*coeff(A006134, x, n), n=0..24); # Mélika Tebni, Feb 27 2024
  • Mathematica
    Table[Sum[((2k)!/(k!)^2),{k,0,n}], {n,0,50}] (* Alexander Adamchuk, Jul 05 2006 *)
    a[ n_] := (4/3) Binomial[ 2 n, n] Hypergeometric2F1[ 1/2, 1, -n + 1/2, -1/3] (* Michael Somos, Jun 20 2012 *)
    Accumulate[Table[Binomial[2n,n],{n,0,30}]] (* Harvey P. Dale, Jan 11 2015 *)
    CoefficientList[Series[1/((1 - x) Sqrt[1 - 4 x]), {x, 0, 33}], x] (* Vincenzo Librandi, Aug 13 2015 *)
  • Maxima
    makelist(sum(binomial(2*k,k),k,0,n),n,0,12); /* Emanuele Munarini, Mar 15 2011 */
    
  • PARI
    {a(n) = if( n<0, 0, polcoeff( charpoly( matrix( n+1, n+1, i, j, -binomial( i+j-2, i-1))), 1))} \\ Michael Somos, Jul 10 2002
    
  • PARI
    {a(n)=binomial(2*n,n)*sum(k=0,2*n,(-1)^k*polcoeff((1+x+x^2)^n,k)/binomial(2*n,k))} \\ Paul D. Hanna, Aug 21 2007
    
  • PARI
    my(x='x+O('x^100)); Vec(1/((1-x)*sqrt(1-4*x))) \\ Altug Alkan, Oct 29 2015
    

Formula

From Alexander Adamchuk, Jul 05 2006: (Start)
a(n) = Sum_{k=0..n} (2k)!/(k!)^2.
a(n) = A066796(n) + 1, n>0. (End)
G.f.: 1/((1-x)*sqrt(1-4*x)).
D-finite with recurrence: (n+2)*a(n+2) - (5*n+8)*a(n+1) + 2*(2*n+3)*a(n) = 0. - Emanuele Munarini, Mar 15 2011
a(n) = C(2n,n) * Sum_{k=0..2n} (-1)^k*trinomial(n,k)/C(2n,k) where trinomial(n,k) = [x^k] (1 + x + x^2)^n. E.g. a(2) = C(4,2)*(1/1 - 2/4 + 3/6 - 2/4 + 1/1) = 6*(3/2) = 9 ; a(3) = C(6,3)*(1/1 - 3/6 + 6/15 - 7/20 + 6/15 - 3/6 + 1/1) = 20*(29/20) = 29. - Paul D. Hanna, Aug 21 2007
From Alzhekeyev Ascar M, Jan 19 2012: (Start)
a(n) = Sum_{ k=0..n } b(k)*binomial(n+k,k), where b(k)=0 for n-k == 2 (mod 3), b(k)=1 for n-k == 0 or 1 (mod 6), and b(k)=-1 for n-k== 3 or 4 (mod 6).
a(n) = Sum_{ k=0..n-1 } c(k)*binomial(2n,k) + binomial(2n,n), where c(k)=0 for n-k == 0 (mod 3), c(k)=1 for n-k== 1 (mod 3), and c(k)=-1 for n-k==2 (mod 3). (End)
a(n) ~ 2^(2*n+2)/(3*sqrt(Pi*n)). - Vaclav Kotesovec, Nov 06 2012
G.f.: G(0)/2/(1-x), where G(k)= 1 + 1/(1 - 2*x*(2*k+1)/(2*x*(2*k+1) + (k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, May 24 2013
G.f.: G(0)/(1-x), where G(k)= 1 + 4*x*(4*k+1)/( (4*k+2) - x*(4*k+2)*(4*k+3)/(x*(4*k+3) + (k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Jun 26 2013
a(n) = Sum_{k = 0..n} binomial(n+1,k+1)*A002426(k). - Peter Bala, Oct 29 2015
a(n) = -binomial(2*(n+1),n+1)*hypergeom([1,n+3/2],[n+2], 4) - i/sqrt(3). - Peter Luschny, Oct 29 2015
a(n) = binomial(2*n, n)*hypergeom([1,-n], [1/2-n], 1/4). - Peter Luschny, Mar 16 2016
From Gus Wiseman, Apr 20 2023: (Start)
a(n+1) - a(n) = A000984(n).
a(n) = A013580(2n+1,n+1) (conjectured).
a(n) = 2*A024718(n) - 1.
a(n) = A100066(2n+1).
a(n) = A231147(2n+1,n+1) (conjectured). (End)
a(n) = Sum_{k=0..floor(n/3)} 3^(n-3*k) * binomial(n-k,2*k) * binomial(2*k,k) (Sawhney, 2017). - Amiram Eldar, Feb 24 2024
From Mélika Tebni, Feb 27 2024: (Start)
Limit_{n -> oo} a(n) / A281593(n) = 2.
E.g.f.: exp(2*x)*BesselI(0,2*x) + exp(x)*integral( BesselI(0,2*x)*exp(x) ) dx. (End)
a(n) = [(x*y)^n] 1/((1 - (x + y))*(1 - x*y)). - Stefano Spezia, Feb 16 2025
a(n) = Sum_{k=0..floor(n/2)} (-1)^k*binomial(2*n+1-k, n-2*k). - Michael Weselcouch, Jun 17 2025
a(n) = binomial(1+2*n, n)*hypergeom([1, (1-n)/2, -n/2], [-1-2*n, 2+n], 4). - Stefano Spezia, Jun 18 2025

Extensions

Simpler definition from Alexander Adamchuk, Jul 05 2006

A053263 Coefficients of the '5th-order' mock theta function chi_1(q).

Original entry on oeis.org

1, 2, 2, 3, 3, 4, 4, 6, 5, 7, 8, 9, 9, 12, 12, 15, 15, 18, 19, 23, 23, 27, 30, 33, 34, 41, 42, 49, 51, 57, 61, 69, 72, 81, 87, 96, 100, 113, 119, 132, 140, 153, 163, 180, 188, 208, 221, 240, 253, 278, 294, 319, 339, 366, 388, 422, 443, 481, 510, 549, 580, 626, 662
Offset: 0

Views

Author

Dean Hickerson, Dec 19 1999

Keywords

Comments

The rank of a partition is its largest part minus the number of parts.
Number of partitions of n such that 2*(least part) > greatest part. - Clark Kimberling, Feb 16 2014
Also the number of partitions of n with the same median as maximum. These are conjugate to the partitions described above. For minimum instead of maximum we have A361860. - Gus Wiseman, Apr 23 2023

Examples

			From _Gus Wiseman_, Apr 20 2023: (Start)
The a(1) = 1 through a(8) = 6 partitions such that 2*(minimum) > (maximum):
  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
       (11)  (111)  (22)    (32)     (33)      (43)       (44)
                    (1111)  (11111)  (222)     (322)      (53)
                                     (111111)  (1111111)  (332)
                                                          (2222)
                                                          (11111111)
The a(1) = 1 through a(8) = 6 partitions such that (median) = (maximum):
  (1)  (2)   (3)    (4)     (5)      (6)       (7)        (8)
       (11)  (111)  (22)    (221)    (33)      (331)      (44)
                    (1111)  (11111)  (222)     (2221)     (332)
                                     (111111)  (1111111)  (2222)
                                                          (22211)
                                                          (11111111)
(End)
		

References

  • Srinivasa Ramanujan, Collected Papers, Chelsea, New York, 1962, pp. 354-355
  • Srinivasa Ramanujan, The Lost Notebook and Other Unpublished Papers, Narosa Publishing House, New Delhi, 1988, pp. 20, 25

Crossrefs

Other '5th-order' mock theta functions are at A053256, A053257, A053258, A053259, A053260, A053261, A053262, A053264, A053265, A053266, A053267.
A000041 counts integer partitions, strict A000009, odd-length A027193.
A359893 and A359901 count partitions by median.

Programs

  • Mathematica
    1+Series[Sum[q^(2n+1)(1+q^n)/Product[1-q^k, {k, n+1, 2n+1}], {n, 0, 49}], {q, 0, 100}]
    (* Also: *)
    Table[Count[ IntegerPartitions[n], p_ /; 2 Min[p] > Max[p]], {n, 40}]
    (* Clark Kimberling, Feb 16 2014 *)
    nmax = 100; CoefficientList[Series[1 + Sum[x^(2*k+1)*(1+x^k) / Product[1-x^j, {j, k+1, 2*k+1}], {k, 0, Floor[nmax/2]}], {x, 0, nmax}], x] (* Vaclav Kotesovec, Jun 12 2019 *)

Formula

G.f.: chi_1(q) = Sum_{n>=0} q^n/((1-q^(n+1))(1-q^(n+2))...(1-q^(2n+1))).
G.f.: chi_1(q) = 1 + Sum_{n>=0} q^(2n+1) (1+q^n)/((1-q^(n+1))(1-q^(n+2))...(1-q^(2n+1))).
a(n) is twice the number of partitions of 5n+3 with rank == 2 (mod 5) minus number with rank == 0 or 1 (mod 5).
a(n) - 1 is the number of partitions of n with unique smallest part and all other parts <= one plus twice the smallest part.
a(n) ~ sqrt(phi/2) * exp(Pi*sqrt(2*n/15)) / (5^(1/4)*sqrt(n)), where phi = A001622 = (1+sqrt(5))/2 is the golden ratio. - Vaclav Kotesovec, Jun 16 2019

A079309 a(n) = C(1,1) + C(3,2) + C(5,3) + ... + C(2*n-1,n).

Original entry on oeis.org

1, 4, 14, 49, 175, 637, 2353, 8788, 33098, 125476, 478192, 1830270, 7030570, 27088870, 104647630, 405187825, 1571990935, 6109558585, 23782190485, 92705454895, 361834392115, 1413883873975, 5530599237775, 21654401079325, 84859704298201, 332818970772253
Offset: 1

Views

Author

Miklos Kristof, Feb 10 2003

Keywords

Comments

a(n) is the sum of pyramid weights of all Dyck paths of length 2n (for pyramid weight see Denise and Simion). Equivalently, a(n) is the sum of the total lengths of end branches of an ordered tree, summation being over all ordered trees with n edges. For example, the five ordered trees with 3 edges have total lengths of endbranches 3,2,3,3 and 3. - Emeric Deutsch, May 30 2003
a(n) is the number of Motzkin paths of length 2n with exactly one level segment. (A level segment is a maximal sequence of contiguous flatsteps.) Example: for n=2, the paths counted are FFFF, FFUD, UDFF, UFFD. The formula for a(n) below counts these paths by length of the level segment. - David Callan, Jul 15 2004
The inverse Catalan transform yields A024495, shifted once left. - R. J. Mathar, Jul 07 2009
From Paul Barry, Mar 29 2010: (Start)
Hankel transform is A138341.
The aerated sequence 0, 0, 1, 0, 4, 0, 14, 0, 49, ... has e.g.f. int(cosh(x-t)*Bessel_I(1,2t), t = 0..x). (End)
a(n) is the number of terms of A031443 not exceeding 4^n. - Vladimir Shevelev, Oct 01 2010
Also the number of nonempty subsets of {1..2n} with median n, bisection of A361801. The version containing n is A001700 (bisected). Replacing 2n with 2n+1 and n with n+1 gives A006134. For mean instead of median we have A212352. - Gus Wiseman, Apr 16 2023

Examples

			a(4) = C(1,1) + C(3,2) + C(5,3) + C(7,4) = 1 + 3 + 10 + 35 = 49.
G.f. = x + 4*x^2 + 14*x^3 + 49*x^4 + 175*x^5 + 637*x^6 + 2353*x^7 + ...
From _Gus Wiseman_, Apr 16 2023: (Start)
The a(1) = 1 through a(3) = 14 subsets of {1..2n} with median n:
  {1}  {2}      {3}
       {1,3}    {1,5}
       {1,2,3}  {2,4}
       {1,2,4}  {1,3,4}
                {1,3,5}
                {1,3,6}
                {2,3,4}
                {2,3,5}
                {2,3,6}
                {1,2,4,5}
                {1,2,4,6}
                {1,2,3,4,5}
                {1,2,3,4,6}
                {1,2,3,5,6}
(End)
		

Crossrefs

Equals A024718(n) - 1.
This is the even (or odd) bisection of A361801.
A007318 counts subsets by length, A327481 by mean, A013580 by median.
A359893 and A359901 count partitions by median.

Programs

  • Maple
    a := n -> add(binomial(2*j, j)/2, j=1..n): seq(a(n), n=1..24); # Zerinvary Lajos, Oct 25 2006
    a := n -> add(abs(binomial(-j, -2*j)), j=1..n): seq(a(n), n=1..24); # Zerinvary Lajos, Oct 03 2007
    f:= gfun:-rectoproc({n*a(n) +(-5*n+2)*a(n-1) +2*(2*n-1)*a(n-2)=0,a(1)=1,a(2)=4},a(n),remember):
    map(f, [$1..100]); # Robert Israel, Jun 24 2015
  • Mathematica
    Rest[CoefficientList[Series[(1/Sqrt[1-4*x]-1)/(1-x)/2, {x, 0, 20}], x]] (* Vaclav Kotesovec, Feb 13 2014 *)
    Accumulate[Table[Binomial[2n-1,n],{n,30}]] (* Harvey P. Dale, Jan 06 2021 *)
  • PARI
    {a(n) = sum(k=1, n, binomial(2*k - 1, k))}; /* Michael Somos, Feb 14 2006 */
    
  • PARI
    my(x='x+O('x^40)); Vec((1/sqrt(1-4*x)-1)/(1-x)/2) \\ Altug Alkan, Dec 24 2015

Formula

a(n) = (1/2)*(C(2, 1) + C(4, 2) + C(6, 3) + ... + C(2*n, n)) = A066796(n)/2. - Vladeta Jovovic, Feb 12 2003
G.f.: (1/sqrt(1 - 4*x) - 1)/(1 - x)/2. - Vladeta Jovovic, Feb 12 2003
Given g.f. A(x), then x * A(x - x^2) is g.f. of A024495. - Michael Somos, Feb 14 2006
a(n) = A066796(n)/2. - Zerinvary Lajos, Oct 25 2006
a(n) = Sum_{0 <= i <= j <= n} binomial(i+j, i). - Benoit Cloitre, Nov 25 2006
D-finite with recurrence n*a(n) + (-5*n+2)*a(n-1) + 2*(2*n-1)*a(n-2) = 0. - R. J. Mathar, Nov 30 2012
a(n) ~ 2^(2*n+1) / (3*sqrt(Pi*n)). - Vaclav Kotesovec, Feb 13 2014
a(n) = Sum_{k=0..n-1} A001700(k). - Doug Bell, Jun 23 2015
a(n) = -binomial(2*n+1, n)*hypergeom([1, n+3/2], [n+2], 4) - (i/sqrt(3) + 1)/2. - Peter Luschny, May 18 2018
From Gus Wiseman, Apr 18 2023: (Start)
a(n) = A024718(n) - 1.
a(n) = A231147(2n+1,n).
a(n) = A361801(2n) = A361801(2n+1). (End)
a(n) = Sum_{k=0..floor(n/2)} (-1)^k*binomial(2*n+2-k, n-2*k). - Michael Weselcouch, Jun 17 2025
a(n) = binomial(2*(1+n), n)*hypergeom([1, (1-n)/2, -n/2], [-2*(1+n), 3+n], 4). - Stefano Spezia, Jun 18 2025

Extensions

More terms from Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Feb 11 2003

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

Original entry on oeis.org

0, 0, 0, 1, 1, 1, 4, 3, 4, 7, 9, 9, 15, 16, 20, 26, 34, 37, 50, 55, 68, 86, 103, 117, 145, 168, 201, 236, 282, 324, 391, 449, 525, 612, 712, 818, 962, 1106, 1278, 1470, 1698, 1939, 2238, 2550, 2924, 3343, 3824, 4341, 4963, 5627, 6399, 7256, 8231, 9300
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(4) = 1 through a(11) = 9 partitions:
  211  2111  21111  421     422      4221      631        632
                    3211    221111   4311      4222       5321
                    22111   2111111  2211111   42211      5411
                    211111           21111111  322111     42221
                                               2221111    43211
                                               22111111   332111
                                               211111111  22211111
                                                          221111111
                                                          2111111111
For example, the partition (3,2,1,1) has maximum 3 and median 3/2, so is counted under a(7).
		

Crossrefs

For minimum instead of median we have A118096.
For length instead of median we have A237753.
This is the equal case of A361848.
For mean instead of median we have A361853.
These partitions have ranks A361856.
For "greater" instead of "equal" we have A361857, allowing equality A361859.
A000041 counts integer partitions, strict A000009.
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.
A360005 gives twice median of prime indices, distinct A360457.
A361860 counts partitions with minimum equal to median.

Programs

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

A361848 Number of integer partitions of n such that (maximum) <= 2*(median).

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 12, 15, 19, 26, 31, 40, 49, 61, 75, 93, 112, 137, 165, 199, 238, 289, 341, 408, 482, 571, 674, 796, 932, 1096, 1280, 1495, 1738, 2026, 2347, 2724, 3148, 3639, 4191, 4831, 5545, 6372, 7298, 8358, 9552, 10915, 12439, 14176, 16121, 18325
Offset: 0

Views

Author

Gus Wiseman, Mar 28 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(7) = 12 partitions:
  (1)  (2)   (3)    (4)     (5)      (6)       (7)
       (11)  (21)   (22)    (32)     (33)      (43)
             (111)  (31)    (41)     (42)      (52)
                    (211)   (221)    (51)      (61)
                    (1111)  (2111)   (222)     (322)
                            (11111)  (321)     (331)
                                     (2211)    (421)
                                     (21111)   (2221)
                                     (111111)  (3211)
                                               (22111)
                                               (211111)
                                               (1111111)
For example, the partition y = (3,2,2) has maximum 3 and median 2, and 3 <= 2*2, so y is counted under a(7).
		

Crossrefs

For length instead of median we have A237755.
For minimum instead of median we have A237824.
The equal case is A361849, ranks A361856.
For mean instead of median we have A361851.
The complement is counted by A361857, ranks A361867.
The unequal case is A361858.
Reversing the inequality gives A361859, ranks A361868.
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],Max@@#<=2*Median[#]&]],{n,30}]

Formula

a(n) = A361849(n) + A361858(n).
a(n) = A000041(n) - A361857(n).

A231147 Array of coefficients of numerator polynomials of the rational function p(n, x + 1/x), where p(n,x) = (x^n - 1)/(x - 1).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 3, 1, 1, 1, 1, 4, 3, 4, 1, 1, 1, 1, 5, 4, 9, 4, 5, 1, 1, 1, 1, 6, 5, 14, 9, 14, 5, 6, 1, 1, 1, 1, 7, 6, 20, 14, 29, 14, 20, 6, 7, 1, 1, 1, 1, 8, 7, 27, 20, 49, 29, 49, 20, 27, 7, 8, 1, 1, 1, 1, 9, 8, 35, 27, 76, 49, 99, 49, 76, 27, 35, 8, 9
Offset: 1

Views

Author

Clark Kimberling, Nov 05 2013

Keywords

Comments

From Gus Wiseman, Mar 19 2023: (Start)
Also appears to be the number of nonempty subsets of {1,...,n} with median k, where k ranges from 1 to n in steps of 1/2, and the median of a multiset is either the middle part (for odd length), or the average of the two middle parts (for even length). For example, row n = 5 counts the following subsets:
{1} {1,2} {2} {1,4} {3} {2,5} {4} {4,5} {5}
{1,3} {2,3} {1,5} {3,4} {3,5}
{1,2,3} {1,2,3,4} {2,4} {1,3,4,5} {1,4,5}
{1,2,4} {1,2,3,5} {1,3,4} {2,3,4,5} {2,4,5}
{1,2,5} {1,3,5} {3,4,5}
{2,3,4}
{2,3,5}
{1,2,4,5}
{1,2,3,4,5}
Central diagonals T(n,(n+1)/2) appear to be A100066 (bisection A006134).
For mean instead of median we have A327481.
For partitions instead of subsets we have A359893, full steps A359901.
Central diagonals T(n,n/2) are A361801 (bisection A079309).
(End)

Examples

			Triangle begins:
  1
  1  1  1
  1  1  3  1  1
  1  1  4  3  4  1  1
  1  1  5  4  9  4  5  1  1
  1  1  6  5 14  9 14  5  6  1  1
  1  1  7  6 20 14 29 14 20  6  7  1  1
  1  1  8  7 27 20 49 29 49 20 27  7  8  1  1
  1  1  9  8 35 27 76 49 99 49 76 27 35  8  9  1  1
First 3 polynomials: 1, 1 + x + x^2, 1 + x + 3*x^2 + x^3 + x^4
		

Crossrefs

Cf. A231148.
Row sums are 2^n-1 = A000225(n).
Row lengths are 2n-1 = A005408(n-1).
Removing every other column appears to give A013580.

Programs

  • Mathematica
    z = 60; p[n_, x_] := p[x] = (x^n - 1)/(x - 1); Table[p[n, x], {n, 1, z/4}]; f1[n_, x_] := f1[n, x] = Numerator[Factor[p[n, x] /. x -> x + 1/x]]; Table[Expand[f1[n, x]], {n, 0, z/4}]
    Flatten[Table[CoefficientList[f1[n, x], x], {n, 1, z/4}]]
  • PARI
    A231147_row(n) = {Vecrev(Vec(numerator((-1+(x+(1/x))^n)/(x+(1/x)-1))))} \\ John Tyler Rascoe, Sep 10 2024

A361801 Number of nonempty subsets of {1..n} with median n/2.

Original entry on oeis.org

0, 0, 1, 1, 4, 4, 14, 14, 49, 49, 175, 175, 637, 637, 2353, 2353, 8788, 8788, 33098, 33098, 125476, 125476, 478192, 478192, 1830270, 1830270, 7030570, 7030570, 27088870, 27088870, 104647630, 104647630, 405187825, 405187825, 1571990935, 1571990935
Offset: 0

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 subset {1,2,3,5} of {1..5} has median 5/2, so is counted under a(5).
The subset {2,3,5} of {1..6} has median 6/2, so is counted under a(6).
The a(0) = 0 through a(7) = 14 subsets:
  .  .  {1}  {1,2}  {2}      {1,4}      {3}          {1,6}
                    {1,3}    {2,3}      {1,5}        {2,5}
                    {1,2,3}  {1,2,3,4}  {2,4}        {3,4}
                    {1,2,4}  {1,2,3,5}  {1,3,4}      {1,2,5,6}
                                        {1,3,5}      {1,2,5,7}
                                        {1,3,6}      {1,3,4,5}
                                        {2,3,4}      {1,3,4,6}
                                        {2,3,5}      {1,3,4,7}
                                        {2,3,6}      {2,3,4,5}
                                        {1,2,4,5}    {2,3,4,6}
                                        {1,2,4,6}    {2,3,4,7}
                                        {1,2,3,4,5}  {1,2,3,4,5,6}
                                        {1,2,3,4,6}  {1,2,3,4,5,7}
                                        {1,2,3,5,6}  {1,2,3,4,6,7}
		

Crossrefs

A bisection is A079309.
The case with n's has bisection A057552.
The case without n's is A100066, bisection A006134.
A central diagonal of A231147.
A version for partitions is A361849.
For mean instead of median we have A362046.
A000975 counts subsets with integer median, for mean A327475.
A007318 counts subsets by length.
A013580 appears to count subsets by median, by mean A327481.
A360005(n)/2 represents the median statistic for partitions.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Median[#]==n/2&]],{n,0,10}]

Formula

a(n) = A079309(floor(n/2)). - Alois P. Heinz, Apr 11 2023

A362046 Number of nonempty subsets of {1..n} with mean n/2.

Original entry on oeis.org

0, 0, 1, 1, 3, 3, 9, 8, 25, 23, 75, 68, 235, 213, 759, 695, 2521, 2325, 8555, 7941, 29503, 27561, 103129, 96861, 364547, 344003, 1300819, 1232566, 4679471, 4449849, 16952161, 16171117, 61790441, 59107889, 226451035, 217157068, 833918839, 801467551, 3084255127
Offset: 0

Views

Author

Gus Wiseman, Apr 12 2023

Keywords

Examples

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

Crossrefs

Using range 0..n gives A070925.
Including the empty set gives A133406.
Even bisection is A212352.
For median instead of mean we have A361801, the doubling of A079309.
A version for partitions is A361853, for median A361849.
A000980 counts nonempty subsets of {1..2n-1} with mean n.
A007318 counts subsets by length.
A067538 counts partitions with integer mean, strict A102627.
A231147 appears to count subsets by median, full-steps A013580.
A327475 counts subsets with integer mean, A000975 integer median.
A327481 counts subsets by integer mean.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[n]],Mean[#]==n/2&]],{n,0,15}]

Formula

a(n) = (A070925(n) - 1)/2.
a(n) = A133406(n) - 1.
a(2n) = A212352(n) = A000980(n)/2 - 1.

A361654 Triangle read by rows where T(n,k) is the number of nonempty subsets of {1,...,2n-1} with median n and minimum k.

Original entry on oeis.org

1, 2, 1, 5, 3, 1, 15, 9, 4, 1, 50, 29, 14, 5, 1, 176, 99, 49, 20, 6, 1, 638, 351, 175, 76, 27, 7, 1, 2354, 1275, 637, 286, 111, 35, 8, 1, 8789, 4707, 2353, 1078, 441, 155, 44, 9, 1, 33099, 17577, 8788, 4081, 1728, 650, 209, 54, 10, 1
Offset: 1

Views

Author

Gus Wiseman, Mar 23 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

			Triangle begins:
     1
     2     1
     5     3     1
    15     9     4     1
    50    29    14     5     1
   176    99    49    20     6     1
   638   351   175    76    27     7     1
  2354  1275   637   286   111    35     8     1
  8789  4707  2353  1078   441   155    44     9     1
Row n = 4 counts the following subsets:
  {1,7}            {2,6}        {3,5}    {4}
  {1,4,5}          {2,4,5}      {3,4,5}
  {1,4,6}          {2,4,6}      {3,4,6}
  {1,4,7}          {2,4,7}      {3,4,7}
  {1,2,6,7}        {2,3,5,6}
  {1,3,5,6}        {2,3,5,7}
  {1,3,5,7}        {2,3,4,5,6}
  {1,2,4,5,6}      {2,3,4,5,7}
  {1,2,4,5,7}      {2,3,4,6,7}
  {1,2,4,6,7}
  {1,3,4,5,6}
  {1,3,4,5,7}
  {1,3,4,6,7}
  {1,2,3,5,6,7}
  {1,2,3,4,5,6,7}
		

Crossrefs

Row sums appear to be A006134.
Column k = 1 appears to be A024718.
Column k = 2 appears to be A006134.
Column k = 3 appears to be A079309.
A000975 counts subsets with integer median, mean A327475.
A007318 counts subsets by length.
A231147 counts subsets by median, full steps A013580, by mean A327481.
A359893 and A359901 count partitions by median.
A360005(n)/2 gives the median statistic.

Programs

  • Mathematica
    Table[Length[Select[Subsets[Range[2n-1]],Min@@#==k&&Median[#]==n&]],{n,6},{k,n}]
  • PARI
    T(n,k) = sum(j=0, n-k, binomial(2*j+k-2, j)) \\ Andrew Howroyd, Apr 09 2023

Formula

T(n,k) = 1 + Sum_{j=1..n-k} binomial(2*j+k-2, j). - Andrew Howroyd, Apr 09 2023
Showing 1-10 of 25 results. Next