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.

A342076 Digits only come in successive pairs (separated or not by a comma).

Original entry on oeis.org

1, 11, 12, 2, 3, 31, 13, 32, 21, 14, 4, 5, 51, 15, 52, 22, 23, 33, 34, 41, 16, 6, 7, 71, 17, 72, 24, 42, 25, 53, 35, 54, 43, 36, 61, 18, 8, 9, 91, 19, 92, 26, 62, 27, 73, 37, 74, 44, 45, 55, 56, 63, 38, 81, 100, 66, 77, 88, 99, 111, 122, 112, 28, 82, 29, 93, 39, 94, 46, 64, 47, 75, 57, 76, 65, 58, 83, 300
Offset: 1

Views

Author

Eric Angelini, Feb 28 2021

Keywords

Comments

The sequence starts with a(1) = 1 and is always extended with the smallest positive integer not yet present that does not lead to a contradiction.
No term can end with an odd number of successive 0.
This is not the sequence A329127 as they diverge at a(55).

Examples

			a(1) = 1 forces the next digit to be a 1 (as digits must come in pairs); the smallest positive integer not yet present that starts with a 1 and does not lead to a contradiction is 11 (as 10, ending with an odd number of 0, is forbidden). Thus, a(2) = 11;
a(3) = 12 as a(3) must start with a 1 (to complete a pair of identical digits), and 12 is the smallest positive integer not yet present that does not lead to a contradiction;
a(4) = 2 as 2 is the smallest positive integer not yet present that starts with a 2 and does not lead to a contradiction; etc.
		

Crossrefs

Cf. A342077, A342078 and A342079 (variations on the same idea), A329127 (first 54 terms are the same).

Programs

  • Python
    mustpair = set(range(10))
    def pairsup(n, offset=0):
      digits = list(map(int, str(n)))[offset:]
      if len(digits) == 0: return True, False
      i = 0
      while i < len(digits) - 1:
        if digits[i] in mustpair:
          if digits[i] != digits[i+1]: return False, None
          else: i += 2
        else: i += 1
      unpaired = digits[-1] in mustpair and i != len(digits)
      return not (unpaired and digits[-1] == 0), unpaired
    def aupton(terms, startswith=1):
      alst, unpaired = [startswith], startswith in mustpair
      for n in range(2, terms+1):
        m = 1
        while True:
          while m in alst: m += 1
          if not unpaired or int(str(m)[0]) == alst[-1]%10:
            passes, temp = pairsup(m, offset=int(unpaired))
            if passes: alst.append(m); unpaired = temp; break
          m += 1
      return alst
    print(aupton(66)) # Michael S. Branicky, Feb 28 2021

A342078 Odd digits only come in successive pairs (separated or not by a comma).

Original entry on oeis.org

1, 10, 2, 3, 30, 4, 5, 50, 6, 7, 70, 8, 9, 90, 11, 20, 21, 12, 22, 23, 31, 13, 32, 24, 25, 51, 14, 26, 27, 71, 15, 52, 28, 29, 91, 16, 33, 40, 41, 17, 72, 42, 43, 34, 44, 45, 53, 35, 54, 46, 47, 73, 36, 48, 49, 92, 55, 60, 61, 18, 62, 63, 37, 74, 64, 65, 56, 66, 67, 75, 57, 76, 68
Offset: 1

Views

Author

Eric Angelini, Feb 28 2021

Keywords

Comments

The sequence starts with a(1) = 1 and is always extended with the smallest positive integer not yet present that does not lead to a contradiction.

Examples

			a(1) = 1 forces the next digit to be a 1 (as odd digits must come in pairs); the smallest positive integer not yet present that starts with a 1 and does not lead to a contradiction is 10. Thus, a(2) = 10;
a(3) = 2 as the smallest positive integer not yet present that does not lead to a contradiction is 2;
a(4) = 3 as the smallest positive integer not yet present that does not lead to a contradiction is 3;
a(5) = 30 as a(5) must start with a 3 (the odd digits must come in pairs) and 30 is the smallest positive integer not yet present that does not lead to a contradiction; etc.
		

Crossrefs

Cf. A342076, A342077 and A342079 (variations on the same idea).

Programs

A342079 Even digits only come in successive pairs (separated or not by a comma).

Original entry on oeis.org

1, 2, 21, 3, 4, 41, 5, 6, 61, 7, 8, 81, 9, 11, 12, 22, 23, 13, 14, 42, 24, 43, 15, 16, 62, 25, 17, 18, 82, 26, 63, 19, 31, 32, 27, 33, 34, 44, 45, 35, 36, 64, 46, 65, 37, 38, 83, 39, 51, 52, 28, 84, 47, 53, 54, 48, 85, 55, 56, 66, 67, 57, 58, 86, 68, 87, 59, 71, 72, 29, 73, 74, 49, 75, 76, 69, 77, 78, 88, 89
Offset: 1

Views

Author

Eric Angelini, Feb 28 2021

Keywords

Comments

The sequence starts with a(1) = 1 and is always extended with the smallest positive integer not yet present that does not lead to a contradiction.
No term can end with an odd number of successive 0.

Examples

			a(2) = 2 as the smallest positive integer not yet present that does not lead to a contradiction is 2;
a(3) = 21 (and not 20, as no term can end with an odd number of successive 0), because 21 is the smallest positive integer not yet present that completes a pair of identical even digits (2-2) and that does not lead to a contradiction;
a(4) = 3 as the smallest positive integer not yet present that does not lead to a contradiction is 3;
a(5) = 4 as the smallest positive integer not yet present that does not lead to a contradiction is 4;
a(6) = 41 (and not 40, as no term can end with an odd number of successive 0), because 41 is the smallest positive integer not yet present that completes a pair of identical even digits (4-4) and that does not lead to a contradiction; etc.
		

Crossrefs

Cf. A342076, A342077 and A342078 (variations on the same idea).

Programs

Showing 1-3 of 3 results.