OFFSET
1,2
COMMENTS
Every binary Niven number is of the form m*2^k, where m is a term of this sequence and k >= 0.
Includes all the odd binary Niven numbers (A144302).
This sequence is infinite. E.g., 16^k + 4^k + 1 is a term for all k >= 1.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
EXAMPLE
6 is a term as 6 is a binary Niven number and 6/2 = 3 is not a binary Niven number.
MATHEMATICA
binNivQ[n_] := Divisible[n, DigitCount[n, 2, 1]]; q[n_] := binNivQ[n] && ! (EvenQ[n] && binNivQ[n/2]); Select[Range[500], q]
PROG
(PARI) isbinniv(n) = !(n % hammingweight(n));
is(n) = isbinniv(n) && !(!(n%2) && isbinniv(n/2));
CROSSREFS
KEYWORD
nonn,easy,base
AUTHOR
Amiram Eldar, Jun 22 2023
STATUS
approved
