cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A356640 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.

This page as a plain text file.
%I A356640 #12 Aug 23 2022 10:50:20
%S A356640 1,3,50,5,44,7,161,119,201,11,253,13,494,226,1444,17,799,19,437,1189,
%T A356640 957,23,1081,2263,755,767,927,29,932,31,1147,5141,1191,1226,2009,37,
%U A356640 1517,1522,1641,41,1927,43,2021,2026,2164,47,2491,4559,5001,2602,2757,53,2972
%N A356640 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 A356640 Amiram Eldar, <a href="/A356640/b356640.txt">Table of n, a(n) for n = 2..1368</a>
%F A356640 a(p) = p for an odd prime p.
%e A356640 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 A356640 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 A356640 Cf. A005349, A049445, A064150, A064438, A064481, A356552.
%Y A356640 Similar sequence: A249634.
%K A356640 nonn,base
%O A356640 2,2
%A A356640 _Amiram Eldar_, Aug 19 2022