OFFSET
1,2
COMMENTS
1/a(n) gives a very rough approximation of the density of 1-bits in the binary representation (A007088) of n. This is 1 if more than half of the bits of n are 1. - Antti Karttunen, Dec 19 2015
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
MATHEMATICA
Table[Floor[IntegerLength[n, 2]/Total@ IntegerDigits[n, 2]], {n, 120}] (* Michael De Vlieger, Dec 21 2015 *)
PROG
(Python)
for n in range(1, 88):
print(str((len(bin(n))-2) // bin(n).count('1')), end=', ')
(PARI) a(n) = #binary(n)\hammingweight(n); \\ Michel Marcus, Dec 19 2015
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Alex Ratushnyak, Dec 18 2015
STATUS
approved