OFFSET
1,2
COMMENTS
Proposed name: N-fusc.
Each number n>0 appears in this sequence exactly n times.
From Yosu Yurramendi, Apr 08 2019: (Start)
The terms (n>0) may be written as a left-justified array with rows of length 2^m:
1,
2, 2,
3, 3, 4, 3,
4, 4, 6, 5, 6, 5, 6, 4,
5, 5, 8, 7, 9, 8, 10, 7, 8, 7, 10, 8, 9, 7, 8, 5,
6, 6, 10, 9, 12, 11, 14, 10, 12, 11, 16, 13, 15, 12, 14, 9, 10, 9, ...
...
as well as right-justified fashion:
1,
2, 2,
3, 3, 4, 3,
4, 4, 6, 5, 6, 5, 6, 4,
5, 5, 8, 7, 9, 8, 10, 7, 8, 7, 10, 8, 9, 7, 8, 5,
... 14, 9, 10, 9, 14, 12, 15, 13, 16, 11, 12, 10, 14, 11, 12, 9, 10, 6,
From these two dispositions interesting properties can be induced (see FORMULA section)
(End)
LINKS
I. V. Serov, Table of n, a(n) for n = 1..8192
FORMULA
MATHEMATICA
Table[Block[{a = 1, b = 0, m = n}, While[m > 0, If[OddQ@ m, b = a + b, a = a + b]; m = Floor[m/2]]; b] IntegerExponent[2 n, 2], {n, 89}] (* Michael De Vlieger, Jun 14 2017, after Jean-François Alcover at A002487 *)
PROG
(Python)
from functools import reduce
def A287896(n): return (n&-n).bit_length()*sum(reduce(lambda x, y:(x[0], x[0]+x[1]) if int(y) else (x[0]+x[1], x[1]), bin(n)[-1:2:-1], (1, 0))) # Chai Wah Wu, Jul 14 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
I. V. Serov, Jun 02 2017
STATUS
approved