A376617 Binary Niven numbers (A049445) k such that m = k/wt(k) and m/wt(m) are also binary Niven numbers, where wt(k) = A000120(k) is the binary weight of k.
1, 2, 4, 8, 16, 24, 32, 40, 48, 64, 72, 80, 96, 128, 136, 144, 160, 192, 256, 264, 272, 288, 320, 384, 512, 520, 528, 544, 576, 640, 756, 768, 960, 1024, 1032, 1040, 1056, 1088, 1104, 1152, 1280, 1296, 1380, 1472, 1512, 1536, 1620, 1656, 1728, 1840, 1856, 1920, 1944
Offset: 1
Examples
24 is a term since 24/wt(24) = 12 is an integer, 12/wt(12) = 6 is an integer, and 6/wt(6) = 3 is an integer.
Links
- Amiram Eldar, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
q[k_] := Module[{w = DigitCount[k, 2, 1], w2, m, n}, IntegerQ[m = k/w] && Divisible[m, w2 = DigitCount[m, 2, 1]] && Divisible[n = m/w2, DigitCount[n, 2, 1]]]; Select[Range[2000], q]
-
PARI
s(n) = {my(w = hammingweight(n)); if(w == 1, 0, if(n % w, 1, 1 + s(n/w)));} is(k) = {my(sk = s(k)); sk == 0 || sk >= 4;}
Comments