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

A011782 Coefficients of expansion of (1-x)/(1-2*x) in powers of x.

Original entry on oeis.org

1, 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, 268435456, 536870912, 1073741824, 2147483648, 4294967296, 8589934592
Offset: 0

Views

Author

Lee D. Killough (killough(AT)wagner.convex.com)

Keywords

Comments

Apart from initial term, same as A000079 (powers of 2).
Number of compositions (ordered partitions) of n. - Toby Bartels, Aug 27 2003
Number of ways of putting n unlabeled items into (any number of) labeled boxes where every box contains at least one item. Also "unimodal permutations of n items", i.e., those which rise then fall. (E.g., for three items: ABC, ACB, BCA and CBA are unimodal.) - Henry Bottomley, Jan 17 2001
Number of permutations in S_n avoiding the patterns 213 and 312. - Tuwani Albert Tshifhumulo, Apr 20 2001. More generally (see Simion and Schmidt), the number of permutations in S_n avoiding (i) the 123 and 132 patterns; (ii) the 123 and 213 patterns; (iii) the 132 and 213 patterns; (iv) the 132 and 231 patterns; (v) the 132 and 312 patterns; (vi) the 213 and 231 patterns; (vii) the 213 and 312 patterns; (viii) the 231 and 312 patterns; (ix) the 231 and 321 patterns; (x) the 312 and 321 patterns.
a(n+2) is the number of distinct Boolean functions of n variables under action of symmetric group.
Number of unlabeled (1+2)-free posets. - Detlef Pauly, May 25 2003
Image of the central binomial coefficients A000984 under the Riordan array ((1-x), x*(1-x)). - Paul Barry, Mar 18 2005
Binomial transform of (1, 0, 1, 0, 1, 0, 1, 0, 1, 0, ...); inverse binomial transform of A007051. - Philippe Deléham, Jul 04 2005
Also, number of rationals in [0, 1) whose binary expansions terminate after n bits. - Brad Chalfan, May 29 2006
Equals row sums of triangle A144157. - Gary W. Adamson, Sep 12 2008
Prepend A089067 with a 1, getting (1, 1, 3, 5, 13, 23, 51, ...) as polcoeff A(x); then (1, 1, 2, 4, 8, 16, ...) = A(x)/A(x^2). - Gary W. Adamson, Feb 18 2010
An elephant sequence, see A175655. For the central square four A[5] vectors, with decimal values 2, 8, 32 and 128, lead to this sequence. For the corner squares these vectors lead to the companion sequence A094373. - Johannes W. Meijer, Aug 15 2010
From Paul Curtz, Jul 20 2011: (Start)
Array T(m,n) = 2*T(m,n-1) + T(m-1,n):
1, 1, 2, 4, 8, 16, ... = a(n)
1, 3, 8, 20, 48, 112, ... = A001792,
1, 5, 18, 56, 160, 432, ... = A001793,
1, 7, 32, 120, 400, 1232, ... = A001794,
1, 9, 50, 220, 840, 2912, ... = A006974, followed with A006975, A006976, gives nonzero coefficients of Chebyshev polynomials of first kind A039991 =
1,
1, 0,
2, 0, -1,
4, 0, -3, 0,
8, 0, -8, 0, 1.
T(m,n) third vertical: 2*n^2, n positive (A001105).
Fourth vertical appears in Janet table even rows, last vertical (A168342 array, A138509, rank 3, 13, = A166911)). (End)
A131577(n) and differences are:
0, 1, 2, 4, 8, 16,
1, 1, 2, 4, 8, 16, = a(n),
0, 1, 2, 4, 8, 16,
1, 1, 2, 4, 8, 16.
Number of 2-color necklaces of length 2n equal to their complemented reversal. For length 2n+1, the number is 0. - David W. Wilson, Jan 01 2012
Edges and also central terms of triangle A198069: a(0) = A198069(0,0) and for n > 0: a(n) = A198069(n,0) = A198069(n,2^n) = A198069(n,2^(n-1)). - Reinhard Zumkeller, May 26 2013
These could be called the composition numbers (see the second comment) since the equivalent sequence for partitions is A000041, the partition numbers. - Omar E. Pol, Aug 28 2013
Number of self conjugate integer partitions with exactly n parts for n>=1. - David Christopher, Aug 18 2014
The sequence is the INVERT transform of (1, 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, ...). - Gary W. Adamson, Jul 16 2015
Number of threshold graphs on n nodes [Hougardy]. - Falk Hüffner, Dec 03 2015
Number of ternary words of length n in which binary subwords appear in the form 10...0. - Milan Janjic, Jan 25 2017
a(n) is the number of words of length n over an alphabet of two letters, of which one letter appears an even number of times (the empty word of length 0 is included). See the analogous odd number case in A131577, and the Balakrishnan reference in A006516 (the 4-letter odd case), pp. 68-69, problems 2.66, 2.67 and 2.68. - Wolfdieter Lang, Jul 17 2017
Number of D-equivalence classes of Łukasiewicz paths. Łukasiewicz paths are D-equivalent iff the positions of pattern D are identical in these paths. - Sergey Kirgizov, Apr 08 2018
Number of color patterns (set partitions) for an oriented row of length n using two or fewer colors (subsets). Two color patterns are equivalent if we permute the colors. For a(4)=8, the 4 achiral patterns are AAAA, AABB, ABAB, and ABBA; the 4 chiral patterns are the 2 pairs AAAB-ABBB and AABA-ABAA. - Robert A. Russell, Oct 30 2018
The determinant of the symmetric n X n matrix M defined by M(i,j) = (-1)^max(i,j) for 1 <= i,j <= n is equal to a(n) * (-1)^(n*(n+1)/2). - Bernard Schott, Dec 29 2018
For n>=1, a(n) is the number of permutations of length n whose cyclic representations can be written in such a way that when the cycle parentheses are removed what remains is 1 through n in natural order. For example, a(4)=8 since there are exactly 8 permutations of this form, namely, (1 2 3 4), (1)(2 3 4), (1 2)(3 4), (1 2 3)(4), (1)(2)(3 4), (1)(2 3)(4), (1 2)(3)(4), and (1)(2)(3)(4). Our result follows readily by conditioning on k, the number of parentheses pairs of the form ")(" in the cyclic representation. Since there are C(n-1,k) ways to insert these in the cyclic representation and since k runs from 0 to n-1, we obtain a(n) = Sum_{k=0..n-1} C(n-1,k) = 2^(n-1). - Dennis P. Walsh, May 23 2020
Maximum number of preimages that a permutation of length n + 1 can have under the consecutive-231-avoiding stack-sorting map. - Colin Defant, Aug 28 2020
a(n) is the number of occurrences of the empty set {} in the von Neumann ordinals from 0 up to n. Each ordinal k is defined as the set of all smaller ordinals: 0 = {}, 1 = {0}, 2 = {0,1}, etc. Since {} is the foundational element of all ordinals, the total number of times it appears grows as powers of 2. - Kyle Wyonch, Mar 30 2025

Examples

			G.f. = 1 + x + 2*x^2 + 4*x^3 + 8*x^4 + 16*x^5 + 32*x^6 + 64*x^7 + 128*x^8 + ...
    ( -1   1  -1)
det (  1   1   1)  = 4
    ( -1  -1  -1)
		

References

  • Mohammad K. Azarian, A Generalization of the Climbing Stairs Problem, Mathematics and Computer Education Journal, Vol. 31, No. 1, pp. 24-28, Winter 1997.
  • S. Kitaev, Patterns in Permutations and Words, Springer-Verlag, 2011. see p. 399 Table A.7
  • Xavier Merlin, Methodix Algèbre, Ellipses, 1995, p. 153.

Crossrefs

Sequences with g.f.'s of the form ((1-x)/(1-2*x))^k: this sequence (k=1), A045623 (k=2), A058396 (k=3), A062109 (k=4), A169792 (k=5), A169793 (k=6), A169794 (k=7), A169795 (k=8), A169796 (k=9), A169797 (k=10).
Cf. A005418 (unoriented), A122746(n-3) (chiral), A016116 (achiral).
Row sums of triangle A100257.
A row of A160232.
Row 2 of A278984.

Programs

  • Haskell
    a011782 n = a011782_list !! n
    a011782_list = 1 : scanl1 (+) a011782_list
    -- Reinhard Zumkeller, Jul 21 2013
    
  • Magma
    [Floor((1+2^n)/2): n in [0..35]]; // Vincenzo Librandi, Aug 21 2011
    
  • Maple
    A011782:= n-> ceil(2^(n-1)): seq(A011782(n), n=0..50); # Wesley Ivan Hurt, Feb 21 2015
    with(PolynomialTools):  A011782:=seq(coeftayl((1-x)/(1-2*x), x = 0, k),k=0..10^2); # Muniru A Asiru, Sep 26 2017
  • Mathematica
    f[s_] := Append[s, Ceiling[Plus @@ s]]; Nest[f, {1}, 32] (* Robert G. Wilson v, Jul 07 2006 *)
    CoefficientList[ Series[(1-x)/(1-2x), {x, 0, 32}], x] (* Robert G. Wilson v, Jul 07 2006 *)
    Table[Sum[StirlingS2[n, k], {k,0,2}], {n, 0, 30}] (* Robert A. Russell, Apr 25 2018 *)
    Join[{1},NestList[2#&,1,40]] (* Harvey P. Dale, Dec 06 2018 *)
  • PARI
    {a(n) = if( n<1, n==0, 2^(n-1))};
    
  • PARI
    Vec((1-x)/(1-2*x) + O(x^30)) \\ Altug Alkan, Oct 31 2015
    
  • Python
    def A011782(n): return 1 if n == 0 else 2**(n-1) # Chai Wah Wu, May 11 2022
  • Sage
    [sum(stirling_number2(n,j) for j in (0..2)) for n in (0..35)] # G. C. Greubel, Jun 02 2020
    

Formula

a(0) = 1, a(n) = 2^(n-1).
G.f.: (1 - x) / (1 - 2*x) = 1 / (1 - x / (1 - x)). - Michael Somos, Apr 18 2012
E.g.f.: cosh(z)*exp(z) = (exp(2*z) + 1)/2.
a(0) = 1 and for n>0, a(n) = sum of all previous terms.
a(n) = Sum_{k=0..n} binomial(n, 2*k). - Paul Barry, Feb 25 2003
a(n) = Sum_{k=0..n} binomial(n,k)*(1+(-1)^k)/2. - Paul Barry, May 27 2003
a(n) = floor((1+2^n)/2). - Toby Bartels (toby+sloane(AT)math.ucr.edu), Aug 27 2003
G.f.: Sum_{i>=0} x^i/(1-x)^i. - Jon Perry, Jul 10 2004
a(n) = Sum_{k=0..n} (-1)^(n-k)*binomial(k+1, n-k)*binomial(2*k, k). - Paul Barry, Mar 18 2005
a(n) = Sum_{k=0..floor(n/2)} A055830(n-k, k). - Philippe Deléham, Oct 22 2006
a(n) = Sum_{k=0..n} A098158(n,k). - Philippe Deléham, Dec 04 2006
G.f.: 1/(1 - (x + x^2 + x^3 + ...)). - Geoffrey Critzer, Aug 30 2008
a(n) = A000079(n) - A131577(n).
a(n) = A173921(A000079(n)). - Reinhard Zumkeller, Mar 04 2010
a(n) = Sum_{k=2^n..2^(n+1)-1} A093873(k)/A093875(k), sums of rows of the full tree of Kepler's harmonic fractions. - Reinhard Zumkeller, Oct 17 2010
E.g.f.: (exp(2*x)+1)/2 = (G(0) + 1)/2; G(k) = 1 + 2*x/(2*k+1 - x*(2*k+1)/(x + (k+1)/G(k+1))); (continued fraction). - Sergei N. Gladkovskii, Dec 03 2011
A051049(n) = p(n+1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n. - Michael Somos, Apr 18 2012
A008619(n) = p(-1) where p(x) is the unique degree-n polynomial such that p(k) = a(k) for k = 0, 1, ..., n. - Michael Somos, Apr 18 2012
INVERT transform is A122367. MOBIUS transform is A123707. EULER transform of A059966. PSUM transform is A000079. PSUMSIGN transform is A078008. BINOMIAL transform is A007051. REVERT transform is A105523. A002866(n) = a(n)*n!. - Michael Somos, Apr 18 2012
G.f.: U(0), where U(k) = 1 + x*(k+3) - x*(k+2)/U(k+1); (continued fraction, 1-step). - Sergei N. Gladkovskii, Oct 10 2012
a(n) = A000041(n) + A056823(n). - Omar E. Pol, Aug 31 2013
E.g.f.: E(0), where E(k) = 1 + x/( 2*k+1 - x/E(k+1) ); (continued fraction). - Sergei N. Gladkovskii, Dec 25 2013
G.f.: 1 + x/(1 + x)*( 1 + 3*x/(1 + 3*x)*( 1 + 5*x/(1 + 5*x)*( 1 + 7*x/(1 + 7*x)*( 1 + ... )))). - Peter Bala, May 27 2017
a(n) = Sum_{k=0..2} stirling2(n, k).
G.f.: Sum_{j=0..k} A248925(k,j)*x^j / Product_{j=1..k} 1-j*x with k=2. - Robert A. Russell, Apr 25 2018
a(n) = A053120(n, n), n >= 0, (main diagonal of triangle of Chebyshev's T polynomials). - Wolfdieter Lang, Nov 26 2019

Extensions

Additional comments from Emeric Deutsch, May 14 2001
Typo corrected by Philippe Deléham, Oct 25 2008

A000051 a(n) = 2^n + 1.

Original entry on oeis.org

2, 3, 5, 9, 17, 33, 65, 129, 257, 513, 1025, 2049, 4097, 8193, 16385, 32769, 65537, 131073, 262145, 524289, 1048577, 2097153, 4194305, 8388609, 16777217, 33554433, 67108865, 134217729, 268435457, 536870913, 1073741825, 2147483649, 4294967297, 8589934593
Offset: 0

Views

Author

Keywords

Comments

Same as Pisot sequence L(2,3).
Length of the continued fraction for Sum_{k=0..n} 1/3^(2^k). - Benoit Cloitre, Nov 12 2003
See also A004119 for a(n) = 2a(n-1)-1 with first term = 1. - Philippe Deléham, Feb 20 2004
From the second term on (n>=1), in base 2, these numbers present the pattern 1000...0001 (with n-1 zeros), which is the "opposite" of the binary 2^n-2: (0)111...1110 (cf. A000918). - Alexandre Wajnberg, May 31 2005
Let A be the Hessenberg matrix of order n, defined by: A[1,j]=1, A[i,i]:=5, (i>1), A[i,i-1]=-1, and A[i,j]=0 otherwise. Then, for n>=1, a(n-1)=(-1)^(n-1)* charpoly(A,3). - Milan Janjic, Jan 27 2010
First differences of A006127. - Reinhard Zumkeller, Apr 14 2011
The odd prime numbers in this sequence form A019434, the Fermat primes. - David W. Wilson, Nov 16 2011
Pisano period lengths: 1, 1, 2, 1, 4, 2, 3, 1, 6, 4, 10, 2, 12, 3, 4, 1, 8, 6, 18, 4, ... . - R. J. Mathar, Aug 10 2012
Is the mentioned Pisano period lengths (see above) the same as A007733? - Omar E. Pol, Aug 10 2012
Only positive integers that are not 1 mod (2k+1) for any k>1. - Jon Perry, Oct 16 2012
For n >= 1, a(n) is the total length of the segments of the Hilbert curve after n iterations. - Kival Ngaokrajang, Mar 30 2014
Frénicle de Bessy (1657) proved that a(3) = 9 is the only square in this sequence. - Charles R Greathouse IV, May 13 2014
a(n) is the number of distinct possible sums made with at most two elements in {1,...,a(n-1)} for n > 0. - Derek Orr, Dec 13 2014
For n > 0, given any set of a(n) lattice points in R^n, there exist 2 distinct members in this set whose midpoint is also a lattice point. - Melvin Peralta, Jan 28 2017
Also the number of independent vertex sets, irredundant sets, and vertex covers in the (n+1)-star graph. - Eric W. Weisstein, Aug 04 and Sep 21 2017
Also the number of maximum matchings in the 2(n-1)-crossed prism graph. - Eric W. Weisstein, Dec 31 2017
Conjecture: For any integer n >= 0, a(n) is the permanent of the (n+1) X (n+1) matrix with M(j, k) = -floor((j - k - 1)/(n + 1)). This conjecture is inspired by the conjecture of Zhi-Wei Sun in A036968. - Peter Luschny, Sep 07 2021

References

  • Paul Bachmann, Niedere Zahlentheorie (1902, 1910), reprinted Chelsea, NY, 1968, vol. 2, p. 75.
  • Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 46, 60, 244.
  • 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).
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 1999, page 141.

Crossrefs

Apart from the initial 1, identical to A094373.
See A008776 for definitions of Pisot sequences.
Column 2 of array A103438.
Cf. A007583 (a((n-1)/2)/3 for odd n).

Programs

  • Haskell
    a000051 = (+ 1) . a000079
    a000051_list = iterate ((subtract 1) . (* 2)) 2
    -- Reinhard Zumkeller, May 03 2012
    
  • Magma
    [2^n+1: n in [0..40]]; // G. C. Greubel, Jan 18 2025
  • Maple
    A000051:=-(-2+3*z)/(2*z-1)/(z-1); # Simon Plouffe in his 1992 dissertation
    a := n -> add(binomial(n,k)*bernoulli(n-k,1)*2^(k+1)/(k+1),k=0..n); # Peter Luschny, Apr 20 2009
  • Mathematica
    Table[2^n + 1, {n,0,40}]
    2^Range[0,40] + 1 (* Eric W. Weisstein, Jul 17 2017 *)
    LinearRecurrence[{3, -2}, {2, 3}, 40] (* Eric W. Weisstein, Sep 21 2017 *)
  • PARI
    a(n)=2^n+1
    
  • PARI
    first(n) = Vec((2 - 3*x)/((1 - x)*(1 - 2*x)) + O(x^n)) \\ Iain Fox, Dec 31 2017
    
  • Python
    def A000051(n): return (1<Chai Wah Wu, Dec 21 2022
    

Formula

a(n) = 2*a(n-1) - 1 = 3*a(n-1) - 2*a(n-2).
G.f.: (2-3*x)/((1-x)*(1-2*x)).
First differences of A052944. - Emeric Deutsch, Mar 04 2004
a(0) = 1, then a(n) = (Sum_{i=0..n-1} a(i)) - (n-2). - Gerald McGarvey, Jul 10 2004
Inverse binomial transform of A007689. Also, V sequence in Lucas sequence L(3, 2). - Ross La Haye, Feb 07 2005
a(n) = A127904(n+1) for n>0. - Reinhard Zumkeller, Feb 05 2007
Equals binomial transform of [2, 1, 1, 1, ...]. - Gary W. Adamson, Apr 23 2008
a(n) = A000079(n)+1. - Omar E. Pol, May 18 2008
E.g.f.: exp(x) + exp(2*x). - Mohammad K. Azarian, Jan 02 2009
a(n) = A024036(n)/A000225(n). - Reinhard Zumkeller, Feb 14 2009
From Peter Luschny, Apr 20 2009: (Start)
A weighted binomial sum of the Bernoulli numbers A027641/A027642 with A027641(1)=1 (which amounts to the definition B_{n} = B_{n}(1)).
a(n) = Sum_{k=0..n} C(n,k)*B_{n-k}*2^(k+1)/(k+1). (See also A052584.) (End)
a(n) is the a(n-1)-th odd number for n >= 1. - Jaroslav Krizek, Apr 25 2009
From Reinhard Zumkeller, Feb 28 2010: (Start)
a(n)*A000225(n) = A000225(2*n).
a(n) = A173786(n,0). (End)
If p[i]=Fibonacci(i-4) and if A is the Hessenberg matrix of order n defined by: A[i,j]=p[j-i+1], (i<=j), A[i,j]=-1, (i=j+1), and A[i,j]=0 otherwise, then, for n>=1, a(n-1)= det A. - Milan Janjic, May 08 2010
a(n+2) = a(n) + a(n+1) + A000225(n). - Ivan N. Ianakiev, Jun 24 2012
a(A006521(n)) mod A006521(n) = 0. - Reinhard Zumkeller, Jul 17 2014
a(n) = 3*A007583((n-1)/2) for n odd. - Eric W. Weisstein, Jul 17 2017
Sum_{n>=0} 1/a(n) = A323482. - Amiram Eldar, Nov 11 2020

A006127 a(n) = 2^n + n.

Original entry on oeis.org

1, 3, 6, 11, 20, 37, 70, 135, 264, 521, 1034, 2059, 4108, 8205, 16398, 32783, 65552, 131089, 262162, 524307, 1048596, 2097173, 4194326, 8388631, 16777240, 33554457, 67108890, 134217755, 268435484, 536870941, 1073741854, 2147483679, 4294967328, 8589934625
Offset: 0

Views

Author

Keywords

Comments

For numbers m=n+2^n such that equation x=2^(m-x) has solution x=2^n, see A103354. - Zak Seidov, Mar 23 2005
Primes of the form x^x+1 must be of the form 2^2^(a(n))+1, that is, Fermat number F_(a(n)) (Sierpiński 1958). - David W. Wilson, May 08 2005
a(n) = n-th Mersenne number + n + 1 = A000225(n) + n + 1. Partial sums of a(n) are A132925(n+1). - Jaroslav Krizek, Oct 16 2009
Intersection of A188916 and A188917: A188915(a(n)) = (2^n)^2 = 2^(2*n) = A000302(n). - Reinhard Zumkeller, Apr 14 2011
a(n) is also the number of all connected subtrees of a star tree, having n leaves. The star tree is a tree, where all n leaves are connected to one parent P. - Viktar Karatchenia, Feb 29 2016

Examples

			From _Viktar Karatchenia_, Feb 29 2016: (Start)
a(0) = 1. There are n=0 leaves, it is a trivial tree consisting of a single parent node P.
a(1) = 3. There is n=1 leaf, the tree is P-A, the subtrees are: 2 singles: P, A; 1 pair: P-A; 2+1 = 3 subtrees in total.
a(2) = 6. When n=2, the tree is P-A P-B, the subtrees are: 3 singles: P, A, B; 2 pairs: P-A, P-B; 1 triple: A-P-B (the whole tree); 3+2+1 = 6.
a(3) = 11. For n=3 leaf nodes, the tree is P-A P-B P-C, the subtrees are: 4 singles: P, A, B, C; 3 pairs: P-A, P-B, P-C; 3 triples: A-P-B, A-P-C, B-P-C; 1 quad: P-A P-B P-C (the whole tree); 4+3+3+1 = 11 in total.
a(4) = 20. For n=4 leaves, the tree is P-A P-B P-C P-D, the subtrees are: 5 singles: P, A, B, C, D; 4 pairs: P-A, P-B, P-C, P-D; 6 triples: A-P-B, A-P-C, B-P-C, A-P-D, B-P-D, C-P-D; 4 quads: P-A P-B P-C, P-A P-B P-D, P-A P-C P-D, P-B P-C P-D; the whole tree counts as 1; 5+4+6+4+1 = 20.
In general, for n leaves, connected to the parent node P, there will be: (n+1) singles; (n, 1) pairs; (n, 2) triples; (n, 3) quads; ... ; (n, n-1) subtrees having (n-1) edges; 1 whole tree, having all n edges. Thus, the total number of all distinct subtrees is: (n+1) + (n, 1) + (n, 2) + (n, 3) + ... + (n, n-1) + 1 = (n + (n, 0)) + (n, 1) + (n, 2) + (n, 3) + ... + (n, n-1) + (n, n) = n + (sum of all binomial coefficients of size n) = n + (2^n). (End)
		

References

  • John H. Conway, R. K. Guy, The Book of Numbers, Copernicus Press, p. 84.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A135227, A000079, A052944; A000051 (first differences).
Cf. A000325.

Programs

  • Haskell
    a006127 n = a000079 n + n
    a006127_list = s [1] where
       s xs = last xs : (s $ zipWith (+) [1..] (xs ++ reverse xs))
    Reinhard Zumkeller, May 19 2015, Feb 05 2011
    
  • Maple
    A006127:=(-1+z+z**2)/(2*z-1)/(z-1)**2; # conjectured by Simon Plouffe in his 1992 dissertation
  • Mathematica
    Table[2^n + n, {n, 0, 50}] (* Vladimir Joseph Stephan Orlovsky, May 19 2011 *)
    Table[BitXOr(i, 2^i), {i, 1, 100}] (* Peter Luschny, Jun 01 2011 *)
    LinearRecurrence[{4,-5,2},{1,3,6},40] (* Harvey P. Dale, Feb 08 2023 *)
  • PARI
    a(n)=1<Charles R Greathouse IV, Jul 19 2011
    
  • Python
    print([2**n + n for n in range(34)]) # Karl V. Keller, Jr., Aug 18 2020
    
  • Python
    def A006127(n): return (1<Chai Wah Wu, Jan 11 2023

Formula

Row sums of triangle A135227. - Gary W. Adamson, Nov 23 2007
Partial sums of A094373. G.f.: (1-x-x^2)/((1-x)^2(1-2x)). - Paul Barry, Aug 05 2004
Binomial transform of [1,2,1,1,1,1,1,...]. - Franklin T. Adams-Watters, Nov 29 2006
a(n) = 2*a(n-1) - n + 2 (with a(0)=1). - Vincenzo Librandi, Dec 30 2010
E.g.f.: exp(x)*(exp(x) + x). - Stefano Spezia, Dec 10 2021

A048645 Integers with one or two 1-bits in their binary expansion.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 16, 17, 18, 20, 24, 32, 33, 34, 36, 40, 48, 64, 65, 66, 68, 72, 80, 96, 128, 129, 130, 132, 136, 144, 160, 192, 256, 257, 258, 260, 264, 272, 288, 320, 384, 512, 513, 514, 516, 520, 528, 544, 576, 640, 768, 1024, 1025, 1026, 1028, 1032
Offset: 1

Views

Author

Antti Karttunen, Jul 14 1999

Keywords

Comments

Apart from initial 1, sums of two not necessarily distinct powers of 2.
4 does not divide C(2s-1,s) (= A001700[ s ]) if and only if s=a(n).
Possible number of sides of a regular polygon such that there exists a triangulation where each triangle is isosceles. - Sen-peng Eu, May 07 2008
Also numbers n such that n!/2^(n-2) is an integer. - Michel Lagneau, Mar 28 2011
It appears these are also the indices of the terms that are shared by the cellular automata of A147562, A162795, A169707. - Omar E. Pol, Feb 21 2015
Numbers with binary weight 1 or 2. - Omar E. Pol, Feb 22 2015

Examples

			From _Omar E. Pol_, Feb 18 2015: (Start)
Also, written as a triangle T(j,k), k >= 1, in which row lengths are the terms of A028310:
   1;
   2;
   3,  4;
   5,  6,  8;
   9, 10, 12, 16;
  17, 18, 20, 24, 32;
  33, 34, 36, 40, 48, 64;
  65, 66, 68, 72, 80, 96, 128;
  ...
It appears that column 1 is A094373.
It appears that the right border gives A000079.
It appears that the first differences in every row that contains at least two terms give the first h-1 powers of 2, where h is the length of the row.
(End)
		

Crossrefs

Programs

  • Haskell
    import Data.List (insert)
    a048645 n k = a048645_tabl !! (n-1) !! (k-1)
    a048645_row n = a048645_tabl !! (n-1)
    a048645_tabl = iterate (\xs -> insert (2 * head xs + 1) $ map ((* 2)) xs) [1]
    a048645_list = concat a048645_tabl
    -- Reinhard Zumkeller, Dec 19 2012
    
  • Maple
    lincom:=proc(a,b,n) local i,j,s,m; s:={}; for i from 0 to n do for j from 0 to n do m:=a^i+b^j; if m<=n then s:={op(s),m} fi od; od; lprint(sort([op(s)])); end: lincom(2,2,1000); # Zerinvary Lajos, Feb 24 2007
  • Mathematica
    Select[Range[2000], 1 <= DigitCount[#, 2, 1] <= 2&] (* Jean-François Alcover, Mar 06 2016 *)
  • PARI
    isok(n) = my(hw = hammingweight(n)); (hw == 1) || (hw == 2); \\ Michel Marcus, Mar 06 2016
    
  • PARI
    a(n) = if(n <= 2, return(n), n-=2); my(c = (sqrtint(8*n + 1) - 1) \ 2); 1 << c + 1 << (n - binomial(c + 1, 2)) \\ David A. Corneth, Jan 02 2019
    
  • PARI
    nxt(n) = msb = 1 << logint(n, 2); if(n == msb, n + 1, t = n - msb; n + t) \\ David A. Corneth, Jan 02 2019
    
  • Python
    def ok(n): return 1 <= bin(n)[2:].count('1') <= 2
    print([k for k in range(1033) if ok(k)]) # Michael S. Branicky, Jan 22 2022
    
  • Python
    from itertools import count, islice
    def agen(): # generator of terms
        for d in count(0):
            msb = 2**d
            yield msb
            for lsb in range(d):
                yield msb + 2**lsb
    print(list(islice(agen(), 60))) # Michael S. Branicky, Jan 22 2022
    
  • Python
    from math import isqrt, comb
    def A048645(n): return (1<<(m:=isqrt(n-1<<3)+1>>1)-1)+(1<<(n-2-comb(m,2))) if n>1 else 1 # Chai Wah Wu, Oct 30 2024

Formula

a(0) = 1, a(n) = (2^(trinv(n-1)-1) + 2^((n-1)-((trinv(n-1)*(trinv(n-1)-1))/2))), i.e., 2^A003056(n) + 2^A002262(n-1) (the latter sequence contains the definition of trinv).
Let Theta = Sum_{k >= 0} x^(2^k). Then Sum_{n>=1} x^a(n) = (Theta^2 + Theta + x)/2. - N. J. A. Sloane, Jun 23 2009
As a triangle, for n > 1, 1 < k <= n: T(n,1) = A173786(n-2,n-2) and T(n,k) = A173786(n-1,k-2). - Reinhard Zumkeller, Feb 28 2010
It appears that A147562(a(n)) = A162795(a(n)) = A169707(a(n)). - Omar E. Pol, Feb 19 2015
Sum_{n>=1} 1/a(n) = 2 + A179951. - Amiram Eldar, Jan 22 2022

A175654 Eight bishops and one elephant on a 3 X 3 chessboard. G.f.: (1 - x - x^2)/(1 - 3*x - x^2 + 6*x^3).

Original entry on oeis.org

1, 2, 6, 14, 36, 86, 210, 500, 1194, 2822, 6660, 15638, 36642, 85604, 199626, 464630, 1079892, 2506550, 5811762, 13462484, 31159914, 72071654, 166599972, 384912086, 888906306, 2052031172, 4735527306, 10925175254, 25198866036, 58108609526, 133973643090
Offset: 0

Views

Author

Johannes W. Meijer, Aug 06 2010; edited Jun 21 2013

Keywords

Comments

a(n) represents the number of n-move routes of a fairy chess piece starting in a given corner square (m = 1, 3, 7 or 9) on a 3 X 3 chessboard. This fairy chess piece behaves like a bishop on the eight side and corner squares but on the center square the bishop flies into a rage and turns into a raging elephant.
In chaturanga, the old Indian version of chess, one of the pieces was called gaja, elephant in Sanskrit. The Arabs called the game shatranj and the elephant became el fil in Arabic. In Spain chess became chess as we know it today but surprisingly in Spanish a bishop isn't a Christian bishop but a Moorish elephant and it still goes by its original name of el alfil.
On a 3 X 3 chessboard there are 2^9 = 512 ways for an elephant to fly into a rage on the central square (off the center the piece behaves like a normal bishop). The elephant is represented by the A[5] vector in the fifth row of the adjacency matrix A, see the Maple program and A180140. For the corner squares the 512 elephants lead to 46 different elephant sequences, see the overview of elephant sequences and the crossreferences.
The sequence above corresponds to 16 A[5] vectors with decimal values 71, 77, 101, 197, 263, 269, 293, 323, 326, 329, 332, 353, 356, 389, 449 and 452. These vectors lead for the side squares to A000079 and for the central square to A175655.

References

  • Gary Chartrand, Introductory Graph Theory, pp. 217-221, 1984.
  • David Hooper and Kenneth Whyld, The Oxford Companion to Chess, pp. 74, 366, 1992.

Crossrefs

Cf. Elephant sequences corner squares [decimal value A[5]]: A040000 [0], A000027 [16], A000045 [1], A094373 [2], A000079 [3], A083329 [42], A027934 [11], A172481 [7], A006138 [69], A000325 [26], A045623 [19], A000129 [21], A095121 [170], A074878 [43], A059570 [15], A175654 [71, this sequence], A026597 [325], A097813 [58], A057711 [27], 2*A094723 [23; n>=-1], A002605 [85], A175660 [171], A123203 [186], A066373 [59], A015518 [341], A134401 [187], A093833 [343].

Programs

  • Magma
    [n le 3 select Factorial(n) else 3*Self(n-1) +Self(n-2) -6*Self(n-3): n in [1..41]]; // G. C. Greubel, Dec 08 2021
    
  • Maple
    nmax:=28; m:=1; A[1]:=[0,0,0,0,1,0,0,0,1]: A[2]:=[0,0,0,1,0,1,0,0,0]: A[3]:=[0,0,0,0,1,0,1,0,0]: A[4]:=[0,1,0,0,0,0,0,1,0]: A[5]:=[0,0,1,0,0,0,1,1,1]: A[6]:=[0,1,0,0,0,0,0,1,0]: A[7]:=[0,0,1,0,1,0,0,0,0]: A[8]:=[0,0,0,1,0,1,0,0,0]: A[9]:=[1,0,0,0,1,0,0,0,0]: A:=Matrix([A[1], A[2], A[3], A[4], A[5], A[6], A[7], A[8], A[9]]): for n from 0 to nmax do B(n):=A^n: a(n):= add(B(n)[m,k],k=1..9): od: seq(a(n), n=0..nmax);
  • Mathematica
    LinearRecurrence[{3,1,-6}, {1,2,6}, 80] (* Vladimir Joseph Stephan Orlovsky, Feb 21 2012 *)
  • PARI
    a(n)=([0,1,0; 0,0,1; -6,1,3]^n*[1;2;6])[1,1] \\ Charles R Greathouse IV, Oct 03 2016
    
  • Sage
    [( (1-x-x^2)/((1-2*x)*(1-x-3*x^2)) ).series(x,n+1).list()[n] for n in (0..40)] # G. C. Greubel, Dec 08 2021

Formula

G.f.: (1 - x - x^2)/(1 - 3*x - x^2 + 6*x^3).
a(n) = 3*a(n-1) + a(n-2) - 6*a(n-3) with a(0)=1, a(1)=2 and a(2)=6.
a(n) = ((6+10*A)*A^(-n-1) + (6+10*B)*B^(-n-1))/13 - 2^n with A = (-1+sqrt(13))/6 and B = (-1-sqrt(13))/6.
Limit_{k->oo} a(n+k)/a(k) = (-1)^(n)*2*A000244(n)/(A075118(n) - A006130(n-1)*sqrt(13)).
a(n) = b(n) - b(n-1) - b(n-2), where b(n) = Sum_{k=1..n} Sum_{j=0..k} binomial(j,n-3*k+2*j)*(-6)^(k-j)*binomial(k,j)*3^(3*k-n-j), n>0, b(0)=1, with a(0) = b(0), a(1) = b(1) - b(0). - Vladimir Kruchinin, Aug 20 2010
a(n) = 2*A006138(n) - 2^n = 2*(A006130(n) + A006130(n-1)) - 2^n. - G. C. Greubel, Dec 08 2021
E.g.f.: 2*exp(x/2)*(13*cosh(sqrt(13)*x/2) + 3*sqrt(13)*sinh(sqrt(13)*x/2))/13 - cosh(2*x) - sinh(2*x). - Stefano Spezia, Feb 12 2023

A238016 Number A(n,k) of partitions of n^k into parts that are at most n; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 3, 1, 1, 1, 5, 12, 5, 1, 1, 1, 9, 75, 64, 7, 1, 1, 1, 17, 588, 2280, 377, 11, 1, 1, 1, 33, 5043, 123464, 106852, 2432, 15, 1, 1, 1, 65, 44652, 7566280, 55567352, 6889527, 16475, 22, 1
Offset: 0

Views

Author

Alois P. Heinz, Feb 17 2014

Keywords

Comments

In general, for k>3, is column k asymptotic to exp(2*n) * n^((k-2)*n-k) / (2*Pi). For k=1 see A000041, for k=2 see A206226 and for k=3 see A238608. - Vaclav Kotesovec, May 25 2015
Conjecture: If f(n) >= O(n^4) then "number of partitions of f(n) into parts that are at most n" is asymptotic to f(n)^(n-1) / (n!*(n-1)!). See also A237998, A238000, A236810 or A258668-A258672. - Vaclav Kotesovec, Jun 07 2015

Examples

			A(3,1) = 3: 3, 21, 111.
A(3,2) = 12: 333, 3222, 3321, 22221, 32211, 33111, 222111, 321111, 2211111, 3111111, 21111111, 111111111.
A(2,3) = 5: 2222, 22211, 221111, 2111111, 11111111.
A(2,4) = 9: 22222222, 222222211, 2222221111, 22222111111, 222211111111, 2221111111111, 22111111111111, 211111111111111, 1111111111111111.
Square array A(n,k) begins:
  0, 1,   1,      1,        1,           1, ...
  1, 1,   1,      1,        1,           1, ...
  1, 2,   3,      5,        9,          17, ...
  1, 3,  12,     75,      588,        5043, ...
  1, 5,  64,   2280,   123464,     7566280, ...
  1, 7, 377, 106852, 55567352, 33432635477, ...
		

Crossrefs

Programs

  • Mathematica
    A[n_, k_] := SeriesCoefficient[Product[1/(1-x^j), {j, 1, n}], {x, 0, n^k}]; A[0, 0] = 0; Table[A[n-k, k], {n, 0, 10}, {k, n, 0, -1}] // Flatten (* Jean-François Alcover, Oct 11 2015 *)

Formula

A(n,k) = [x^(n^k)] Product_{j=1..n} 1/(1-x^j).

A279553 Number of length n inversion sequences avoiding the patterns 110, 210, 120, 201, and 010.

Original entry on oeis.org

1, 1, 2, 5, 15, 50, 178, 663, 2552, 10071, 40528, 165682, 686151, 2872576, 12137278, 51690255, 221657999, 956265050, 4147533262, 18074429421, 79102157060, 347519074010, 1532070899412, 6775687911920, 30052744139440, 133649573395725, 595816470717728
Offset: 0

Views

Author

Megan A. Martinez, Dec 15 2016

Keywords

Comments

A length n inversion sequence e_1e_2...e_n is a sequence of integers where 0 <= e_i <= i-1. The term a(n) counts those length n inversion sequences with no entries e_i, e_j, e_k (where i e_k and e_i >= e_k. This is the same as the set of length n inversion sequences avoiding 010, 110, 120, 201, and 210.
It can be shown that this sequence also counts the length n inversion sequences with no entries e_i, e_j, e_k (where i e_j and e_i >= e_k. This is the same as the set of length n inversion sequences avoiding 010, 100, 120, 201, and 210.

Examples

			The length 3 inversion sequences avoiding (110, 210, 120, 201, 010) are 000, 001, 002, 011, 012.
The length 4 inversion sequences avoiding (110, 210, 120, 201, 010) are 0000, 0001, 0002, 0003, 0011, 0012, 0013, 0021, 0022, 0023, 0111, 0112, 0113, 0122, 0123.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; `if`(n<4, [1, 1, 2, 5][n+1],
          ((12*(n-1))*(182*n^3-1659*n^2+4628*n-3756)*a(n-1)
          -(4*(91*n^4-1057*n^3+3812*n^2-4046*n-906))*a(n-2)
          +(6*(n-4))*(182*n^3-1659*n^2+4901*n-4630)*a(n-3)
          -(4*(n-4))*(n-5)*(91*n^2-511*n+690)*a(n-4))
           /(5*n*(n-1)*(91*n^2-693*n+1292)))
        end:
    seq(a(n), n=0..30);  # Alois P. Heinz, Feb 22 2017
  • Mathematica
    a[n_] := a[n] = If[n < 4, {1, 1, 2, 5}[[n + 1]], ((12*(n - 1))*(182*n^3 - 1659*n^2 + 4628*n - 3756)*a[n - 1] - (4*(91*n^4 - 1057*n^3 + 3812*n^2 - 4046*n - 906))*a[n - 2] + (6*(n - 4))*(182*n^3 - 1659*n^2 + 4901*n - 4630)*a[n - 3] - (4*(n - 4))*(n - 5)*(91*n^2 - 511*n + 690)*a[n - 4]) / (5*n*(n - 1)*(91*n^2 - 693*n + 1292))]; Table[a[n], {n, 0, 30}] (* Jean-François Alcover, Nov 06 2017, after Alois P. Heinz *)
  • PARI
    seq(N) = my(x='x+O('x^N)); Vec(1+serreverse((-x^3+x^2+x)/(2*x^2+3*x+1)));
    seq(27) \\ Gheorghe Coserea, Jul 11 2018

Formula

G.f.: 1 + Series_Reversion(x*A094373(-x)). - Gheorghe Coserea, Jul 11 2018
a(n) ~ c * d^n / (sqrt(Pi) * n^(3/2)), where d = 4.730576939379622099763633264641101585205420756515858657461873... is the greatest real root of the equation 4 - 12*d + 4*d^2 - 24*d^3 + 5*d^4 = 0 and c = 0.3916760466183576202289779130261876915536170330427700961416097... is the positive real root of the equation -5 - 64*c^2 - 33728*c^4 + 209664*c^6 + 93184*c^8 = 0. - Vaclav Kotesovec, Jul 12 2018
D-finite with recurrence: 45*n*(n-1)*a(n) -4*(n-1)*(49*n-66)*a(n-1) +2*(-25*n^2+157*n-264)*a(n-2) +2*(-70*n^2+445*n-714)*a(n-3) -4*(n-6)*(n-13)*a(n-4) -4*(n-6)*(2*n-17)*a(n-5) +8*(n-6)*(n-7)*a(n-6)=0. - R. J. Mathar, Feb 21 2020

Extensions

a(10)-a(16) from Lars Blomberg, Feb 02 2017
a(17)-a(26) from Alois P. Heinz, Feb 22 2017

A144048 Square array A(n,k), n>=0, k>=0, read by antidiagonals, where column k is Euler transform of (j->j^k).

Original entry on oeis.org

1, 1, 1, 1, 1, 2, 1, 1, 3, 3, 1, 1, 5, 6, 5, 1, 1, 9, 14, 13, 7, 1, 1, 17, 36, 40, 24, 11, 1, 1, 33, 98, 136, 101, 48, 15, 1, 1, 65, 276, 490, 477, 266, 86, 22, 1, 1, 129, 794, 1828, 2411, 1703, 649, 160, 30, 1, 1, 257, 2316, 6970, 12729, 11940, 5746, 1593, 282, 42, 1, 1, 513
Offset: 0

Views

Author

Alois P. Heinz, Sep 08 2008

Keywords

Comments

In general, column k > 0 is asymptotic to (Gamma(k+2)*Zeta(k+2))^((1-2*Zeta(-k)) /(2*k+4)) * exp((k+2)/(k+1) * (Gamma(k+2)*Zeta(k+2))^(1/(k+2)) * n^((k+1)/(k+2)) + Zeta'(-k)) / (sqrt(2*Pi*(k+2)) * n^((k+3-2*Zeta(-k))/(2*k+4))). - Vaclav Kotesovec, Mar 01 2015

Examples

			Square array begins:
  1,  1,   1,   1,    1,     1, ...
  1,  1,   1,   1,    1,     1, ...
  2,  3,   5,   9,   17,    33, ...
  3,  6,  14,  36,   98,   276, ...
  5, 13,  40, 136,  490,  1828, ...
  7, 24, 101, 477, 2411, 12729, ...
		

Crossrefs

Rows give: 0-1: A000012, 2: A000051, A094373, 3: A001550, 4: A283456, 5: A283457.
Main diagonal gives A252782.
Cf. A283272.

Programs

  • Maple
    with(numtheory): etr:= proc(p) local b; b:= proc(n) option remember; `if`(n=0,1, add(add(d*p(d), d=divisors(j)) *b(n-j), j=1..n)/n) end end: A:= (n,k)-> etr(j->j^k)(n); seq(seq(A(n,d-n), n=0..d), d=0..13);
  • Mathematica
    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[n_, k_] := etr[Function[j, j^k]][n]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 13}] // Flatten (* Jean-François Alcover, Dec 27 2013, translated from Maple *)

Formula

G.f. of column k: Product_{j>=1} 1/(1-x^j)^(j^k).

A275043 Number A(n,k) of set partitions of [k*n] such that within each block the numbers of elements from all residue classes modulo k are equal for k>0, A(n,0)=1; square array A(n,k), n>=0, k>=0, read by antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3, 5, 1, 1, 1, 5, 16, 15, 1, 1, 1, 9, 64, 131, 52, 1, 1, 1, 17, 298, 1613, 1496, 203, 1, 1, 1, 33, 1540, 25097, 69026, 22482, 877, 1, 1, 1, 65, 8506, 461105, 4383626, 4566992, 426833, 4140, 1, 1, 1, 129, 48844, 9483041, 350813126, 1394519922, 437665649, 9934563, 21147, 1
Offset: 0

Views

Author

Alois P. Heinz, Jul 14 2016

Keywords

Examples

			A(2,2) = 3: 1234, 12|34, 14|23.
A(2,3) = 5: 123456, 123|456, 126|345, 135|246, 156|234.
A(2,4) = 9: 12345678, 1234|5678, 1238|4567, 1247|3568, 1278|3456, 1346|2578, 1368|2457, 1467|2358, 1678|2345.
A(3,2) = 16: 123456, 1234|56, 1236|45, 1245|36, 1256|34, 12|3456, 12|34|56, 12|36|45, 1346|25, 1456|23, 14|2356, 14|23|56, 16|2345, 16|23|45, 14|25|36, 16|25|34.
Square array A(n,k) begins:
  1,   1,     1,       1,          1,            1,               1, ...
  1,   1,     1,       1,          1,            1,               1, ...
  1,   2,     3,       5,          9,           17,              33, ...
  1,   5,    16,      64,        298,         1540,            8506, ...
  1,  15,   131,    1613,      25097,       461105,         9483041, ...
  1,  52,  1496,   69026,    4383626,    350813126,     33056715626, ...
  1, 203, 22482, 4566992, 1394519922, 573843627152, 293327384637282, ...
		

Crossrefs

Rows n=0+1,2-5 give: A000012, A094373, A275100, A275101, A275102.
Main diagonal gives A275044.
Cf. A345400.

Programs

  • Maple
    A:= proc(n, k) option remember; `if`(k*n=0, 1, add(
           binomial(n, j)^k*(n-j)*A(j, k), j=0..n-1)/n)
        end:
    seq(seq(A(n, d-n), n=0..d), d=0..12);
  • Mathematica
    A[n_, k_] := A[n, k] = If[k*n == 0, 1, Sum[Binomial[n, j]^k*(n-j)*A[j, k], {j, 0, n-1}]/n]; Table[A[n, d-n], {d, 0, 12}, {n, 0, d}] // Flatten (* Jean-François Alcover, Jan 17 2017, translated from Maple *)

A152977 Square array A(n,k), n>=0, k>=0, read by antidiagonals: A(n,k) is the number of partitions of 2^n into powers of 2 less than or equal to 2^k.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 2, 3, 1, 1, 2, 4, 5, 1, 1, 2, 4, 9, 9, 1, 1, 2, 4, 10, 25, 17, 1, 1, 2, 4, 10, 35, 81, 33, 1, 1, 2, 4, 10, 36, 165, 289, 65, 1, 1, 2, 4, 10, 36, 201, 969, 1089, 129, 1, 1, 2, 4, 10, 36, 202, 1625, 6545, 4225, 257, 1, 1, 2, 4, 10, 36, 202, 1827, 17361, 47905, 16641, 513, 1
Offset: 0

Views

Author

Alois P. Heinz, Jan 26 2011

Keywords

Comments

Column sequences converge towards A002577.

Examples

			A(3,2) = 9, because there are 9 partitions of 2^3=8 into powers of 2 less than or equal to 2^2=4: [4,4], [4,2,2], [4,2,1,1], [4,1,1,1,1], [2,2,2,2], [2,2,2,1,1], [2,2,1,1,1,1], [2,1,1,1,1,1,1], [1,1,1,1,1,1,1,1].
Square array A(n,k) begins:
  1,  1,  1,   1,   1,   1,  ...
  1,  2,  2,   2,   2,   2,  ...
  1,  3,  4,   4,   4,   4,  ...
  1,  5,  9,  10,  10,  10,  ...
  1,  9, 25,  35,  36,  36,  ...
  1, 17, 81, 165, 201, 202,  ...
		

Crossrefs

Columns k=0-10 give: A000012, A094373, A028400(n-2) for n>1, A210772, A210773, A210774, A210775, A210776, A210777, A210778, A210779.
Main diagonal and lower diagonals give: A002577, A125792, A125794.

Programs

  • Maple
    b:= proc(n,j) local nn, r;
          if n<0 then 0
        elif j=0 then 1
        elif j=1 then n+1
        elif n `if`(n=0, 1, b(2^(n-k), k)):
    seq(seq(A(n, d-n), n=0..d), d=0..11);
  • Mathematica
    b[n_, j_] := Module[{nn, r}, Which[n < 0, 0, j == 0, 1, j == 1, n+1, n < j, b[n, j] = b[n-1, j]+b[2*n, j-1], True, nn = 1+Floor[n]; r := n-nn; (nn-j)*Binomial[nn, j]*Sum[Binomial[j, h]/(nn-j+h)*b[j-h+r, j]*(-1)^h, {h, 0, j-1}]]]; a[n_, k_] := If[n == 0, 1, b[2^(n-k), k]]; Table[Table[a[n, d-n], {n, 0, d}], {d, 0, 11}] // Flatten (* Jean-François Alcover, Dec 18 2013, translated from Maple *)

Formula

A(n,k) = [x^2^(n-1)] 1/(1-x) * 1/Product_{j=0..k-1} (1-x^(2^j)) for n>0; A(0,k) = 1.
Showing 1-10 of 35 results. Next