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

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)

A079500 Number of compositions of the integer n in which the first part is >= the other parts.

Original entry on oeis.org

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, 1394632365, 2713061899
Offset: 0

Views

Author

Arnold Knopfmacher, Jan 21 2003

Keywords

Comments

Essentially the same as A007059: a(n) = A007059(n+1).
In lunar arithmetic in base 2, this is the number of lunar divisors of the number 111...1 (with n 1's). E.g., 1111 has a(4) = 5 divisors (see A048888). - N. J. A. Sloane, Feb 23 2011.
First differences of A186537. - N. J. A. Sloane, Feb 23 2011
Number of balanced ordered rooted trees with n non-root nodes (see A048816 for unordered balanced trees); see example. The compositions are obtained from the level sequences by identifying a length-k run of (non-root) levels [t, t+1, t+2, ..., t+k-1] with a part k. - Joerg Arndt, Jul 20 2014

Examples

			From _Joerg Arndt_, Dec 29 2012: (Start)
There are a(7)=24 compositions p(1)+p(2)+...+p(m)=7 such that p(k) <= p(1):
[ 1]  [ 1 1 1 1 1 1 1 ]
[ 2]  [ 2 1 1 1 1 1 ]
[ 3]  [ 2 1 1 1 2 ]
[ 4]  [ 2 1 1 2 1 ]
[ 5]  [ 2 1 2 1 1 ]
[ 6]  [ 2 1 2 2 ]
[ 7]  [ 2 2 1 1 1 ]
[ 8]  [ 2 2 1 2 ]
[ 9]  [ 2 2 2 1 ]
[10]  [ 3 1 1 1 1 ]
[11]  [ 3 1 1 2 ]
[12]  [ 3 1 2 1 ]
[13]  [ 3 1 3 ]
[14]  [ 3 2 1 1 ]
[15]  [ 3 2 2 ]
[16]  [ 3 3 1 ]
[17]  [ 4 1 1 1 ]
[18]  [ 4 1 2 ]
[19]  [ 4 2 1 ]
[20]  [ 4 3 ]
[21]  [ 5 1 1 ]
[22]  [ 5 2 ]
[23]  [ 6 1 ]
[24]  [ 7 ]
(End)
From _Joerg Arndt_, Jul 20 2014: (Start)
The a(7) = 24 balanced ordered rooted trees with 7 non-root nodes are, as level sequences (of the pre-order walk):
01:  [ 0 1 1 1 1 1 1 1 ]
02:  [ 0 1 2 1 2 1 2 2 ]
03:  [ 0 1 2 1 2 2 1 2 ]
04:  [ 0 1 2 1 2 2 2 2 ]
05:  [ 0 1 2 2 1 2 1 2 ]
06:  [ 0 1 2 2 1 2 2 2 ]
07:  [ 0 1 2 2 2 1 2 2 ]
08:  [ 0 1 2 2 2 2 1 2 ]
09:  [ 0 1 2 2 2 2 2 2 ]
10:  [ 0 1 2 3 1 2 3 3 ]
11:  [ 0 1 2 3 2 3 2 3 ]
12:  [ 0 1 2 3 2 3 3 3 ]
13:  [ 0 1 2 3 3 1 2 3 ]
14:  [ 0 1 2 3 3 2 3 3 ]
15:  [ 0 1 2 3 3 3 2 3 ]
16:  [ 0 1 2 3 3 3 3 3 ]
17:  [ 0 1 2 3 4 2 3 4 ]
18:  [ 0 1 2 3 4 3 4 4 ]
19:  [ 0 1 2 3 4 4 3 4 ]
20:  [ 0 1 2 3 4 4 4 4 ]
21:  [ 0 1 2 3 4 5 4 5 ]
22:  [ 0 1 2 3 4 5 5 5 ]
23:  [ 0 1 2 3 4 5 6 6 ]
24:  [ 0 1 2 3 4 5 6 7 ]
(End)
From _Gus Wiseman_, Oct 07 2018: (Start)
The a(0) = 1 through a(6) = 14 balanced rooted plane trees:
  o  (o)  (oo)   (ooo)    (oooo)     (ooooo)      (oooooo)
          ((o))  ((oo))   ((ooo))    ((oooo))     ((ooooo))
                 (((o)))  (((oo)))   (((ooo)))    (((oooo)))
                          ((o)(o))   ((o)(oo))    ((o)(ooo))
                          ((((o))))  ((oo)(o))    ((oo)(oo))
                                     ((((oo))))   ((ooo)(o))
                                     (((o)(o)))   ((((ooo))))
                                     (((((o)))))  (((o)(oo)))
                                                  (((oo)(o)))
                                                  ((o)(o)(o))
                                                  (((((oo)))))
                                                  ((((o)(o))))
                                                  (((o))((o)))
                                                  ((((((o))))))
(End)
		

References

  • Arnold Knopfmacher and Neville Robbins, Compositions with parts constrained by the leading summand, Ars Combin. 76 (2005), 287-295.

Crossrefs

Programs

  • Maple
    M:=101:
    t1:=add( (1-x)*x^k/(1-2*x+x^k), k=1..M):
    series(t1,x,M-1);
    seriestolist(%);
    # second Maple program:
    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, 0):
    seq(a(n), n=0..40);  # Alois P. Heinz, May 01 2014
  • Mathematica
    nn=36;CoefficientList[Series[Sum[x^i/(1-(x-x^(i+1))/(1-x)),{i,0,nn}],{x,0,nn}],x]  (* Geoffrey Critzer, Mar 12 2013 *)
    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]}]]]; a[n_] := b[n, 0]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Nov 23 2015, after Alois P. Heinz *)

Formula

G.f.: (1-z) * Sum_{k>=0} z^k/(1 - 2*z + z^(k+1)).
a(n) = A048888(n) - 1.
This is a subsequence of A067399: a(n) = A067399(2^n-1).
G.f.: -((1 + x^2 + 1/(x-1))/x)*( 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
a(n) = Sum_{j=1..n} F(j, n+1-j), where F(n,k) is the n-th k-generalized Fibonacci number A092921(k,n). - Gregory L. Simay, Aug 21 2022

Extensions

Offset corrected by N. J. A. Sloane, Feb 23 2011
More terms from N. J. A. Sloane, Feb 24 2011
Further edits (required in order to clarify the definition - is the first part >= the rest. or only > the rest? Answer: the former; for the latter, see A007059) by N. J. A. Sloane, May 08 2011

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

A016131 Expansion of 1/((1-2*x)*(1-8*x)).

Original entry on oeis.org

1, 10, 84, 680, 5456, 43680, 349504, 2796160, 22369536, 178956800, 1431655424, 11453245440, 91625967616, 733007749120, 5864062009344, 46912496107520, 375299968925696, 3002399751536640, 24019198012555264, 192153584100966400
Offset: 0

Views

Author

Keywords

Comments

"Numbral" powers of 10 (see A048888 for definition). - John W. Layman, Dec 18 2001
For n > 1, a(n-1) is the (2^n-3)rd coefficient in the expansion of th(0)=y, th(n+1) = th(n)*(th(n) + 1).
If 2^(n+1) is the length of the even leg of a primitive Pythagorean triangle (PPT) then it constrains the odd leg to have a length of 4^n-1 and the hypotenuse to have a length of 4^n+1. The resulting triangle has a semiperimeter of 4^n+2^n, an area of 8^n-2^n and an inradius of 2^n-1. Now consider the term 8^n-2^n: it must at least be divisible by 6 because it is the area of a PPT. a(n) is 1/6 the area of such triangles. - Frank M Jackson, Dec 28 2017

Crossrefs

Programs

Formula

a(0) = 1, a(n) = (2^(3n+2) - 2^n)/3 = A059155(n)/12 = A000079(n)*A002450(n+1) = A016203(n+1) - A016203(n). - Ralf Stephan, Aug 14 2003
a(n) = binomial(2^n,2)*(2^n + 1)/3, n >= 1. - Zerinvary Lajos, Jan 07 2008
a(n) = (8^(n+1) - 2^(n+1))/6. - Al Hakanson (hawkuu(AT)gmail.com), Jan 07 2009
a(n) = Sum_{i=1...(2^n -1)} i*(i+1)/2. - Ctibor O. Zizka, Mar 03 2009
a(0) = 1, a(n) = 8*a(n-1) + 2^n. - Vincenzo Librandi, Feb 09 2011
a(n) = 10*a(n-1) - 16*a(n-2), n > 1. - Vincenzo Librandi, Feb 09 2011
a(n) = A248217(n+1)/6. - Frank M Jackson, Dec 28 2017
E.g.f.: e^(2*x) * (4*e^(6*x) - 1)/3. - Iain Fox, Dec 28 2017

A067138 OR-numbral multiplication table, read by antidiagonals.

Original entry on oeis.org

0, 0, 0, 0, 1, 0, 0, 2, 2, 0, 0, 3, 4, 3, 0, 0, 4, 6, 6, 4, 0, 0, 5, 8, 7, 8, 5, 0, 0, 6, 10, 12, 12, 10, 6, 0, 0, 7, 12, 15, 16, 15, 12, 7, 0, 0, 8, 14, 14, 20, 20, 14, 14, 8, 0, 0, 9, 16, 15, 24, 21, 24, 15, 16, 9, 0, 0, 10, 18, 24, 28, 30, 30, 28, 24, 18, 10, 0, 0, 11, 20, 27, 32, 31, 28
Offset: 0

Views

Author

Jens Voß, Jan 02 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic

Examples

			The top left 0..16 x 0..16 corner of the array:
  0,  0,  0,  0,  0,  0,  0,   0,   0,   0,   0,   0,   0,   0,   0,   0,
  0,  1,  2,  3,  4,  5,  6,   7,   8,   9,  10,  11,  12,  13,  14,  15,
  0,  2,  4,  6,  8, 10, 12,  14,  16,  18,  20,  22,  24,  26,  28,  30,
  0,  3,  6,  7, 12, 15, 14,  15,  24,  27,  30,  31,  28,  31,  30,  31,
  0,  4,  8, 12, 16, 20, 24,  28,  32,  36,  40,  44,  48,  52,  56,  60,
  0,  5, 10, 15, 20, 21, 30,  31,  40,  45,  42,  47,  60,  61,  62,  63,
  0,  6, 12, 14, 24, 30, 28,  30,  48,  54,  60,  62,  56,  62,  60,  62,
  0,  7, 14, 15, 28, 31, 30,  31,  56,  63,  62,  63,  60,  63,  62,  63,
  0,  8, 16, 24, 32, 40, 48,  56,  64,  72,  80,  88,  96, 104, 112, 120,
  0,  9, 18, 27, 36, 45, 54,  63,  72,  73,  90,  91, 108, 109, 126, 127,
  0, 10, 20, 30, 40, 42, 60,  62,  80,  90,  84,  94, 120, 122, 124, 126,
  0, 11, 22, 31, 44, 47, 62,  63,  88,  91,  94,  95, 124, 127, 126, 127,
  0, 12, 24, 28, 48, 60, 56,  60,  96, 108, 120, 124, 112, 124, 120, 124,
  0, 13, 26, 31, 52, 61, 62,  63, 104, 109, 122, 127, 124, 125, 126, 127,
  0, 14, 28, 30, 56, 62, 60,  62, 112, 126, 124, 126, 120, 126, 124, 126,
  0, 15, 30, 31, 60, 63, 62,  63, 120, 127, 126, 127, 124, 127, 126, 127,
  0, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 240,
.
Multiplying 3 ("11" in binary) with itself in this system means taking bitwise-or of "11" with itself, when shifted one bit-position left:
       11
      110
  -------
OR:   111 = 7 in decimal = A(3,3).
.
Multiplying 10 (= "1010" in binary) and 11 (= "1011" in binary) in this system means taking bitwise-or of binary number 1011 when shifted once left with the same binary number when shifted three bit-positions left:
      10110
    1011000
    -------
OR: 1011110 = 94 in decimal = A(10,11) = A(11,10).
		

Crossrefs

Cf. A003986, A067139, A048888, A007059, A067398 (main diagonal).
Cf. also A004247, A048720 for analogous multiplication tables.

Programs

  • PARI
    t(n, k) = {res = 0; for (i=0, length(binary(n))-1, if (bittest(n, i), res = bitor(res, shift(k, i)));); return (res);} \\ Michel Marcus, Apr 14 2013

Formula

From Rémy Sigrist, Mar 17 2021: (Start)
T(n, 0) = 0.
T(n, 1) = n.
T(n, 2^k) = n*2^k for any k >= 0.
T(n, n) = A067398(n).
(End)
For all n, k: A048720(n,k) <= A(n,k) <= A004247(n,k). - Antti Karttunen, Mar 17 2021

Extensions

Example-section rewritten by Antti Karttunen, Mar 17 2021

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

A067399 Number of divisors of n in OR-numbral arithmetic.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 3, 4, 2, 4, 2, 6, 2, 6, 5, 5, 2, 4, 2, 6, 3, 4, 2, 8, 2, 4, 4, 9, 2, 10, 8, 6, 2, 4, 2, 6, 2, 4, 2, 8, 2, 6, 2, 6, 4, 4, 4, 10, 2, 4, 4, 6, 2, 8, 4, 12, 2, 4, 4, 15, 4, 16, 14, 7, 2, 4, 2, 6, 2, 4, 2, 8, 3, 4, 2, 6, 2, 4, 2, 10, 2, 4, 2, 9, 5, 4, 2, 8, 2, 8, 4, 6, 2, 8, 6, 12, 2, 4, 4, 6
Offset: 1

Views

Author

Jens Voß, Jan 23 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic. The example shows that this sequence is not multiplicative.
In other words, number of lunar divisors of n in base 2.

Examples

			a(15)=5 since [15] has the 5 OR-numbral divisors [1], [3], [5], [7] and [15].
If written as a triangle with rows of lengths 1,2,4,8,16,...:
1,
2, 2,
3, 2, 4, 3,
4, 2, 4, 2, 6, 2, 6, 5,
5, 2, 4, 2, 6, 3, 4, 2, 8, 2, 4, 4, 9, 2, 10, 8,
6, 2, 4, 2, 6, 2, 4, 2, 8, 2, 6, 2, 6, 4, 4, 4, 10, 2, 4, 4, 6, 2, 8, 4, 12, 2, 4, 4, 15, 4, 16, 14,
...,
the last terms in each row give A079500(n). The penultimate terms in the rows give 2*A079500(n-1). - _N. J. A. Sloane_, Mar 05 2011
		

Crossrefs

A079500 is the subsequence a(2^k-1). - N. J. A. Sloane, Feb 23 2011
See A188548 for the sum of the divisors.

A067398 Squares in OR-numbral arithmetic.

Original entry on oeis.org

0, 1, 4, 7, 16, 21, 28, 31, 64, 73, 84, 95, 112, 125, 124, 127, 256, 273, 292, 311, 336, 341, 380, 383, 448, 473, 500, 511, 496, 509, 508, 511, 1024, 1057, 1092, 1127, 1168, 1205, 1244, 1279, 1344, 1385, 1364, 1407, 1520, 1533, 1532, 1535, 1792, 1841, 1892
Offset: 0

Views

Author

Jens Voß, Jan 23 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic.
Or, squares in lunar arithmetic base 2, written in base 10. - N. J. A. Sloane, Oct 02 2010
This sequence is not multiplicative; for example a(15) = 127 != 7 * 21 = a(3) * a(5). It is totally OR-numbral multiplicative: a([n] * [m]) = [a(n)] * [a(m)] in OR-numbral arithmetic. - Franklin T. Adams-Watters, Oct 27 2006

Examples

			A067398(5) = 21 since [5] * [5] = [21] in OR-numbral arithmetic.
		

Crossrefs

Programs

  • Haskell
    a067398 :: Integer -> Integer
    a067398 0 = 0
    a067398 n = orm n n where
       orm 1 v = v
       orm u v = orm (shiftR u 1) (shiftL v 1) .|. if odd u then v else 0
    -- Reinhard Zumkeller, Mar 01 2013

A125127 Array L(k,n) read by antidiagonals: k-step Lucas numbers.

Original entry on oeis.org

1, 1, 1, 1, 3, 1, 1, 3, 4, 1, 1, 3, 7, 7, 1, 1, 3, 7, 11, 11, 1, 1, 3, 7, 15, 21, 18, 1, 1, 3, 7, 15, 26, 39, 29, 1, 1, 3, 7, 15, 31, 51, 71, 47, 1, 1, 3, 7, 15, 31, 57, 99, 131, 76, 1, 1, 3, 7, 15, 31, 63, 113, 191, 241, 123, 1
Offset: 1

Views

Author

Jonathan Vos Post, Nov 21 2006

Keywords

Examples

			Table begins:
1 | 1  1  1   1   1   1    1    1    1    1
2 | 1  3  4   7  11  18   29   47   76  123
3 | 1  3  7  11  21  39   71  131  241  443
4 | 1  3  7  15  26  51   99  191  367  708
5 | 1  3  7  15  31  57  113  223  439  863
6 | 1  3  7  15  31  63  120  239  475  943
7 | 1  3  7  15  31  63  127  247  493  983
8 | 1  3  7  15  31  63  127  255  502 1003
9 | 1  3  7  15  31  63  127  255  511 1013
		

Crossrefs

n-step Lucas number analog of A092921 Array F(k, n) read by antidiagonals: k-generalized Fibonacci numbers (and see related A048887, A048888). L(1, n) = "1-step Lucas numbers" = A000012. L(2, n) = 2-step Lucas numbers = A000204. L(3, n) = 3-step Lucas numbers = A001644. L(4, n) = 4-step Lucas numbers = A001648 Tetranacci numbers A073817 without the leading term 4. L(5, n) = 5-step Lucas numbers = A074048 Pentanacci numbers with initial conditions a(0)=5, a(1)=1, a(2)=3, a(3)=7, a(4)=15. L(6, n) = 6-step Lucas numbers = A074584 Esanacci ("6-anacci") numbers. L(7, n) = 7-step Lucas numbers = A104621 Heptanacci-Lucas numbers. L(8, n) = 8-step Lucas numbers = A105754. L(9, n) = 9-step Lucas numbers = A105755. See A000295, A125129 for comments on partial sums of diagonals.

Programs

  • Sage
    def L(k, n):
        if n < 0:
            return -1
        a = [-1]*(k-1) + [k] # [-1, -1, ..., -1, k]
        for i in range(1, n+1):
            a[:] = a[1:] + [sum(a)]
        return a[-1]
    [L(k, n) for d in (1..12) for k, n in zip((d..1, step=-1), (1..d))] # Freddy Barrera, Jan 10 2019

Formula

L(k,n) = L(k,n-1) + L(k,n-2) + ... + L(k,n-k); L(k,n) = -1 for n < 0, and L(k,0) = k.
G.f. for row k: x*(dB(k,x)/dx)/(1-B(k,x)), where B(k,x) = x + x^2 + ... + x^k. - Petros Hadjicostas, Jan 24 2019

Extensions

Corrected by Freddy Barrera, Jan 10 2019

A067400 Non-uniquely factorizable OR-numbrals, i.e., numbrals for which there exist more than one different factorizations into irreducible factors (modulo order).

Original entry on oeis.org

15, 30, 31, 60, 62, 63, 85, 95, 111, 120, 123, 124, 125, 126, 127, 170, 175, 190, 191, 207, 222, 223, 239, 240, 243, 245, 246, 247, 248, 250, 251, 252, 253, 254, 255, 340, 341, 350, 351, 367, 379, 380, 381, 382, 383, 399, 414, 415, 443, 444, 445, 446, 447
Offset: 1

Views

Author

Jens Voß, Jan 24 2002

Keywords

Comments

See A048888 for the definition of OR-numbral arithmetic.

Examples

			15 is in A067400 since [15] = [3] * [5] = [3]^3 and [3] and [5] are irreducible.
		

Crossrefs

Showing 1-10 of 15 results. Next