login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A138664
a(n) = number of positive integers k, k <= n, where the number of one's in the binary representation of each k divides n.
2
1, 2, 2, 4, 3, 6, 3, 7, 5, 9, 4, 12, 4, 10, 8, 12, 5, 17, 5, 15, 11, 14, 5, 24, 5, 15, 14, 18, 5, 25, 5, 21, 16, 18, 7, 35, 6, 19, 19, 27, 6, 35, 6, 27, 23, 20, 6, 46, 6, 23, 24, 31, 6, 40, 9, 33, 26, 21, 6, 60, 6, 21, 26, 37, 13, 45, 7, 40, 29, 31, 7, 66, 7, 26, 38, 43, 7, 53, 7, 53, 34
OFFSET
1,2
LINKS
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) (the first 9 terms of sequence A000120, starting from A000120(1)). 9 is divisible by all the 1's (there are 4 of those) and by the one 3. So a(9) = 4+1 = 5.
MATHEMATICA
a[n_] := Sum[Boole[Divisible[n, DigitCount[k, 2, 1]]], {k, 1, n}]; Array[a, 100] (* Amiram Eldar, Jul 16 2023 *)
CROSSREFS
Sequence in context: A089173 A126090 A058266 * A140357 A352622 A089265
KEYWORD
nonn,base
AUTHOR
Leroy Quet, Mar 25 2008
EXTENSIONS
Corrected and extended by Sean A. Irvine, Oct 12 2009
STATUS
approved