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.
%I A358097 #29 Jul 03 2024 01:49:58 %S A358097 1,2,3,4,5,6,7,8,9,10,22,20,30,20,20,20,20,20,20,20,31,30,30,40,30,30, %T A358097 30,30,30,30,41,40,40,40,50,40,40,40,40,40,51,50,50,50,50,60,50,50,50, %U A358097 50,61,60,60,60,60,60,70,60,60,60,71,70,70,70,70,70,70,80,70,70,81,80,80,80,80 %N A358097 a(n) is the smallest integer m > n such that m and n have no common digit, or -1 when such integer m does not exist. %C A358097 When n is pandigital with or without 0 (A050278, A050289, A171102), m does not exist, so a(n) = -1; see examples for smallest pandigital cases. %H A358097 Michel Marcus, <a href="/A358097/b358097.txt">Table of n, a(n) for n = 0..10000</a> %F A358097 a(10^n-k) = 10^n when n >= 2 and 1 <= k <= 8. %F A358097 a(10^n) = 2 * A002275(n+1), when n >= 1. %e A358097 a(10) = 22; a(11) = 20; a(12) = 30. %e A358097 a(123456789) = -1; a(1234567890) = -1. %t A358097 a[n_] := Module[{d = Complement[Range[0, 9], IntegerDigits[n]], m = n + 1}, If[d == {} || d == {0}, -1, While[! AllTrue[IntegerDigits[m], MemberQ[d, #] &], m++]; m]]; Array[a, 100, 0] (* _Amiram Eldar_, Oct 29 2022 *) %o A358097 (PARI) isfull(d) = my(dd=setminus([0..9], d)); (dd==[]) || (dd==[0]); %o A358097 a(n) = my(d=Set(digits(n))); if (isfull(d), -1, my(k=n+1); while (#setintersect(Set(digits(k)), d), k++); k); \\ _Michel Marcus_, Oct 29 2022 %o A358097 (Python) %o A358097 from itertools import count, product %o A358097 def a(n): %o A358097 s = str(n) %o A358097 r = sorted(set("1234567890") - set(s)) %o A358097 if len(r) == 0 or r == ["0"]: return -1 %o A358097 for d in count(len(s)): %o A358097 for p in product(r, repeat=d): %o A358097 m = int("".join(p)) %o A358097 if m > n: return m %o A358097 print([a(n) for n in range(75)]) # _Michael S. Branicky_, Oct 29 2022 %Y A358097 Cf. A002275, A050278, A050289, A171102. %Y A358097 Cf. A030283 (trajectory starting 0). %Y A358097 Cf. A358098 (similar, with largest integer m < n). %K A358097 nonn,base,easy %O A358097 0,2 %A A358097 _Bernard Schott_, Oct 29 2022