login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A209492
a(0)=1; for n >= 1, let k = floor((1 + sqrt(8*n-7))/2), m = n - (k^2 - k+2)/2. Then a(n) = 2^k + 2^(m+1) - 1.
4
1, 3, 5, 7, 9, 11, 15, 17, 19, 23, 31, 33, 35, 39, 47, 63, 65, 67, 71, 79, 95, 127, 129, 131, 135, 143, 159, 191, 255, 257, 259, 263, 271, 287, 319, 383, 511, 513, 515, 519, 527, 543, 575, 639, 767, 1023, 1025, 1027, 1031, 1039, 1055, 1087, 1151, 1279, 1535, 2047, 2049, 2051, 2055, 2063, 2079, 2111, 2175, 2303, 2559, 3071
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
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
Cf. A000225, A224195 (binary reversal).
Sequence in context: A256862 A173601 A165705 * A118360 A331588 A077799
KEYWORD
nonn,easy,tabl
AUTHOR
Vladimir Shevelev, Mar 09 2012
STATUS
approved