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

A188541 a(n) = 2 * A079500(n) - A079500(n+1).

Original entry on oeis.org

1, 0, 1, 1, 2, 2, 4, 5, 9, 14, 24, 40, 70, 120, 211, 371, 658, 1172, 2102, 3786, 6856, 12470, 22782, 41789, 76947, 142180, 263578, 490104, 913858, 1708386, 3201290, 6011962, 11313274, 21329276, 40282947, 76202831, 144370582, 273906268, 520359324, 989804122, 1884992934, 3593832942, 6859139352, 13104584156, 25061042050, 47971076906, 91906883496
Offset: 0

Views

Author

N. J. A. Sloane, Apr 03 2011

Keywords

Comments

Arises in studying a conjecture related to lunar divisors in base 2.
a(n) is the number of compositions of n where the first part is even, say, 2*f and the other parts are <= f. - Joerg Arndt, Jan 04 2024

Examples

			From _Joerg Arndt_, Jan 04 2024: (Start)
There are a(10) = 24 compositions of 10 of the specified type:
   1:  [ 2 1 1 1 1 1 1 1 1 ]
   2:  [ 4 1 1 1 1 1 1 ]
   3:  [ 4 1 1 1 1 2 ]
   4:  [ 4 1 1 1 2 1 ]
   5:  [ 4 1 1 2 1 1 ]
   6:  [ 4 1 1 2 2 ]
   7:  [ 4 1 2 1 1 1 ]
   8:  [ 4 1 2 1 2 ]
   9:  [ 4 1 2 2 1 ]
  10:  [ 4 2 1 1 1 1 ]
  11:  [ 4 2 1 1 2 ]
  12:  [ 4 2 1 2 1 ]
  13:  [ 4 2 2 1 1 ]
  14:  [ 4 2 2 2 ]
  15:  [ 6 1 1 1 1 ]
  16:  [ 6 1 1 2 ]
  17:  [ 6 1 2 1 ]
  18:  [ 6 1 3 ]
  19:  [ 6 2 1 1 ]
  20:  [ 6 2 2 ]
  21:  [ 6 3 1 ]
  22:  [ 8 1 1 ]
  23:  [ 8 2 ]
  24:  [ 10 ]
(End)
		

Crossrefs

Cf. A079500.

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, 1,
          `if`(m=0, add(b(n-j, j), j=1..n),
          add(b(n-j, min(n-j, m)), j=1..min(n, m))))
        end:
    a:= n-> 2*b(n, 0)-b(n+1, 0):
    seq(a(n), n=0..46);  # Alois P. Heinz, Jan 04 2024
  • Mathematica
    b[n_, m_] := b[n, m] = If[n == 0, 1, If[m == 0, Sum[b[n-j, j], {j, 1, n}], Sum[b[n-j, Min[n-j, m]], {j, 1, Min[n, m]}]]];
    a79500[n_] := b[n, 0];
    a[n_] := -a79500[n+1] + 2 a79500[n];
    Table[a[n], {n, 0, 48}] (* Jean-François Alcover, Sep 15 2018, after Alois P. Heinz in A079500 *)
  • SageMath
    def C(n): return sum(Compositions(n, max_part=k, inner=[k]).cardinality()
                     for k in (0..n))
    def a(n): return 2*C(n) - C(n+1) if n > 0 else 1
    print([a(n) for n in (0..18)])  # Peter Luschny, Jan 04 2024

Formula

G.f.: Sum_{n>=0} x^(2*n)/(1 - Sum_{k=1..n} x^k). - Joerg Arndt, Jan 04 2024

Extensions

Offset changed to 0 by N. J. A. Sloane, Jan 04 2024 at the suggestion of Joerg Arndt.

A002450 a(n) = (4^n - 1)/3.

Original entry on oeis.org

0, 1, 5, 21, 85, 341, 1365, 5461, 21845, 87381, 349525, 1398101, 5592405, 22369621, 89478485, 357913941, 1431655765, 5726623061, 22906492245, 91625968981, 366503875925, 1466015503701, 5864062014805, 23456248059221, 93824992236885, 375299968947541
Offset: 0

Views

Author

Keywords

Comments

For n > 0, a(n) is the degree (n-1) "numbral" power of 5 (see A048888 for the definition of numbral arithmetic). Example: a(3) = 21, since the numbral square of 5 is 5(*)5 = 101(*)101(base 2) = 101 OR 10100 = 10101(base 2) = 21, where the OR is taken bitwise. - John W. Layman, Dec 18 2001
a(n) is composite for all n > 2 and has factors x, (3*x + 2*(-1)^n) where x belongs to A001045. In binary the terms greater than 0 are 1, 101, 10101, 1010101, etc. - John McNamara, Jan 16 2002
Number of n X 2 binary arrays with path of adjacent 1's from upper left corner to right column. - R. H. Hardin, Mar 16 2002
The Collatz-function iteration started at a(n), for n >= 1, will end at 1 after 2*n+1 steps. - Labos Elemer, Sep 30 2002 [corrected by Wolfdieter Lang, Aug 16 2021]
Second binomial transform of A001045. - Paul Barry, Mar 28 2003
All members of sequence are also generalized octagonal numbers (A001082). - Matthew Vandermast, Apr 10 2003
Also sum of squares of divisors of 2^(n-1): a(n) = A001157(A000079(n-1)), for n > 0. - Paul Barry, Apr 11 2003
Binomial transform of A000244 (with leading zero). - Paul Barry, Apr 11 2003
Number of walks of length 2n between two vertices at distance 2 in the cycle graph C_6. For n = 2 we have for example 5 walks of length 4 from vertex A to C: ABABC, ABCBC, ABCDC, AFABC and AFEDC. - Herbert Kociemba, May 31 2004
Also number of walks of length 2n + 1 between two vertices at distance 3 in the cycle graph C_12. - Herbert Kociemba, Jul 05 2004
a(n+1) is the number of steps that are made when generating all n-step random walks that begin in a given point P on a two-dimensional square lattice. To make one step means to mark one vertex on the lattice (compare A080674). - Pawel P. Mazur (Pawel.Mazur(AT)pwr.wroc.pl), Mar 13 2005
a(n+1) is the sum of square divisors of 4^n. - Paul Barry, Oct 13 2005
a(n+1) is the decimal number generated by the binary bits in the n-th generation of the Rule 250 elementary cellular automaton. - Eric W. Weisstein, Apr 08 2006
a(n-1) / a(n) = percentage of wasted storage if a single image is stored as a pyramid with a each subsequent higher resolution layer containing four times as many pixels as the previous layer. n is the number of layers. - Victor Brodsky (victorbrodsky(AT)gmail.com), Jun 15 2006
k is in the sequence if and only if C(4k + 1, k) (A052203) is odd. - Paul Barry, Mar 26 2007
This sequence also gives the number of distinct 3-colorings of the odd cycle C(2*n - 1). - Keith Briggs, Jun 19 2007
All numbers of the form m*4^m + (4^m-1)/3 have the property that they are sums of two squares and also their indices are the sum of two squares. This follows from the identity m*4^m + (4^m-1)/3 = 4(4(..4(4m + 1) + 1) + 1) + 1 ..) + 1. - Artur Jasinski, Nov 12 2007
For n > 0, terms are the numbers that, in base 4, are repunits: 1_4, 11_4, 111_4, 1111_4, etc. - Artur Jasinski, Sep 30 2008
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) = charpoly(A,1). - Milan Janjic, Jan 27 2010
This is the sequence A(0, 1; 3, 4; 2) = A(0, 1; 4, 0; 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
6*a(n) + 1 is every second Mersenne number greater than or equal to M3, hence all Mersenne primes greater than M2 must be a 6*a(n) + 1 of this sequence. - Roderick MacPhee, Nov 01 2010
Smallest number having alternating bit sum n. Cf. A065359.
For n = 1, 2, ..., the last digit of a(n) is 1, 5, 1, 5, ... . - Washington Bomfim, Jan 21 2011
Rule 50 elementary cellular automaton generates this sequence. This sequence also appears in the second column of array in A173588. - Paul Muljadi, Jan 27 2011
Sequence found by reading the line from 0, in the direction 0, 5, ... and the line from 1, in the direction 1, 21, ..., in the square spiral whose edges are the Jacobsthal numbers A001045 and whose vertices are the numbers A000975. These parallel lines are two semi-diagonals in the spiral. - Omar E. Pol, Sep 10 2011
a(n), n >= 1, is also the inverse of 3, denoted by 3^(-1), Modd(2^(2*n - 1)). For Modd n see a comment on A203571. E.g., a(2) = 5, 3 * 5 = 15 == 1 (Modd 8), because floor(15/8) = 1 is odd and -15 == 1 (mod 8). For n = 1 note that 3 * 1 = 3 == 1 (Modd 2) because floor(3/2) = 1 and -3 == 1 (mod 2). The inverse of 3 taken Modd 2^(2*n) coincides with 3^(-1) (mod 2^(2*n)) given in A007583(n), n >= 1. - Wolfdieter Lang, Mar 12 2012
If an AVL tree has a leaf at depth n, then the tree can contain no more than a(n+1) nodes total. - Mike Rosulek, Nov 20 2012
Also, this is the Lucas sequence V(5, 4). - Bruno Berselli, Jan 10 2013
Also, for n > 0, a(n) is an odd number whose Collatz trajectory contains no odd number other than n and 1. - Jayanta Basu, Mar 24 2013
Sum_{n >= 1} 1/a(n) converges to (3*(log(4/3) - QPolyGamma[0, 1, 1/4]))/log(4) = 1.263293058100271... = A321873. - K. G. Stier, Jun 23 2014
Consider n spheres in R^n: the i-th one (i=1, ..., n) has radius r(i) = 2^(1-i) and the coordinates of its center are (0, 0, ..., 0, r(i), 0, ..., 0) where r(i) is in position i. The coordinates of the intersection point in the positive orthant of these spheres are (2/a(n), 4/a(n), 8/a(n), 16/a(n), ...). For example in R^2, circles centered at (1, 0) and (0, 1/2), and with radii 1 and 1/2, meet at (2/5, 4/5). - Jean M. Morales, May 19 2015
From Peter Bala, Oct 11 2015: (Start)
a(n) gives the values of m such that binomial(4*m + 1,m) is odd. Cf. A003714, A048716, A263132.
2*a(n) = A020988(n) gives the values of m such that binomial(4*m + 2, m) is odd.
4*a(n) = A080674(n) gives the values of m such that binomial(4*m + 4, m) is odd. (End)
Collatz Conjecture Corollary: Except for powers of 2, the Collatz iteration of any positive integer must eventually reach a(n) and hence terminate at 1. - Gregory L. Simay, May 09 2016
Number of active (ON, black) cells at stage 2^n - 1 of the two-dimensional cellular automaton defined by "Rule 598", based on the 5-celled von Neumann neighborhood. - Robert Price, May 16 2016
From Luca Mariot and Enrico Formenti, Sep 26 2016: (Start)
a(n) is also the number of coprime pairs of polynomials (f, g) over GF(2) where both f and g have degree n + 1 and nonzero constant term.
a(n) is also the number of pairs of one-dimensional binary cellular automata with linear and bipermutive local rule of neighborhood size n+1 giving rise to orthogonal Latin squares of order 2^m, where m is a multiple of n. (End)
Except for 0, 1 and 5, all terms are Brazilian repunits numbers in base 4, and so belong to A125134. For n >= 3, all these terms are composite because a(n) = {(2^n-1) * (2^n + 1)}/3 and either (2^n - 1) or (2^n + 1) is a multiple of 3. - Bernard Schott, Apr 29 2017
Given the 3 X 3 matrix A = [2, 1, 1; 1, 2, 1; 1, 1, 2] and the 3 X 3 unit matrix I_3, A^n = a(n)(A - I_3) + I_3. - Nicolas Patrois, Jul 05 2017
The binary expansion of a(n) (n >= 1) consists of n 1's alternating with n - 1 0's. Example: a(4) = 85 = 1010101_2. - Emeric Deutsch, Aug 30 2017
a(n) (n >= 1) is the viabin number of the integer partition [n, n - 1, n - 2, ..., 2, 1] (for the definition of viabin number see comment in A290253). Example: a(4) = 85 = 1010101_2; consequently, the southeast border of the Ferrers board of the corresponding integer partition is ENENENEN, where E = (1, 0), N = (0, 1); this leads to the integer partition [4, 3, 2, 1]. - Emeric Deutsch, Aug 30 2017
Numbers whose binary and Gray-code representations are both palindromes (i.e., intersection of A006995 and A281379). - Amiram Eldar, May 17 2021
Starting with n = 1 the sequence satisfies {a(n) mod 6} = repeat{1, 5, 3}. - Wolfdieter Lang, Jan 14 2022
Terms >= 5 are those q for which the multiplicative order of 2 mod q is floor(log_2(q)) + 2 (and which is 1 more than the smallest possible order for any q). - Tim Seuré, Mar 09 2024
The order of 2 modulo a(n) is 2*n for n >= 2. - Joerg Arndt, Mar 09 2024

Examples

			Apply Collatz iteration to 9: 9, 28, 14, 7, 22, 11, 34, 17, 52, 26, 13, 40, 20, 10, 5 and hence 16, 8, 4, 2, 1.
Apply Collatz iteration to 27: 27, 82, 41, 124, 62, 31, 94, 47, 142, 71, 214, 107, 322, 161, 484, 242, 121, 364, 182, 91, 274, 137, 412, 206, 103, 310, 155, 466, 233, 700, 350, 175, 526, 263, 790, 395, 1186, 593, 1780, 890, 445, 1336, 668, 334, 167, 502, 251, 754, 377, 1132, 566, 283, 850, 425, 1276, 638, 319, 958, 479, 1438, 719, 2158, 1079, 3238, 1619, 4858, 2429, 7288, 3644, 1822, 911, 2734, 1367, 4102, 2051, 6154, 3077, 9232, 4616, 2308, 1154, 577, 1732, 866, 433, 1300, 650, 325, 976, 488, 244, 122, 61, 184, 92, 46, 23, 70, 35, 106, 53, 160, 80, 40, 20, 10, 5 and hence 16, 8, 4, 2, 1. [Corrected by _Sean A. Irvine_ at the suggestion of Stephen Cornelius, Mar 04 2024]
a(5) = (4^5 - 1)/3 = 341 = 11111_4 = {(2^5 - 1) * (2^5 + 1)}/3 = 31 * 33/3 = 31 * 11. - _Bernard Schott_, Apr 29 2017
		

References

  • A. Fletcher, J. C. P. Miller, L. Rosenhead and L. J. Comrie, An Index of Mathematical Tables. Vols. 1 and 2, 2nd ed., Blackwell, Oxford and Addison-Wesley, Reading, MA, 1962, Vol. 1, p. 112.
  • J. Riordan, Combinatorial Identities, Wiley, 1968, p. 217.
  • 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

Partial sums of powers of 4, A000302.
When converted to binary, this gives A094028.
Subsequence of A003714.
Primitive factors: A129735.

Programs

  • GAP
    List([0..25], n -> (4^n-1)/3); # Muniru A Asiru, Feb 18 2018
    
  • Haskell
    a002450 = (`div` 3) . a024036
    a002450_list = iterate ((+ 1) . (* 4)) 0
    -- Reinhard Zumkeller, Oct 03 2012
    
  • Magma
    [ (4^n-1)/3: n in [0..25] ]; // Klaus Brockhaus, Oct 28 2008
    
  • Magma
    [n le 2 select n-1 else 5*Self(n-1)-4*Self(n-2): n in [1..70]]; // Vincenzo Librandi, Jun 13 2015
    
  • Maple
    [seq((4^n-1)/3,n=0..40)];
    A002450:=1/(4*z-1)/(z-1); # Simon Plouffe in his 1992 dissertation, dropping the initial zero
  • Mathematica
    Table[(4^n - 1)/3, {n, 0, 127}] (* Vladimir Joseph Stephan Orlovsky, Sep 29 2008 *)
    LinearRecurrence[{5, -4}, {0, 1}, 30] (* Harvey P. Dale, Jun 23 2013 *)
  • Maxima
    makelist((4^n-1)/3, n, 0, 30); /* Martin Ettl, Nov 05 2012 */
    
  • PARI
    a(n) = (4^n-1)/3;
    
  • PARI
    my(z='z+O('z^40)); Vec(z/((1-z)*(1-4*z))) \\ Altug Alkan, Oct 11 2015
    
  • Python
    def A002450(n): return ((1<<(n<<1))-1)//3 # Chai Wah Wu, Jan 29 2023
  • Scala
    ((List.fill(20)(4: BigInt)).scanLeft(1: BigInt)( * )).scanLeft(0: BigInt)( + ) // Alonso del Arte, Sep 17 2019
    

Formula

From Wolfdieter Lang, Apr 24 2001: (Start)
a(n+1) = Sum_{m = 0..n} A060921(n, m).
G.f.: x/((1-x)*(1-4*x)). (End)
a(n) = Sum_{k = 0..n-1} 4^k; a(n) = A001045(2*n). - Paul Barry, Mar 17 2003
E.g.f.: (exp(4*x) - exp(x))/3. - Paul Barry, Mar 28 2003
a(n) = (A007583(n) - 1)/2. - N. J. A. Sloane, May 16 2003
a(n) = A000975(2*n)/2. - N. J. A. Sloane, Sep 13 2003
a(n) = A084160(n)/2. - N. J. A. Sloane, Sep 13 2003
a(n+1) = 4*a(n) + 1, with a(0) = 0. - Philippe Deléham, Feb 25 2004
a(n) = Sum_{i = 0..n-1} C(2*n - 1 - i, i)*2^i. - Mario Catalani (mario.catalani(AT)unito.it), Jul 23 2004
a(n+1) = Sum_{k = 0..n} binomial(n+1, k+1)*3^k. - Paul Barry, Aug 20 2004
a(n) = center term in M^n * [1 0 0], where M is the 3 X 3 matrix [1 1 1 / 1 3 1 / 1 1 1]. M^n * [1 0 0] = [A007583(n-1) a(n) A007583(n-1)]. E.g., a(4) = 85 since M^4 * [1 0 0] = [43 85 43] = [A007583(3) a(4) A007583(3)]. - Gary W. Adamson, Dec 18 2004
a(n) = Sum_{k = 0..n, j = 0..n} C(n, j)*C(j, k)*A001045(j - k). - Paul Barry, Feb 15 2005
a(n) = Sum_{k = 0..n} C(n, k)*A001045(n-k)*2^k = Sum_{k = 0..n} C(n, k)*A001045(k)*2^(n-k). - Paul Barry, Apr 22 2005
a(n) = A125118(n, 3) for n > 2. - Reinhard Zumkeller, Nov 21 2006
a(n) = Sum_{k = 0..n} 2^(n - k)*A128908(n, k), n >= 1. - Philippe Deléham, Oct 19 2008
a(n) = Sum_{k = 0..n} A106566(n, k)*A100335(k). - Philippe Deléham, Oct 30 2008
If we define f(m, j, x) = Sum_{k = j..m} binomial(m, k)*stirling2(k, j)*x^(m - k) then a(n-1) = f(2*n, 4, -2), n >= 2. - Milan Janjic, Apr 26 2009
a(n) = A014551(n) * A001045(n). - R. J. Mathar, Jul 08 2009
a(n) = 4*a(n-1) + a(n-2) - 4*a(n-3) = 5*a(n-1) - 4*a(n-2), a(0) = 0, a(1) = 1, a(2) = 5. - Wolfdieter Lang, Oct 18 2010
a(0) = 0, a(n+1) = a(n) + 2^(2*n). - Washington Bomfim, Jan 21 2011
A036555(a(n)) = 2*n. - Reinhard Zumkeller, Jan 28 2011
a(n) = Sum_{k = 1..floor((n+2)/3)} C(2*n + 1, n + 2 - 3*k). - Mircea Merca, Jun 25 2011
a(n) = Sum_{i = 1..n} binomial(2*n + 1, 2*i)/3. - Wesley Ivan Hurt, Mar 14 2015
a(n+1) = 2^(2*n) + a(n), a(0) = 0. - Ben Paul Thurston, Dec 27 2015
a(k*n)/a(n) = 1 + 4^n + ... + 4^((k-1)*n). - Gregory L. Simay, Jun 09 2016
Dirichlet g.f.: (PolyLog(s, 4) - zeta(s))/3. - Ilya Gutkovskiy, Jun 26 2016
A000120(a(n)) = n. - André Dalwigk, Mar 26 2018
a(m) divides a(m*n), in particular: a(2*n) == 0 (mod 5), a(3*n) == 0 (mod 3*7), a(5*n) == 0 (mod 11*31), etc. - M. F. Hasler, Oct 19 2018
a(n) = 4^(n-1) + a(n-1). - Bob Selcoe, Jan 01 2020
a(n) = A178415(1, n) = A347834(1, n-1), arrays, for n >= 1. - Wolfdieter Lang, Nov 29 2021
a(n) = A000225(2*n)/3. - John Keith, Jan 22 2022
a(n) = A080674(n) + 1 = A047849(n) - 1 = A163834(n) - 2 = A155701(n) - 3 = A163868(n) - 4 = A156605(n) - 7. - Ray Chandler, Jun 16 2023
From Peter Bala, Jul 23 2025: (Start)
The following are examples of telescoping products. Cf. A016153:
Product_{k = 1..2*n} 1 + 2^k/a(k+1) = a(n+1)/A007583(n) = (4^(n+1) - 1)/(2*4^n + 1).
Hence, Product_{k >= 1} 1 + 2^k/a(k+1) = 2.
Product_{k >= 1} 1 - 2^k/a(k+1) = 2/5, since 1 - 2^n/a(n+1) = b(n)/b(n-1), where b(n) = 2 - 3/(1 - 2^(n+1)).
Product_{k >= 1} 1 + (-2)^k/a(k+1) = 2/3, since 1 + (-2)^n/a(n+1) = c(n)/c(n-1), where c(n) = 2 - 1/(1 + (-2)^(n+1)).
Product_{k >= 1} 1 - (-2)^k/a(k+1) = 6/5, since 1 - (-2)^n/a(n+1) = d(n)/d(n-1), where d(n) = 2 - 1/(1 - (-2)^(n+1)). (End)

A048816 Number of rooted trees with n nodes with every leaf at the same height.

Original entry on oeis.org

1, 1, 2, 3, 5, 7, 12, 17, 28, 42, 68, 103, 168, 260, 420, 665, 1075, 1716, 2787, 4489, 7304, 11849, 19333, 31504, 51561, 84347, 138378, 227096, 373445, 614441, 1012583, 1669774, 2756951, 4555183, 7533988, 12469301, 20655523, 34238310, 56795325, 94270949
Offset: 1

Views

Author

Christian G. Bower, Apr 15 1999

Keywords

Comments

The trees are unordered (see A000081). For balanced ordered rooted trees see A079500. - Joerg Arndt, Jul 20 2014
The trees are unlabeled. For labeled version see A238372. - Alois P. Heinz, Dec 29 2014

Examples

			See Arndt link.
From _Gus Wiseman_, Oct 08 2018: (Start)
The a(1) = 1 through a(7) = 12 balanced rooted trees with n nodes:
  o  (o)  (oo)   (ooo)    (oooo)     (ooooo)      (oooooo)
          ((o))  ((oo))   ((ooo))    ((oooo))     ((ooooo))
                 (((o)))  (((oo)))   (((ooo)))    (((oooo)))
                          ((o)(o))   ((o)(oo))    ((o)(ooo))
                          ((((o))))  ((((oo))))   ((oo)(oo))
                                     (((o)(o)))   ((((ooo))))
                                     (((((o)))))  (((o)(oo)))
                                                  ((o)(o)(o))
                                                  (((((oo)))))
                                                  ((((o)(o))))
                                                  (((o))((o)))
                                                  ((((((o))))))
(End)
		

Crossrefs

Programs

  • Mathematica
    T[n_, k_] := T[n, k] = If[n==1, 1, If[k==0, 0, Sum[Sum[If[dJean-François Alcover, Jan 08 2016, after Alois P. Heinz *)

A007059 Number of balanced ordered trees with n nodes.

Original entry on oeis.org

0, 1, 1, 2, 3, 5, 8, 14, 24, 43, 77, 140, 256, 472, 874, 1628, 3045, 5719, 10780, 20388, 38674, 73562, 140268, 268066, 513350, 984911, 1892875, 3643570, 7023562, 13557020, 26200182, 50691978, 98182666, 190353370, 369393466, 717457656
Offset: 0

Views

Author

Keywords

Comments

Essentially the same as A079500: a(0)=0 and a(n)=A079500(n-1) for n >= 1.
Diagonal sums of the "postage stamp" array: for rows n >= -1, column m >= 0 is given by F(n,m) = F(n-1,m) + F(n-2,m) + ... + F(n-m,m) with F(0,m)=1 (m >= 0), F(n,m)=0 (n < 0) and F(n,0)=0 (n > 0). (Rows indicate the required sum, columns indicate the integers available {0,...,m}, entries F(n,m) indicate number of ordered ways sum can be achieved (e.g., n=3, m=2: 3 = 1+1+1 = 1+2 = 2+1 so F(3,2)=3 ways)). - Richard L. Ollerton
Conjecture: for n > 0, a(n+1) is the number of "numbral" divisors of (4^n-1)/3 = A002450(n) (see A048888 for the definition of numbral arithmetic). This has been verified computationally up to n=15. - John W. Layman, Dec 18 2001 [This conjecture follows immediately from Proposition 2.3 of Frosini and Rinaldi. - N. J. A. Sloane, Apr 29 2011]
Also number of Dyck paths of semi-length n-1 with all peaks at the same height. (not mentioned in Frosini reference) - David Scambler, Nov 19 2010
For n >= 1, a(n) is the number of compositions of n where all parts are smaller than the first part, see example. For n >= 1, a(n-1) = A079500(n) is the number of compositions of n where no part exceeds the first part, see the example in A079500. - Joerg Arndt, Dec 29 2012

Examples

			F(-1,0)=0 so a(0)=0. F(0,0)=1, F(-1,1)=0 so a(1)=1. F(1,0)=0, F(0,1)=1, F(-1,2)=0 so a(2)=1. F(2,0)=0, F(1,1)=1, F(0,2)=1, F(-1,3)=0 so a(3)=2.
From _Joerg Arndt_, Dec 29 2012: (Start)
There are a(8)=24 compositions p(1) + p(2) + ... + p(m) = 8 such that p(k) < p(1):
[ 1]  [ 2 1 1 1 1 1 1 ]
[ 2]  [ 3 1 1 1 1 1 ]
[ 3]  [ 3 1 1 1 2 ]
[ 4]  [ 3 1 1 2 1 ]
[ 5]  [ 3 1 2 1 1 ]
[ 6]  [ 3 1 2 2 ]
[ 7]  [ 3 2 1 1 1 ]
[ 8]  [ 3 2 1 2 ]
[ 9]  [ 3 2 2 1 ]
[10]  [ 4 1 1 1 1 ]
[11]  [ 4 1 1 2 ]
[12]  [ 4 1 2 1 ]
[13]  [ 4 1 3 ]
[14]  [ 4 2 1 1 ]
[15]  [ 4 2 2 ]
[16]  [ 4 3 1 ]
[17]  [ 5 1 1 1 ]
[18]  [ 5 1 2 ]
[19]  [ 5 2 1 ]
[20]  [ 5 3 ]
[21]  [ 6 1 1 ]
[22]  [ 6 2 ]
[23]  [ 7 1 ]
[24]  [ 8 ]
(End)
		

References

  • Arnold Knopfmacher and Neville Robbins, Compositions with parts constrained by the leading summand, Ars Combin. 76 (2005), 287-295.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Maple
    b:= proc(n, m) option remember; `if`(n=0, 1,
          `if`(m=0, add(b(n-j, j), j=1..n),
          add(b(n-j, min(n-j, m)), j=1..min(n, m))))
        end:
    a:= n-> b(n-1, 0):
    seq(a(n), n=0..40);  # Alois P. Heinz, May 01 2014
  • Mathematica
    f[ n_, m_ ] := f[ n, m ]=Which[ n>0, Sum[ f[ n-i, m ], {i, 1, m} ], n<0, 0, n==0, 1 ] Table[ Sum[ f[ i, n-i ], {i, 0, n} ], {n, -1, 40} ]
  • Python
    from functools import cache
    @cache
    def F(k, n):
        return sum(F(k, n-j) for j in range(1, min(k, n))) if n > 1 else n
    def A007059(n): return sum(F(k, n+1-k) for k in range(1, n+1))
    print([A007059(n) for n in range(36)])  # Peter Luschny, Jan 05 2024

Formula

Define generalized Fibonacci numbers by Sum_{h>=0} F(p, h)z^n = z^(p-1)(1-z)/(1-2z+z^p+1). Then a(n) = 1 + Sum_{h=2..n} F(h-1, n-2).
G.f.: Sum_{k>0} x^k*(1 - 2*x + x^2 + (1-x)*x^(k+1))/(1 - 2*x + x^(k+1)). - Vladeta Jovovic, Feb 25 2003
G.f.: -(1 + x^2 + 1/(x-1))*(1 + x*(x-1)^3*(1-x+x^3)/(Q(0)- x*(x-1)^3*(1-x+x^3))), where Q(k) = (x+1)*(2*x-1)*(1-x)^2 + x^(k+2)*(x + x^2 + x^3 - 2*x^4 - 1 - x^(k+3) + x^(k+5)) - x*(-1 + 2*x - x^(k+3))*(1 - 2*x + x^2 + x^(k+4) - x^(k+5))*(-1 + 4*x - 5*x^2 + 2*x^3 - x^(k+2) - x^(k+5) + 2*x^(k+3) - x^(2*k+5) + x^(2*k+6))/Q(k+1); (continued fraction). - Sergei N. Gladkovskii, Dec 14 2013
G.f.: Sum_{n>=1} q^n/(1-q*(1-q^n)/(1-q)) = Sum_{n>=1} q^n/(1 - Sum_{k=1..n} q^k ). - Joerg Arndt, Jan 03 2024

Extensions

More terms from Vladeta Jovovic, Apr 08 2000

A320160 Number of series-reduced balanced rooted trees whose leaves form an integer partition of n.

Original entry on oeis.org

1, 2, 3, 6, 9, 19, 31, 63, 110, 215, 391, 773, 1451, 2879, 5594, 11173, 22041, 44136, 87631, 175155, 348186, 694013, 1378911, 2743955, 5452833, 10853541, 21610732, 43122952, 86192274, 172753293, 347114772, 699602332, 1414033078, 2866580670, 5826842877, 11874508385
Offset: 1

Views

Author

Gus Wiseman, Oct 06 2018

Keywords

Comments

A rooted tree is series-reduced if every non-leaf node has at least two branches, and balanced if all leaves are the same distance from the root.
Also the number of balanced unlabeled phylogenetic rooted trees with n leaves.

Examples

			The a(1) = 1 through a(6) = 19 rooted trees:
  1  2     3      4           5            6
     (11)  (12)   (13)        (14)         (15)
           (111)  (22)        (23)         (24)
                  (112)       (113)        (33)
                  (1111)      (122)        (114)
                  ((11)(11))  (1112)       (123)
                              (11111)      (222)
                              ((11)(12))   (1113)
                              ((11)(111))  (1122)
                                           (11112)
                                           (111111)
                                           ((11)(13))
                                           ((11)(22))
                                           ((12)(12))
                                           ((11)(112))
                                           ((12)(111))
                                           ((11)(1111))
                                           ((111)(111))
                                           ((11)(11)(11))
		

Crossrefs

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    mps[set_]:=Union[Sort[Sort/@(#/.x_Integer:>set[[x]])]&/@sps[Range[Length[set]]]];
    phy2[labs_]:=If[Length[labs]==1,labs,Union@@Table[Sort/@Tuples[phy2/@ptn],{ptn,Select[mps[Sort[labs]],Length[#1]>1&]}]];
    Table[Sum[Length[Select[phy2[ptn],SameQ@@Length/@Position[#,_Integer]&]],{ptn,IntegerPartitions[n]}],{n,8}]
  • PARI
    EulerT(v)={Vec(exp(x*Ser(dirmul(v,vector(#v,n,1/n))))-1, -#v)}
    seq(n)={my(u=vector(n, n, 1), v=vector(n)); while(u, v+=u; u=EulerT(u)-u); v} \\ Andrew Howroyd, Oct 25 2018

Extensions

Terms a(14) and beyond from Andrew Howroyd, Oct 25 2018

A119262 Number of B-trees of order infinity with n leaves, where a(n) = Sum_{k=1..floor(n/2)} a(k)*C(n-k-1,n-2*k) for n >= 2, with a(0)=0, a(1)=1.

Original entry on oeis.org

0, 1, 1, 1, 2, 3, 5, 8, 14, 25, 46, 85, 158, 294, 548, 1022, 1908, 3567, 6683, 12556, 23669, 44781, 85046, 162122, 310157, 595322, 1146057, 2212004, 4278908, 8292738, 16097018, 31286456, 60873574, 118543329, 231009934, 450434739, 878687665
Offset: 0

Views

Author

Paul D. Hanna, May 11 2006

Keywords

Comments

A B-tree of order m is an ordered tree such that every node has at most m children, the root has at least 2 children, every node except the root has 0 or at least m/2 children, all end-nodes are at the same level. This sequence is the limit of the B-trees as m --> infinity.
Starting with offset 2, the eigensequence of triangle A011973. - Gary W. Adamson, Jul 08 2012
Number of balanced series-reduced rooted plane trees with n leaves. A rooted tree is series-reduced if every non-leaf node has at least two branches, and balanced if all leaves are the same distance from the root. - Gus Wiseman, Oct 07 2018

Examples

			A(x) = x + x^2 + x^3 + 2*x^4 + 3*x^5 + 5*x^6 + 8*x^7 + 14*x^8 + ...
Series form:
A(x) = x + x^2/(1-x) + x^4/((1-x)*((1-x)-x^2)) + x^8/((1-x)*((1-x)-x^2)*((1-x)*((1-x)-x^2)-x^4)) + ... + x^(2^n)/D(n,x) + x^(2^(n+1))/[D(n,x)*(D(n,x)-x^(2^n))] + ...
Terms also satisfy the series:
x = x*(1-x) + x^2*(1-x^2)/(1+x) + x^3*(1-x^3)/(1+x)^2 + 2*x^4*(1-x^4)/(1+x)^3 + 3*x^5*(1-x^5)/(1+x)^4 + 5*x^6*(1-x^6)/(1+x)^5 + 8*x^7*(1-x^7)/(1+x)^6 + 14*x^8*(1-x^8)/(1+x)^7 + 25*x^9*(1-x^9)/(1+x)^8 + ... + a(n)*x^n*(1-x^n)/(1+x)^(n-1) + ...
From _Gus Wiseman_, Oct 07 2018: (Start)
The a(1) = 1 through a(7) = 8 balanced series-reduced rooted plane trees:
  o  (oo)  (ooo)  (oooo)      (ooooo)      (oooooo)        (ooooooo)
                  ((oo)(oo))  ((oo)(ooo))  ((oo)(oooo))    ((oo)(ooooo))
                              ((ooo)(oo))  ((ooo)(ooo))    ((ooo)(oooo))
                                           ((oooo)(oo))    ((oooo)(ooo))
                                           ((oo)(oo)(oo))  ((ooooo)(oo))
                                                           ((oo)(oo)(ooo))
                                                           ((oo)(ooo)(oo))
                                                           ((ooo)(oo)(oo))
(End)
		

Crossrefs

Cf. A092684 (similar recurrence); B-trees: A014535 (order 3), A037026 (order 4), A058521 (order 5).
Cf. A011973.

Programs

  • Mathematica
    nn=38;f[x_]:=Sum[a[n]x^n,{n,0,nn}];a[0]=0;sol=SolveAlways[0==Series[f[x]-x-f[x^2/(1-x)],{x,0,nn}],x];Table[a[n],{n,0,nn}]/.sol  (* Geoffrey Critzer, Mar 28 2013 *)
  • PARI
    a(n)=if(n==0,0,if(n==1,1,sum(k=1,n\2,a(k)*binomial(n-k-1,n-2*k))))
    for(n=1, 20, print1(a(n), ", "))
    
  • PARI
    /* From: A(x) = x + A(x^2/(1-x)) */
    {a(n)=local(A=x);for(i=1,n,A=x+subst(A,x,x^2/(1-x+x*O(x^n))));polcoeff(A,n)}
    for(n=1, 20, print1(a(n), ", "))
    
  • PARI
    /* From: x = Sum_{n>=1} a(n)*x^n*(1-x^n)/(1+x)^(n-1) */
    a(n)=if(n==1, 1, -polcoeff(sum(k=1, n-1, a(k)*x^k*(1-x^k)/(1+x+x*O(x^n))^(k-1)), n))
    for(n=1, 20, print1(a(n), ", ")) \\ Paul D. Hanna, Jul 31 2013

Formula

G.f. A(x) satisfies: A(x) = x + A(x^2/(1-x)).
G.f.: Sum_{n>=0} x^(2^n)/D(n,x) where D(0,x)=1, D(n+1,x) = D(n,x)*[D(n,x) - x^(2^n)].
G.f.: x = Sum_{n>=1} a(n) * x^n * (1-x^n) / (1+x)^(n-1). - Paul D. Hanna, Jul 31 2013
Conjecture: Let M_n be an n X n matrix whose elements are m_ij = 0 for i < j - 1, m_ij = -1 for i = j - 1, and m_ij = binomial(i - j, n - i) otherwise. Then a(n + 1) = Det(M_n). - Benedict W. J. Irwin, Apr 19 2017

A120803 Number of series-reduced balanced trees with n leaves.

Original entry on oeis.org

1, 1, 1, 2, 2, 4, 4, 8, 9, 16, 20, 37, 47, 80, 111, 183, 256, 413, 591, 940, 1373, 2159, 3214, 5067, 7649, 12054, 18488, 29203, 45237, 71566, 111658, 176710, 276870, 437820, 687354, 1085577, 1705080, 2688285, 4221333, 6644088, 10425748
Offset: 1

Views

Author

Keywords

Comments

In other words, rooted trees with all leaves at the same level and no node having exactly one child; the order of children is not significant.

Examples

			From _Gus Wiseman_, Oct 07 2018: (Start)
The a(10) = 16 series-reduced balanced rooted trees:
  (oooooooooo)
  ((ooooo)(ooooo))
  ((oooo)(oooooo))
  ((ooo)(ooooooo))
  ((oo)(oooooooo))
  ((ooo)(ooo)(oooo))
  ((oo)(oooo)(oooo))
  ((oo)(ooo)(ooooo))
  ((oo)(oo)(oooooo))
  ((oo)(oo)(ooo)(ooo))
  ((oo)(oo)(oo)(oooo))
  ((oo)(oo)(oo)(oo)(oo))
  (((oo)(ooo))((oo)(ooo)))
  (((oo)(oo))((ooo)(ooo)))
  (((oo)(oo))((oo)(oooo)))
  (((oo)(oo))((oo)(oo)(oo)))
(End)
		

Crossrefs

Programs

  • PARI
    EulerT(v)={Vec(exp(x*Ser(dirmul(v,vector(#v,n,1/n))))-1, -#v)}
    seq(n)={my(u=vector(n), v=vector(n)); u[1]=1; while(u, v+=u; u=EulerT(u)-u); v} \\ Andrew Howroyd, Oct 26 2018

Formula

Let s_0(n) = 1 if n = 1, 0 otherwise; s_{k+1}(n) = EULER(s_k)(n) - s_k(n), where EULER is the Euler transform. Then a_n = sum_k s_k(n). (s_k(n) is the number of such trees of height k.) Note that s_k(n) = 0 for n < 2^k.

A320154 Number of series-reduced balanced rooted trees whose leaves form a set partition of {1,...,n}.

Original entry on oeis.org

1, 2, 5, 18, 92, 588, 4328, 35920, 338437, 3654751, 45105744, 625582147, 9539374171, 157031052142, 2757275781918, 51293875591794, 1007329489077804, 20840741773898303, 453654220906310222, 10380640686263467204, 249559854371799622350, 6301679967177242849680
Offset: 1

Views

Author

Gus Wiseman, Oct 06 2018

Keywords

Comments

A rooted tree is series-reduced if every non-leaf node has at least two branches, and balanced if all leaves are the same distance from the root.
Also the number of balanced phylogenetic rooted trees on n distinct labels.

Examples

			The a(1) = 1 through a(4) = 18 rooted trees:
  (1)  (12)      (123)        (1234)
       ((1)(2))  ((1)(23))    ((1)(234))
                 ((2)(13))    ((12)(34))
                 ((3)(12))    ((13)(24))
                 ((1)(2)(3))  ((14)(23))
                              ((2)(134))
                              ((3)(124))
                              ((4)(123))
                              ((1)(2)(34))
                              ((1)(3)(24))
                              ((1)(4)(23))
                              ((2)(3)(14))
                              ((2)(4)(13))
                              ((3)(4)(12))
                              ((1)(2)(3)(4))
                              (((1)(2))((3)(4)))
                              (((1)(3))((2)(4)))
                              (((1)(4))((2)(3)))
		

Crossrefs

Programs

  • Mathematica
    sps[{}]:={{}};sps[set:{i_,_}]:=Join@@Function[s,Prepend[#,s]&/@sps[Complement[set,s]]]/@Cases[Subsets[set],{i,_}];
    gug[m_]:=Prepend[Join@@Table[Union[Sort/@Tuples[gug/@mtn]],{mtn,Select[sps[m],Length[#]>1&]}],m];
    Table[Length[Select[gug[Range[n]],SameQ@@Length/@Position[#,_Integer]&]],{n,9}]
  • PARI
    EulerT(v)={Vec(exp(x*Ser(dirmul(v,vector(#v,n,1/n))))-1, -#v)}
    b(n,k)={my(u=vector(n), v=vector(n)); u[1]=k; u=EulerT(u); while(u, v+=u; u=EulerT(u)-u); v}
    seq(n)={my(M=Mat(vectorv(n,k,b(n,k)))); vector(n, k, sum(i=1, k, binomial(k,i)*(-1)^(k-i)*M[i,k]))} \\ Andrew Howroyd, Oct 26 2018

Extensions

Terms a(9) and beyond from Andrew Howroyd, Oct 26 2018

A048888 a(n) = Sum_{m=1..n} T(m,n+1-m), array T as in A048887.

Original entry on oeis.org

0, 1, 2, 4, 7, 13, 23, 42, 76, 139, 255, 471, 873, 1627, 3044, 5718, 10779, 20387, 38673, 73561, 140267, 268065, 513349, 984910, 1892874, 3643569, 7023561, 13557019, 26200181, 50691977, 98182665, 190353369, 369393465, 717457655
Offset: 0

Views

Author

Keywords

Comments

From Marc LeBrun, Dec 12 2001: (Start)
Define a "numbral arithmetic" by replacing addition with binary bitwise inclusive-OR (so that [3] + [5] = [7] etc.) and multiplication becomes shift-&-OR instead of shift-&-add (so that [3] * [3] = [7] etc.). [d] divides [n] means there exists an [e] with [d] * [e] = [n]. For example the six divisors of [14] are [1], [2], [3], [6], [7] and [14]. Then it appears that this sequence gives the number of proper divisors of [2^n-1]. Conjecture confirmed by Richard C. Schroeppel, Dec 14 2001. (End)
The number of "prime endofunctions" on n points, meaning the cardinality of the subset of the A001372(n) mappings (or mapping patterns) up to isomorphism from n (unlabeled) points to themselves (endofunctions) which are neither the sum of prime endofunctions (i.e., whose disjoint connected components are prime endofunctions) nor the categorical product of prime endofunctions. The n for which a(n) is prime (n such that the number of prime endofunctions on n points is itself prime) are 2, 4, 5, 6, 9, 13, 19, ... - Jonathan Vos Post, Nov 19 2006
For n>=1, compositions p(1)+p(2)+...+p(m)=n such that p(k)<=p(1)+1, see example. - Joerg Arndt, Dec 28 2012

Examples

			From _Joerg Arndt_, Dec 28 2012: (Start)
There are a(6)=23 compositions p(1)+p(2)+...+p(m)=6 such that p(k)<=p(1)+1:
[ 1]  [ 1 1 1 1 1 1 ]
[ 2]  [ 1 1 1 1 2 ]
[ 3]  [ 1 1 1 2 1 ]
[ 4]  [ 1 1 2 1 1 ]
[ 5]  [ 1 1 2 2 ]
[ 6]  [ 1 2 1 1 1 ]
[ 7]  [ 1 2 1 2 ]
[ 8]  [ 1 2 2 1 ]
[ 9]  [ 2 1 1 1 1 ]
[10]  [ 2 1 1 2 ]
[11]  [ 2 1 2 1 ]
[12]  [ 2 1 3 ]
[13]  [ 2 2 1 1 ]
[14]  [ 2 2 2 ]
[15]  [ 2 3 1 ]
[16]  [ 3 1 1 1 ]
[17]  [ 3 1 2 ]
[18]  [ 3 2 1 ]
[19]  [ 3 3 ]
[20]  [ 4 1 1 ]
[21]  [ 4 2 ]
[22]  [ 5 1 ]
[23]  [ 6 ]
(End)
		

Crossrefs

Programs

  • PARI
    N = 66;  x = 'x + O('x^N);
    gf = sum(n=0,N,  (1-x^n)*x^n/(1-2*x+x^(n+1)) ) + 'c0;
    v = Vec(gf);  v[1]-='c0;  v
    /* Joerg Arndt, Apr 14 2013 */

Formula

G.f.: Sum_{k>0} x^k*(1-x^k)/(1-2*x+x^(k+1)). - Vladeta Jovovic, Feb 25 2003
a(m) = Sum_{ n=2..m+1 } Fn(m) where Fn is a Fibonacci n-step number (Fibonacci, tetranacci, etc.) indexed as in A000045, A000073, A000078. - Gerald McGarvey, Sep 25 2004

A067139 Irreducible elements in OR-numbral arithmetic.

Original entry on oeis.org

1, 2, 3, 5, 9, 11, 13, 17, 19, 23, 25, 29, 33, 35, 37, 39, 41, 43, 49, 53, 57, 65, 67, 69, 71, 75, 77, 79, 81, 83, 87, 89, 93, 97, 101, 105, 107, 113, 117, 121, 129, 131, 133, 135, 137, 139, 141, 143, 145, 147, 149, 151, 157, 159, 161, 163, 167, 169, 171, 177, 179
Offset: 1

Views

Author

Jens Voß, Jan 02 2002

Keywords

Comments

Numbers m such that there is no number d in the range 1 < d < m with d*k = m for any 1 < k < m, where * is defined in A066376.
See A048888 for the definition of OR-numbral arithmetic. Note that 2 is the only prime element in OR-numbral arithmetic; for all other nonunit irreducibles x there exist numbers a and b not divisible by x such that x is a divisor of a * b.
Numbers m such that A066376(m) = 1.
1 together with primes in lunar arithmetic base 2. - N. J. A. Sloane, Aug 14 2010

Crossrefs

See A169912 for the number of elements that are n bits long - N. J. A. Sloane, Aug 31 2010. See A171000 for the binary expansions.

Programs

  • Haskell
    import Data.List (elemIndices)
    a067139 n = a067139_list !! (n-1)
    a067139_list = 1 : map (+ 1) (elemIndices 1 a066376_list)
    -- Reinhard Zumkeller, Mar 01 2013

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe and Joshua Zucker, Jun 12 2007
Showing 1-10 of 44 results. Next