The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A354049 The smallest number that includes all the digits of n but does not equal n. 4
10, 10, 12, 13, 14, 15, 16, 17, 18, 19, 100, 101, 21, 31, 41, 51, 61, 71, 81, 91, 102, 12, 122, 32, 42, 52, 62, 72, 82, 92, 103, 13, 23, 133, 43, 53, 63, 73, 83, 93, 104, 14, 24, 34, 144, 54, 64, 74, 84, 94, 105, 15, 25, 35, 45, 155, 65, 75, 85, 95, 106, 16, 26, 36, 46, 56, 166, 76, 86, 96, 107 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,1
COMMENTS
The terms cannot start with a leading zero so any number including a zero must have at least one digit greater than zero as its first digit. See the examples below.
LINKS
Scott R. Shannon, Image of the first 100000 terms. The green line is y = n.
EXAMPLE
a(9) = 19 as there is no smaller number that includes the digit 9 but does not equal 9.
a(10) = 100 as there is no smaller number that includes the digits 1 and 0 but does not equal 10. Note that '01' = 1 is not allowed.
a(20) = 102 as there is no smaller number that includes the digits 2 and 0 but does not equal 20. Note that '02' = 2 is not allowed.
a(22) = 122 as there is no smaller number that includes two 2 digits but does not equal 22.
a(200) = 1002 as there is no smaller number that includes two 0 digits and the digit 2 but does not equal 200.
PROG
(PARI) vd(n) = my(d=if (n, digits(n), [0])); vector(10, k, #select(x->(x==k-1), d));
isok(k, n, d) = if (k!=n, my(dd=vd(k)); for (i=1, #d, if (dd[i] < d[i], return(0))); return(1));
a(n) = my(k=0, d=vd(n)); while(!isok(k, n, d), k++); k; \\ Michel Marcus, May 17 2022
(Python)
def ok(k, n):
if k == n: return False
sk, sn = str(k), str(n)
return all(sk.count(d) >= sn.count(d) for d in set(sn))
def a(n):
k = 0
while not ok(k, n): k += 1
return k
print([a(n) for n in range(71)]) # Michael S. Branicky, May 23 2022
CROSSREFS
Sequence in context: A111381 A369604 A063660 * A354113 A354114 A175220
KEYWORD
nonn,base,look
AUTHOR
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 21 15:47 EDT 2024. Contains 372738 sequences. (Running on oeis4.)