|
|
A113504
|
|
a(0) = 1. For n >= 1, a(n) = number of earlier terms of the sequence that have the same number of ones in their binary representations as n.
|
|
5
|
|
|
1, 1, 2, 0, 3, 1, 1, 0, 5, 2, 2, 0, 2, 0, 0, 0, 8, 2, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 13, 2, 2, 1, 2, 1, 1, 0, 2, 1, 1, 0, 1, 0, 0, 0, 2, 1, 1, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 28, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 0, 2, 0, 0, 0, 2, 2, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 0, 2, 0, 0, 0, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
|
|
LINKS
|
|
|
EXAMPLE
|
The first 8 terms (terms 0 through 7) written in binary are [1,1,10,0,11,1,1,0]. Term 8 gives the number of earlier terms with the same number of 1's in their binary representation as 8 (which is 1000 in binary, for one 1). a(8) = 5 because there are five terms among the earlier terms with one binary 1 (terms with one 1: 1, 1, 2, 1 and 1).
|
|
MATHEMATICA
|
Block[{a = {{1}}}, Do[AppendTo[a, IntegerDigits[#, 2]] &@ Count[a, k_ /; Count[k, 1] == DigitCount[i, 2, 1]], {i, 104}]; FromDigits[#, 2] & /@ a] (* Michael De Vlieger, Sep 05 2017 *)
|
|
PROG
|
(PARI) lista(nn) = {vh = [1]; print1(1, ", "); for (n=1, nn, nb = #select(x->(x==hammingweight(n)), vh); print1(nb, ", "); vh = concat(vh, hammingweight(nb)); ); } \\ Michel Marcus, Sep 06 2017
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|