OFFSET
1,2
COMMENTS
See A126688 for another version of the same sequence. - R. J. Mathar, Jun 15 2008
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
EXAMPLE
n=10: 1010 [b=2] = 101 [b=3] = 22 [b=4] = 20 [b=5]: a(10)=5;
n=11: 1011 [b=2] = 102 [b=3]: a(11)=3;
n=12: 1100 [b=2] = 110 [b=3] = 30 [b=4]: a(12)=4;
n=13: 1101 [b=2] = 111 [b=3] = 31 [b=4]: a(13)=4;
n=14: 1110 [b=2] = 112 [b=3] = 32 [b=4]: a(14)=4;
n=15: 1111 [b=2] = 120 [b=3]: a(15)=3.
PROG
(PARI) a(n) = if (n==1, 1, my(b = 2, do = 1); while (do, vb = digits(n, b); if (#vb == #Set(vb), do = 0, b++); ); b); \\ Michel Marcus, Jun 09 2013; corrected Jun 14 2022
(Python)
from sympy.ntheory.digits import digits
def distinct(n, b): d = digits(n, b); return len(d) == len(set(d))
def a(n):
if n == 1: return 1
b = 2
while not distinct(n, b): b += 1
return b
print([a(n) for n in range(1, 106)]) # Michael S. Branicky, Jun 15 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Oct 08 2006
STATUS
approved