%I #18 Oct 29 2023 17:28:12
%S 1,5,13,47,105,536,1341,9231,24697,212594,592269,6100559,17464969,
%T 209215572,610839805,8338210079,24709115769,378460880126
%N a(n) = smallest number m such that in 1,2,..,m written in base n, no two of the n digits occurs the same number of times.
%e In base 5 in 1,2,..,142_5 = 47, digit 1 occurs 43 times, 2 occurs 20, 3 occurs 19 times, 4 occurs 17 times, and 0 occurs 14.
%o (Python)
%o def different(d):
%o for i in range(len(d)):
%o for j in range(i):
%o if d[i] == d[j]:
%o return False
%o return True
%o def a(base):
%o d = [0] * base
%o n = 0
%o while True:
%o n += 1
%o m = n
%o while m > 0:
%o d[m % base] += 1
%o m //= base
%o if different(d):
%o break
%o return n
%K nonn,base,more
%O 2,2
%A _Jan Fricke_, Dec 15 2008
%E Edited by _Franklin T. Adams-Watters_, Sep 11 2011
%E a(16)-a(19) from _Michael S. Branicky_, Mar 26 2022
|