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 A339803 #40 Feb 13 2023 12:28:32 %S A339803 2002,30003,131003,200200,231213,300131,312132,400004,420024,1312132, %T A339803 1410004,2002000,2002002,2312131,2312132,3000300,4000141,5000005, %U A339803 5300035,12132003,13100300,14100141,14130043,15100005,15120025,20020000,23121300,23421314,25121005,25320035,30003000,30013100,30023121,31213200 %N A339803 Base-10 super-weak Skolem-Langford numbers. %C A339803 Pick any digit d of a(n): there are exactly d digits between d and the closest duplicate of d (either before or after) inside a(n). %C A339803 There are infinitely many such terms. %C A339803 From _M. F. Hasler_, Dec 19 2020: (Start) %C A339803 If N is a term of the sequence, then: %C A339803 (1) Any digit of N must be present at least twice in N (cf. A115853). %C A339803 (2) N*10^k is also a term of the sequence, for all k >= 2. %C A339803 (3) The reversal R(N) = A004086(N) is also a term (with leading zeros deleted). (End) %H A339803 David A. Corneth, <a href="/A339803/b339803.txt">Table of n, a(n) for n = 1..4080</a> (terms <= 10^12). %H A339803 Kevin Ryde, <a href="/A339803/a339803.foma.txt">Foma script creating DFA, and testing some properties</a> %e A339803 a(1) = 2002: in 2002 the closest duplicate of the first 2 is 2 positions away to the right, the closest duplicate of the first 0 is 0 position away to the right, the closest duplicate of the second 0 is 0 position away to the left, the closest duplicate of the second 2 is 2 positions away to the left; %e A339803 a(2) = 30003: in 30003 the closest duplicate of the first 3 is 3 positions away to the right, the closest duplicate of the first 0 is 0 position away to the right, the closest duplicate of the second 0 is 0 position away (either to the left or to the right), the closest duplicate of the third 0 is 0 position away to the left, the closest duplicate of the second 3 is 3 positions away to the left; %e A339803 a(13) = 2312131: if you pick any digit 1, the closest duplicate of this 1 is 1 position away (either to the left or to the right), if you pick any 2, the closest duplicate of this 2 is 2 positions away, if you pick any 3, the closest duplicate of this 3 is 3 positions away, etc. %o A339803 (Python) %o A339803 def nn(ti, t, s): %o A339803 li = s.rfind(t, 0, max(ti, 0)) %o A339803 ri = s.find(t, min(ti+1, len(s)), len(s)) %o A339803 if li==-1: li = -11 %o A339803 if ri==-1: ri = len(s)+11 %o A339803 return min(ti-li, ri-ti) - 1 %o A339803 def ok(n): %o A339803 strn = str(n) %o A339803 if any(strn.count(c)==1 for c in set(strn)): return False %o A339803 for i, c in enumerate(strn): %o A339803 if nn(i, c, strn) != int(c): return False %o A339803 return True %o A339803 for n in range(6*10**6): %o A339803 if ok(n): print(n, end=", ") # _Michael S. Branicky_, Dec 17 2020 %o A339803 (PARI) is_A339803(n)={!for(i=1,#n=digits(n), (i>n[i]+1 && n[i-n[i]-1]==n[i])||(i+n[i]<#n && n[i+n[i]+1]==n[i])||return; for(j=max(i-n[i],1), min(i+n[i],#n), n[j]==n[i] && j!=i && return))} \\ _M. F. Hasler_, Dec 19 2020 %Y A339803 Cf. base-10 Skolem-Langford numbers: A108116 (weak), A357826 (weaker), A132291 (strong). %Y A339803 Cf. A339611 (same idea turned into a different sequence). %Y A339803 Cf. A115853. %K A339803 base,nonn %O A339803 1,1 %A A339803 _Eric Angelini_ and _Carole Dubois_, Dec 17 2020