|
|
A141612
|
|
Write down 0,1,2,3,...n each in binary. Total up the number of 1's in each bit-position (total number of 1's in 1's position, total number of 1's in 2's position, total number of 1's in 4's position, etc.). a(n) = the number of such totals that each do not equal any other such total.
|
|
1
|
|
|
0, 1, 0, 0, 1, 1, 0, 0, 1, 2, 2, 0, 0, 1, 0, 0, 1, 2, 1, 1, 3, 3, 2, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 2, 1, 1, 2, 2, 1, 1, 3, 4, 4, 2, 2, 3, 2, 0, 0, 1, 0, 0, 2, 2, 1, 0, 0, 1, 1, 0, 0, 1, 0, 0, 1, 2, 1, 1, 2, 2, 1, 1, 2, 3, 3, 1, 1, 2, 1, 1, 3, 4, 3, 3, 5, 5, 4, 2, 2, 3, 3, 2, 2, 3, 2, 0, 0, 1, 0, 0, 1, 1, 0, 0, 2
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,10
|
|
LINKS
|
|
|
EXAMPLE
|
For n= 9, we have (with leading zeros written) 0 through 9 in binary:
0000
0001
0010
0011
0100
0101
0110
0111
1000
1001
The number of 1's in the ones position (the rightmost position) is 5. The number of 1's in the 2's position (second position from the right) is 4. The number of 1's in the 4's position is 4. The number of 1's in the 8's position (the leftmost position here) is 2. Now, the total 4 occurs twice. But the total 2 occurs once, as does the total 5. Since two totals occur once each, then a(9) = 2.
|
|
MAPLE
|
A070939 := proc(n) max(1, ilog2(n)+1) ; end: A141612aux := proc(L, c) local a, i ; a := 0 ; for i in L do a := a+1-min(1, abs(i-c)) ; od; a ; end: A141612 := proc(n) local a, k, p, bds, i; if n = 0 then RETURN(0) ; fi; a := [seq(0, i=1..A070939(n))]; for k from 0 to n do bds := convert(k, base, 2) ; for p from 1 to nops(bds) do a := subsop( p=op(p, a)+op(p, bds), a) ; od: od: bds := 0 ; for i in a do if A141612aux(a, i) = 1 then bds := bds+1; fi; od; bds; end: for n from 0 to 120 do printf("%d, ", A141612(n)) ; od: # R. J. Mathar, Sep 12 2008
|
|
PROG
|
(Python)
from collections import Counter
def bin_i(n): #binary indices
return([(i) for i, x in enumerate(bin(n)[2:][::-1]) if x =='1'])
A, C = [], Counter()
for n in range(n_max+1):
for i in bin_i(n): C.update({i})
B, x = list(C.values()), 0
for k in B:
if B.count(k) == 1: x += 1
A.append(x)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,base,easy
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|