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.

Showing 1-1 of 1 results.

A119352 Smallest base b > 1 such that n in base b uses no digit b-1.

Original entry on oeis.org

2, 3, 4, 3, 3, 4, 4, 5, 4, 3, 3, 5, 3, 3, 6, 5, 4, 4, 4, 6, 4, 4, 4, 7, 4, 4, 4, 3, 3, 7, 3, 3, 4, 4, 4, 5, 3, 3, 4, 3, 3, 4, 4, 5, 6, 6, 6, 9, 6, 6, 5, 5, 5, 5, 6, 5, 5, 5, 5, 7, 5, 5, 5, 5, 4, 4, 4, 5, 4, 4, 4, 7, 4, 4, 4, 5, 5, 5, 5, 6, 4, 3, 3, 5, 3, 3, 4, 5, 4, 4, 3, 3, 5, 3, 3, 9, 4, 4, 4, 6, 4, 4, 4, 7, 4
Offset: 0

Views

Author

Keywords

Examples

			7 is 111_2 (has 1), 21_3 (has 2), 13_4 (has 3), but 12_5 (no 4), so a(7) = 5.
		

Crossrefs

Programs

  • Haskell
    a119352 n = f 2 n where
       f b x = g x where
         g 0 = b
         g z = if r == b - 1 then f (b + 1) n else g z'
               where (z', r) = divMod z b
    -- Reinhard Zumkeller, Apr 12 2015
    
  • Maple
    f:= proc(n) local b;
        for b from 2 do if not member(b-1,convert(n,base,b)) then return b fi od
    end proc:
    map(f, [$0..200]); # Robert Israel, Sep 07 2025
  • Mathematica
    a[n_] := Module[{b = 2}, While[MemberQ[IntegerDigits[n, b], b-1], b++]; b]; Array[a, 100, 0] (* Amiram Eldar, Jul 29 2025 *)
  • PARI
    a(n) = {my(b = 2, d); while(d = digits(n, b); #d > 0 && vecmax(d) == b-1, b++); b;} \\ Amiram Eldar, Jul 29 2025
    
  • Python
    from itertools import count
    from sympy.ntheory import digits
    def a(n): return next(b for b in count(2) if b-1 not in digits(n, b))
    print([a(n) for n in range(105)]) # Michael S. Branicky, Sep 07 2025
Showing 1-1 of 1 results.