OFFSET
1,1
COMMENTS
Self-describing numbers: between two digits "d" there are d digits.
a(n) has either 0 or 2 instances of any digit, hence even number of digits.
Largest element is a(20120) = 978416154798652002.
Named after the Norwegian mathematician Thoralf Albert Skolem (1887-1963) and the British chemist and mathematics teacher Charles Dudley Langford (1905-1969). - Amiram Eldar, Jun 17 2021
REFERENCES
E. Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.
LINKS
D. Wilson, Complete table of n, a(n) for n = 1..20120
EXAMPLE
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.
PROG
(Python)
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
CROSSREFS
KEYWORD
base,easy,fini,full,nonn
AUTHOR
Eric Angelini, Jun 26 2005, Aug 10 2007
EXTENSIONS
Edited by N. J. A. Sloane, Nov 18 2007
STATUS
approved