|
|
A083742
|
|
First differences of A006282.
|
|
1
|
|
|
0, 1, 2, 2, 4, 3, 4, 3, 7, 5, 6, 4, 7, 5, 6, 4, 11, 8, 9, 6, 10, 7, 8, 5, 11, 8, 9, 6, 10, 7, 8, 5, 16, 12, 13, 9, 14, 10, 11, 7, 15, 11, 12, 8, 13, 9, 10, 6, 16, 12, 13, 9, 14, 10, 11, 7, 15, 11, 12, 8, 13, 9, 10, 6, 22, 17, 18, 13, 19, 14, 15, 10, 20, 15, 16, 11, 17
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
REFERENCES
|
D. E. Knuth, Art of Computer Programming, Sorting and Searching, Addison-Wesley, 1973, Section 5.2.2, ex. 14,15.
|
|
LINKS
|
|
|
FORMULA
|
a(0)=0, a(2n)=a(n)+floor(log_2(2n)), a(2n+1)=a(n)+1.
|
|
PROG
|
a(n)=if(n<1, 0, if(n%2==0, a(n/2)+floor(log(n)/log(2)), a((n-1)/2)+1))
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|