OFFSET
1,2
COMMENTS
The Hamming weight of a number is given by A000120.
This sequence is a binary variant of A285815.
This sequence is infinite as it contains all powers of 2 (A000079).
All terms belong to A049445.
If k belongs to the sequence, then 2*k belongs to the sequence.
All terms except 1 are even. - Robert Israel, Mar 05 2019
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
For n = 108:
- the divisors of 108 are 1, 2, 3, 4, 6, 9, 12, 18, 27, 36, 54, 108,
- the corresponding Hamming weights are 1, 1, 2, 1, 2, 2, 2, 2, 4, 2, 4, 4,
- they all divide 108,
- hence 108 belongs to the sequence.
For n = 98:
- the divisors of 98 are 1, 2, 7, 14, 49, 98,
- the correspond Hamming weights are 1, 1, 3, 3, 3, 3,
- 3 does not divide 98,
- hence 98 does not belong to the sequence.
MAPLE
filter:= proc(n) local F;
F:= map(convert, map(convert, numtheory:-divisors(n), base, 2), `+`);
andmap(t -> n mod t = 0, F)
end proc:
select(filter, [$1..1000]); # Robert Israel, Mar 05 2019
MATHEMATICA
Select[Range@ 310, With[{k = #}, AllTrue[Divisors@ k, Mod[k, DigitCount[#, 2, 1]] == 0 &]] &] (* Michael De Vlieger, Mar 05 2019 *)
PROG
(PARI) is(n) = fordiv(n, d, if (n%hammingweight(d), return (0))); return ( )
(Magma) [k:k in [1..310]| forall{d:d in Divisors(k)| k mod &+Intseq(d, 2) eq 0}]; // Marius A. Burtea, Dec 30 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Rémy Sigrist, Mar 02 2019
STATUS
approved