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.

Original entry on oeis.org

1, 3, 50, 5, 44, 7, 161, 119, 201, 11, 253, 13, 494, 226, 1444, 17, 799, 19, 437, 1189, 957, 23, 1081, 2263, 755, 767, 927, 29, 932, 31, 1147, 5141, 1191, 1226, 2009, 37, 1517, 1522, 1641, 41, 1927, 43, 2021, 2026, 2164, 47, 2491, 4559, 5001, 2602, 2757, 53, 2972
Offset: 2

Views

Author

Amiram Eldar, Aug 19 2022

Keywords

Examples

			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.
		

Crossrefs

Similar sequence: A249634.

Programs

  • Mathematica
    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]

Formula

a(p) = p for an odd prime p.