login
A120367
a(1) = 1. a(n) = a(n-1) + (maximum number of 1's occurring in the binary representation of any of the sequence's earlier terms).
1
1, 2, 3, 5, 7, 10, 13, 16, 19, 22, 25, 28, 31, 36, 41, 46, 51, 56, 61, 66, 71, 76, 81, 86, 91, 96, 101, 106, 111, 117, 123, 129, 135, 141, 147, 153, 159, 165, 171, 177, 183, 189, 195, 201, 207, 213, 219, 225, 231, 237, 243, 249, 255, 263, 271, 279, 287, 295, 303, 311
OFFSET
1,2
LINKS
EXAMPLE
When considering the first 14 terms of the sequence, a(13) = 31 has the greatest number of 1's in its binary representation, 5 ones. So a(15) = a(14) + 5 = 41.
MAPLE
A000120 := proc(n) local br, i; br := convert(n, base, 2); sum(op(i, br), i=1..nops(br)); end: A120367 := proc(nmax) local a, bmax, anew; a := [1]; bmax := 1; while nops(a) < nmax do anew := op(-1, a)+bmax; a := [op(a), anew]; bmax := max(bmax, A000120(anew)); od; RETURN(a); end; print(A120367(80) ); # R. J. Mathar, Dec 16 2006
MATHEMATICA
mx1 = 1; NestList[# + (mx1 = Max[Total@IntegerDigits[#, 2], mx1]) &, 1, 60] (* Ivan Neretin, May 17 2018 *)
CROSSREFS
Cf. A000120.
Sequence in context: A064509 A096221 A258084 * A072831 A072388 A101433
KEYWORD
nonn,base
AUTHOR
Leroy Quet, Jun 26 2006
EXTENSIONS
More terms from R. J. Mathar, Dec 16 2006
STATUS
approved