OFFSET
1,2
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
FORMULA
Floor(log_2(n)) <= a(n) <= n. - Charles R Greathouse IV, Feb 11 2014
EXAMPLE
The integers 1 through 9 in binary are (1, 10, 11, 100, 101, 110, 111, 1000, 1001). So the numbers of 1's in these binary representations form the sequence (1,1,2,1,2,2,3,1,2,...) (sequence A000120, starting from A000120(1)). 9 is coprime to 8 of these integers. (9 is coprime to all of these integers except the 3.) So a(9) = 8.
MATHEMATICA
a[n_] := Sum[Boole[CoprimeQ[n, DigitCount[k, 2, 1]]], {k, 1, n}]; Array[a, 100] (* Amiram Eldar, Jul 16 2023 *)
PROG
(PARI) a(n) = sum(k=1, n, gcd(hammingweight(k), n) == 1); \\ Michel Marcus, Feb 10 2014
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Leroy Quet, Mar 25 2008
EXTENSIONS
More terms from Michel Marcus, Feb 10 2014
STATUS
approved