|
|
A306263
|
|
Numbers k such that, for any divisor d of k, the Hamming weight of d divides k.
|
|
3
|
|
|
1, 2, 4, 6, 8, 10, 12, 16, 18, 20, 24, 32, 34, 36, 40, 42, 48, 60, 64, 66, 68, 72, 80, 84, 92, 96, 108, 116, 120, 126, 128, 132, 136, 144, 156, 160, 168, 172, 180, 184, 192, 204, 212, 216, 222, 228, 232, 240, 246, 252, 256, 264, 272, 276, 284, 288, 300, 310
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
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).
If k belongs to the sequence, then 2*k belongs to the sequence.
|
|
LINKS
|
|
|
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:
|
|
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
|
|
|
STATUS
|
approved
|
|
|
|