login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

The number of binary Niven numbers (A049445) not exceeding 2^n.
2

%I #12 Aug 14 2020 11:12:51

%S 2,3,5,8,13,21,37,65,124,232,431,760,1424,2575,4772,8932,17033,32225,

%T 61764,117897,224944,428155,814294,1547596,2934212,5572886,10609364,

%U 20237826,38773350,74609953,144275968,280018507,545782822,1064716523,2081890937,4068716054

%N The number of binary Niven numbers (A049445) not exceeding 2^n.

%H Amiram Eldar, <a href="/A337078/b337078.txt">Table of n, a(n) for n = 1..400</a> (calculated using a binary version of _Hiroaki Yamanouchi_'s Python code at A140866)

%H Jean-Marie De Koninck, Nicolas Doyon and Imre Kátai, <a href="https://eudml.org/doc/278575">On the counting function for the Niven numbers</a>, Acta Arithmetica, Vol. 106, No. 3 (2003), 265-275.

%F a(n) ~ 2^(n+1)/n (De Koninck et al., 2003, consequence of Theorem 1).

%e a(1) = 2 since there are 2 binary Niven numbers not exceeding 2^1: 1 and 2.

%t 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

%Y Cf. A049445, A140866.

%K nonn,base

%O 1,1

%A _Amiram Eldar_, Aug 14 2020