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.

Showing 1-3 of 3 results.

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

Views

Author

Eric Angelini, Jun 26 2005, Aug 10 2007

Keywords

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.
"Strong" means that every digit from 0 to the largest digit of a(n) must be present in a(n). See A108116 for the "weak" variant without this additional constraint.
Number of digits of a(n) == 0 or 2 (mod 8)
Largest element is a(2820) = 867315136875420024.

Crossrefs

Base 10 Skolem-Langford numbers are in A108116.
Base 10 weaker Skolem-Langford numbers are in A357826.

Programs

  • Python
    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

Extensions

Edited by N. J. A. Sloane, Nov 18 2007

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

Views

Author

Eric Angelini, Jun 26 2005, Aug 10 2007

Keywords

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

Examples

			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.
		

References

  • E. Angelini, "Jeux de suites", in Dossier Pour La Science, pp. 32-35, Volume 59 (Jeux math'), April/June 2008, Paris.

Crossrefs

Base 10 strong Skolem-Langford numbers are in A132291.
Base 10 weaker Skolem-Langford numbers are in A357826.

Programs

  • 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

Extensions

Edited by N. J. A. Sloane, Nov 18 2007

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

Views

Author

Eric Angelini and Carole Dubois, Dec 17 2020

Keywords

Comments

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).
There are infinitely many such terms.
From M. F. Hasler, Dec 19 2020: (Start)
If N is a term of the sequence, then:
(1) Any digit of N must be present at least twice in N (cf. A115853).
(2) N*10^k is also a term of the sequence, for all k >= 2.
(3) The reversal R(N) = A004086(N) is also a term (with leading zeros deleted). (End)

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.
		

Crossrefs

Cf. base-10 Skolem-Langford numbers: A108116 (weak), A357826 (weaker), A132291 (strong).
Cf. A339611 (same idea turned into a different sequence).
Cf. A115853.

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
    
Showing 1-3 of 3 results.