OFFSET
0,2
COMMENTS
From a TV show.
A129142 and A129143 are similar, slightly more natural, but for a puzzle perhaps too transparent sequences.
Can be seen as a triangle (row by step) read by rows: T(n,k) = T(n-1,k) + 2^n for k < n and T(n,n) = T(n-1,n-1) + 2^n + 1. - Reinhard Zumkeller, Nov 16 2013
LINKS
Reinhard Zumkeller, Rows n = 0..125 of triangle, flattened
EXAMPLE
In step 1 starting number 0 is appended to the empty sequence and the next starting number is 2*0 + 2 = 2. In step 2 the two numbers 2, 3 are appended and the starting number is changed to 2*2 + 2 = 6.
MATHEMATICA
Table[ Range[2^k-2, 2^k+k-3], {k, 1, 11}] // Flatten (* Jean-François Alcover, Oct 07 2013, after Klaus Brockhaus *)
Join[{0}, Flatten[With[{nn=10}, Range[#[[1]], Total[#]]&/@Thread[ {Accumulate[ 2^Range[nn]], Range[nn]}]]]] (* Harvey P. Dale, Nov 05 2017 *)
PROG
(PARI) {v=[]; s=0; for(k=1, 11, w=vector(k, j, j+s-1); s=2*s+2; v=concat(v, w)); for(n=1, #v, print1(v[n], ", "))} \\ Klaus Brockhaus, Mar 31 2007
(Magma) &cat[ [2^k-2..2^k+k-3]: k in [1..11] ]; // Klaus Brockhaus, Mar 31 2007
(Haskell)
a127330 n k = a127330_tabl !! n !! k
a127330_row n = a127330_tabl !! n
a127330_tabl = step 0 1 where
step s k = [s .. s + k - 1] : step (2 * s + 2) (k + 1)
-- Reinhard Zumkeller, Nov 16 2013
CROSSREFS
KEYWORD
AUTHOR
Steven Cartier (steven.cartier(AT)rogers.com), Mar 30 2007
EXTENSIONS
Edited and extended by Klaus Brockhaus, Mar 31 2007
Keyword tabl added and offset changed by Reinhard Zumkeller, Nov 16 2013
STATUS
approved