OFFSET
1,1
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..400 (calculated using a binary version of Hiroaki Yamanouchi's Python code at A140866)
Jean-Marie De Koninck, Nicolas Doyon and Imre Kátai, On the counting function for the Niven numbers, Acta Arithmetica, Vol. 106, No. 3 (2003), 265-275.
FORMULA
a(n) ~ 2^(n+1)/n (De Koninck et al., 2003, consequence of Theorem 1).
EXAMPLE
a(1) = 2 since there are 2 binary Niven numbers not exceeding 2^1: 1 and 2.
MATHEMATICA
binNivenQ[n_] := Divisible[n, DigitCount[n, 2, 1]]; s = {}; c = 0; p = 2; Do[If[binNivenQ[n], c++]; If[n == p, AppendTo[s, c]; p *= 2], {n, 1, 2^20}]; s
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Amiram Eldar, Aug 14 2020
STATUS
approved