OFFSET
0,2
COMMENTS
The sequence is concatenation of rows of triangle which begins
i\j | 0 1 2 3 4 5 6 7 8
======+====================================================
0 | 1
1 | 3 5
2 | 7 9 11
3 | 15 17 19 23
4 | 31 33 35 39 47
5 | 63 65 67 71 79 95
6 | 127 129 131 135 143 159 191
7 | 255 257 259 263 271 287 319 383
8 | 511 513 515 519 527 543 575 639 767
LINKS
G. C. Greubel, Table of n, a(n) for n = 0..1000
FORMULA
For i=0,1,..., the i-th row is 2^(i+1)-1, if j=0, and 2^(i+1)+2^j-1, if j=1,...,i.
EXAMPLE
Consider n=19. Then k = floor((1 + sqrt(145))/2) = 6 and m = 19 - 16 = 3. Thus a(19) = 2^6 + 2^4 - 1 = 79.
MATHEMATICA
k = Floor[(1 + Sqrt[8*n - 7])/2]; m = n - (k^2 - k + 2)/2; a[n_] = If[n == 0, 1, 2^k + 2^(m + 1) - 1]; Table[a[n], {n, 0, 100}]
CROSSREFS
KEYWORD
AUTHOR
Vladimir Shevelev, Mar 09 2012
STATUS
approved