A209274 Table T(n,k) = n*(n+2^k-1)/2, n, k > 0 read by antidiagonals.
1, 2, 3, 4, 5, 6, 8, 9, 9, 10, 16, 17, 15, 14, 15, 32, 33, 27, 22, 20, 21, 64, 65, 51, 38, 30, 27, 28, 128, 129, 99, 70, 50, 39, 35, 36, 256, 257, 195, 134, 90, 63, 49, 44, 45, 512, 513, 387, 262, 170, 111, 77, 60, 54, 55, 1024, 1025, 771, 518, 330, 207, 133, 92, 72, 65, 66
Offset: 1
Examples
The start of the sequence as table: 1....2...4...8...16...32...64... 3....5...9..17...33...65..129... 6....9..15..27...51...99..195... 10..14..22..38...70..134..262... 15..20..30..50...90..170..330... 21..27..39..63..111..207..399... 28..35..49..77..133..245..469... . . . The start of the sequence as triangle array read by rows: 1; 2,3; 4,5,6; 8,9,9,10; 16,17,15,14,15; 32,33,27,22,20,21; 64,65,51,38,30,27,28; . . . Row number r contains r numbers.
Links
- Boris Putievskiy, Rows n = 1..140 of triangle, flattened
- Boris Putievskiy, Transformations [of] Integer Sequences And Pairing Functions arXiv:1212.2732 [math.CO], 2012.
Programs
-
Mathematica
b[n_] := n - d[n]*(d[n] + 1)/2; c[n_] := (d[n]^2 + 3*d[n] + 4)/2 - n; d[n_] := Floor[(-1 + Sqrt[8*n - 7])/2]; a[n_] := b[n]*(b[n] + 2^c[n] - 1)/2; Table[a[n], {n, 1, 50}] (* G. C. Greubel, Jan 04 2018 *)
-
PARI
a(n, k) = n*(n+2^k-1)/2 array(rows, cols) = for(x=1, rows, for(y=1, cols, print1(a(x, y), ", ")); print("")) /* Print initial 7 rows and 8 columns of table as follows */ array(7, 8) \\ Felix Fröhlich, Jan 05 2018
-
Python
t=int((math.sqrt(8*n-7) - 1)/ 2) i=n-t*(t+1)/2 j=(t*t+3*t+4)/2-n result = i*(i+2**j-1)/2
Comments