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.

A119353 Smallest value obtained by writing n in base b > 1 such that n in base b uses no digit b-1 and then interpreting this as a base b-1 number.

Original entry on oeis.org

0, 1, 2, 2, 3, 4, 5, 6, 6, 4, 5, 9, 6, 7, 12, 12, 9, 10, 11, 16, 12, 13, 14, 20, 15, 16, 17, 8, 9, 25, 10, 11, 18, 19, 20, 24, 12, 13, 23, 14, 15, 25, 26, 31, 32, 33, 34, 42, 35, 36, 32, 33, 34, 35, 40, 36, 37, 38, 39, 45, 40, 41, 42, 43, 27, 28, 29, 46, 30, 31, 32, 55, 33, 34, 35
Offset: 0

Views

Author

Keywords

Comments

The b that produces the smallest value is always the smallest b such that n in base b does not use b-1.

Examples

			10 = 101_3, 101_2 = 5, so a(10) = 5.
11 = 102_3, which has a 2; 11 = 23_4, which has a 3; 11 = 21_5, 21_4 = 9, so a(11) = 9.
		

Crossrefs

Cf. A119352.

Programs

  • Mathematica
    a[n_] := Module[{b = 2}, While[MemberQ[IntegerDigits[n, b], b-1], b++]; FromDigits[IntegerDigits[n, b], b-1]]; Array[a, 100, 0] (* Amiram Eldar, Jul 29 2025 *)
  • PARI
    a(n) = for (b=3, oo, my (d=digits(n, b)); if (#d==0 || vecmax(d) < b-1, return (fromdigits(d, b-1)))) \\ Rémy Sigrist, May 07 2018