A339803 Base-10 super-weak Skolem-Langford numbers.
2002, 30003, 131003, 200200, 231213, 300131, 312132, 400004, 420024, 1312132, 1410004, 2002000, 2002002, 2312131, 2312132, 3000300, 4000141, 5000005, 5300035, 12132003, 13100300, 14100141, 14130043, 15100005, 15120025, 20020000, 23121300, 23421314, 25121005, 25320035, 30003000, 30013100, 30023121, 31213200
Offset: 1
Examples
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; 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; 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.
Links
- David A. Corneth, Table of n, a(n) for n = 1..4080 (terms <= 10^12).
- Kevin Ryde, Foma script creating DFA, and testing some properties
Crossrefs
Programs
-
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
-
Python
def nn(ti, t, s): li = s.rfind(t, 0, max(ti, 0)) ri = s.find(t, min(ti+1, len(s)), len(s)) if li==-1: li = -11 if ri==-1: ri = len(s)+11 return min(ti-li, ri-ti) - 1 def ok(n): strn = str(n) if any(strn.count(c)==1 for c in set(strn)): return False for i, c in enumerate(strn): if nn(i, c, strn) != int(c): return False return True for n in range(6*10**6): if ok(n): print(n, end=", ") # Michael S. Branicky, Dec 17 2020
Comments