cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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.

Original entry on oeis.org

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

Views

Author

Vladimir Shevelev, Mar 09 2012

Keywords

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

Examples

			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.
		

Crossrefs

Cf. A000225, A224195 (binary reversal).

Programs

  • 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}]

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.