login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A095204
a(n) is the smallest number greater than a(n-1) such that in a(0) through a(n) no digit occurs more than once more than any other digit.
4
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 23, 45, 67, 89, 90, 123, 456, 478, 501, 623, 789, 790, 812, 3456, 3457, 6012, 6089, 7123, 8459, 8460, 9123, 9157, 20345, 20678, 31456, 31789, 40256, 40789, 51236, 51789, 60234, 60789, 71234, 71589, 80234, 80569, 91234, 91567
OFFSET
0,3
COMMENTS
Question: Formula for a(n)?
Note that, almost always, if the number of digits in a(0) through a(n) is a multiple of 10, a(n+1) = a(n) + 1. (The only exceptions would be if a(n) + 1 had some digit two more times than some other digit.) - Franklin T. Adams-Watters, Jan 11 2006
LINKS
EXAMPLE
After 10 the next term is 23 and not 11. Any number containing 0 or 1 would occur only after all the digits from 2 to 9 have occurred once.
MAPLE
counts:= Array(0..9):
cp:= Array(0..9):
counts[0]:= 1:
A[0]:= 0:
for n from 1 to 70 do
for x from A[n-1]+1 do
L:= convert(x, base, 10);
ArrayTools:-Copy(counts, cp);
for t in L do cp[t]:= cp[t]+1 od:
if max(cp) - min(cp) <= 1 then
A[n]:= x;
ArrayTools:-Copy(cp, counts);
break
fi
od
od:
seq(A[i], i=0..70); # Robert Israel, Sep 03 2015
CROSSREFS
Cf. A120125 (non-monotonic version).
Sequence in context: A120125 A345227 A333832 * A106604 A095205 A344325
KEYWORD
base,nonn
AUTHOR
Amarnath Murthy, Jun 06 2004
EXTENSIONS
Edited, corrected and extended by Franklin T. Adams-Watters, Jan 11 2006
STATUS
approved