A132291
Base 10 strong Skolem-Langford numbers.
Original entry on oeis.org
12132003, 23121300, 30023121, 31213200, 1214230043, 1312432004, 2342131400, 2412134003, 3004312142, 3400324121, 4002342131, 4131243200, 1213267345006475, 1213275364005746, 1214267540036573, 1214273645300765, 1214275640035763, 1215247365430076
Offset: 1
Base 10 Skolem-Langford numbers are in
A108116.
Base 10 weaker Skolem-Langford numbers are in
A357826.
-
def A132291gen(): # SL() is in A108116
for numd in range(1, 11):
dset = ("0123456789")[:numd]
s = [0 for _ in range(2*numd)]
for an in sorted(SL(dset, s)):
yield an
for n, an in enumerate(A132291gen(), start=1):
print(n, an) # Michael S. Branicky, Dec 14 2020
A108116
Base 10 weak Skolem-Langford numbers.
Original entry on oeis.org
2002, 131003, 231213, 300131, 312132, 420024, 12132003, 14130043, 15120025, 23121300, 23421314, 25121005, 25320035, 30023121, 31213200, 31413004, 34003141, 40031413, 41312432, 45001415, 45121425, 45300435, 50012152, 51410054, 52002151, 52412154, 53002352, 53400354, 61310036
Offset: 1
In "2002" there are 2 digits between the two 2's and 0 digits between the two 0's.
In "131003" there is 1 digit between the two 1's, 3 digits between the two 3's and 0 digit between the two 0's.
- E. Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.
Base 10 strong Skolem-Langford numbers are in
A132291.
Base 10 weaker Skolem-Langford numbers are in
A357826.
-
def SL(d, s):
for i1 in range(int(d[0]=="0"), len(s)-int(d[0])-1):
i2 = i1 + int(d[0]) + 1
if not (s[i1] or s[i2]):
s[i1] = s[i2] = d[0]
r = d[1:]
if r: yield from SL(r, s)
else: yield int("".join(s))
s[i1] = s[i2] = 0
from itertools import chain, combinations as C
def A108116gen():
for numd in range(1, 11):
dset, s = "0123456789", [0 for _ in range(2*numd)]
for an in sorted(
chain.from_iterable(SL("".join(c), s) for c in C(dset, numd))):
yield an
for n, an in enumerate(A108116gen(), start=1):
print(n, an) # Michael S. Branicky, Dec 14 2020
A339803
Base-10 super-weak Skolem-Langford numbers.
Original entry on oeis.org
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
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.
Cf.
A339611 (same idea turned into a different sequence).
-
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
-
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
Showing 1-3 of 3 results.
Comments