|
| |
|
|
A053645
|
|
Distance to largest power of 2 less than or equal to n; write n in binary and change the first digit to zero.
|
|
27
| |
|
|
0, 0, 1, 0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
(list; graph; refs; listen; history; internal format)
|
|
|
|
OFFSET
| 1,6
|
|
|
COMMENTS
| Cf. A083741.
a(A004760(n+1)) = n. [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), May 20 2009]
|
|
|
REFERENCES
| J.-P. Allouche and J. Shallit, The ring of k-regular sequences, Theoretical Computer Sci., 98 (1992), 163-197 (see Ex. 24).
|
|
|
LINKS
| J.-P. Allouche and J. Shallit, The ring of k-regular sequences, Theoretical Computer Sci., 98 (1992), 163-197.
|
|
|
FORMULA
| a(n)=n-2^A000523(n)
G.f.: 1/(1-x) * ((2x-1)/(1-x) + sum_{k>=1} 2^(k-1)*x^2^k). - Ralf Stephan (ralf(AT)ark.in-berlin.de), Apr 18 2003
a(1) = 0, a(2n) = 2a(n), a(2n+1) = 2a(n)+1.
a(n)=f(n-1,1) with f(n,m) = if n<m then n else f(n-m,2*m). [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), May 20 2009]
|
|
|
CROSSREFS
| Cf. A053644.
a(n) = (A006257(n)-1)/2.
A062050(n) - 1.
A002262, A160588. [From Reinhard Zumkeller (reinhard.zumkeller(AT)gmail.com), May 20 2009]
Sequence in context: A124757 A049263 A014588 * A170899 A179392 A106730
Adjacent sequences: A053642 A053643 A053644 * A053646 A053647 A053648
|
|
|
KEYWORD
| easy,nonn
|
|
|
AUTHOR
| Henry Bottomley (se16(AT)btinternet.com), Mar 22 2000
|
| |
|
|