%I #12 Aug 23 2022 10:50:20
%S 1,3,50,5,44,7,161,119,201,11,253,13,494,226,1444,17,799,19,437,1189,
%T 957,23,1081,2263,755,767,927,29,932,31,1147,5141,1191,1226,2009,37,
%U 1517,1522,1641,41,1927,43,2021,2026,2164,47,2491,4559,5001,2602,2757,53,2972
%N a(n) is the least number k such that the least base in which k is a Niven number is n, i.e., A356552(k) = n, or -1 if no such k exists.
%H Amiram Eldar, <a href="/A356640/b356640.txt">Table of n, a(n) for n = 2..1368</a>
%F a(p) = p for an odd prime p.
%e a(3) = 3 since 3 is a Niven number in base 3 and in no other base smaller than 3. 1 and 2 are also Niven numbers in base 3, but they are also Niven numbers in base 2.
%t f[n_] := Module[{b = 2}, While[! Divisible[n, Plus @@ IntegerDigits[n, b]], b++]; b]; A356640[len_, nmax_] := Module[{s = Table[0, {len}], c = 0, n = 1, i}, While[c < len && n < nmax, i = f[n] - 1; If[i <= len && s[[i]] == 0, c++; s[[i]] = n]; n++]; s]; A356640[50, 10^4]
%Y Cf. A005349, A049445, A064150, A064438, A064481, A356552.
%Y Similar sequence: A249634.
%K nonn,base
%O 2,2
%A _Amiram Eldar_, Aug 19 2022
|