A062050 n-th chunk consists of the numbers 1, ..., 2^n.
1, 1, 2, 1, 2, 3, 4, 1, 2, 3, 4, 5, 6, 7, 8, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17
Offset: 1
Examples
From _Omar E. Pol_, Aug 31 2013: (Start) Written as irregular triangle with row lengths A000079: 1; 1, 2; 1, 2, 3, 4; 1, 2, 3, 4, 5, 6, 7, 8; 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16; ... Row sums give A007582. (End)
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Paul Barry, Conjectures and results on some generalized Rueppel sequences, arXiv:2107.00442 [math.CO], 2021.
- Ralf Stephan, Some divide-and-conquer sequences with (relatively) simple ordinary generating functions, 2004.
- Ralf Stephan, Table of generating functions. [ps file]
- Ralf Stephan, Table of generating functions. [pdf file]
Programs
-
Haskell
a062050 n = if n < 2 then n else 2 * a062050 n' + m - 1 where (n',m) = divMod n 2 -- Reinhard Zumkeller, May 07 2012
-
Maple
A062050 := proc(n) option remember; if n < 4 then return [1, 1, 2][n] fi; 2*A062050(floor(n/2)) + irem(n,2) - 1 end: seq(A062050(n), n=1..89); # Peter Luschny, Apr 27 2020
-
Mathematica
Flatten[Table[Range[2^n],{n,0,6}]] (* Harvey P. Dale, Oct 12 2015 *)
-
PARI
a(n)=floor(n+1-2^logint(n,2))
-
PARI
a(n)= n - 1<
Ruud H.G. van Tol, Dec 13 2024 -
Python
def A062050(n): return n-(1<
Chai Wah Wu, Jan 22 2023
Formula
a(n) = A053645(n) + 1.
a(n) = n - msb(n) + 1 (where msb(n) = A053644(n)).
a(n) = 1 + n - 2^floor(log(n)/log(2)). - Benoit Cloitre, Feb 06 2003; corrected by Joseph Biberstine (jrbibers(AT)indiana.edu), Nov 25 2008
G.f.: 1/(1-x) * ((1-x+x^2)/(1-x) - Sum_{k>=1} 2^(k-1)*x^(2^k)). - Ralf Stephan, Apr 18 2003
a(1) = 1, a(2*n) = 2*a(n) - 1, a(2*n+1) = 2*a(n). - Ralf Stephan, Oct 06 2003
a(n) = if n < 2 then n else 2*a(floor(n/2)) - 1 + n mod 2. - Reinhard Zumkeller, May 07 2012
Without the constant 1, Ralf Stephan's g.f. becomes A(x) = x/(1-x)^2 - (1/(1-x)) * Sum_{k>=1} 2^(k-1)*x^(2^k) and satisfies the functional equation A(x) - 2*(1+x)*A(x^2) = x*(1 - x - x^2)/(1 - x^2). - Petros Hadjicostas, Apr 27 2020
For n > 0: a(n) = (A006257(n) + 1) / 2. - Frank Hollstein, Oct 25 2021
Comments