cp's OEIS Frontend

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.

A354114 The smallest number that contains all the digits of n as a substring but does not equal n.

This page as a plain text file.
%I A354114 #10 May 17 2022 17:49:51
%S A354114 10,10,12,13,14,15,16,17,18,19,100,110,112,113,114,115,116,117,118,
%T A354114 119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,
%U A354114 136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153
%N A354114 The smallest number that contains all the digits of n as a substring but does not equal n.
%C A354114 Suppose that n > 0 is a k-digit number. If 10^(k-1) <= a(n) <= (10^k-1)/9, then a(n) is obtained by placing a 0 after n; otherwise a(n) is obtained by placing a 1 before n.
%H A354114 Jianing Song, <a href="/A354114/b354114.txt">Table of n, a(n) for n = 0..10000</a>
%F A354114 If 10^k <= n <= (10^(k+1)-1)/9, a(n) = 10*n; if (10^(k+1)-1)/9 <= n < 10^(k+1), a(n) = n + 10^(k+1).
%e A354114 The smallest number not equal to 111 containing the substring "111" in its decimal expansion is 1110, so a(111) = 1110.
%e A354114 The smallest number not equal to 112 containing the substring "112" in its decimal expansion is 1112, so a(112) = 1112.
%o A354114 (PARI) a(n) = if(n==0, 10, my(k=logint(n,10)); if(n<=10^(k+1)\9, 10*n, n+10^(k+1)))
%o A354114 (Python)
%o A354114 def a(n):
%o A354114     if n == 0: return 10
%o A354114     s = str(n)
%o A354114     return n*10 if s <= "1"*len(s) else int("1"+s)
%o A354114 print([a(n) for n in range(54)]) # _Michael S. Branicky_, May 17 2022
%Y A354114 Cf. A354049, A354113.
%K A354114 nonn,base,easy
%O A354114 0,1
%A A354114 _Jianing Song_, May 17 2022