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.

A228410 The digits of a(n) and a(n+1) together can be reordered to form a palindrome; lexicographically least injective sequence of positive integers with this property.

Original entry on oeis.org

1, 10, 100, 11, 2, 12, 21, 102, 20, 101, 22, 3, 13, 31, 103, 30, 110, 33, 4, 14, 41, 104, 40, 114, 24, 42, 112, 23, 32, 113, 34, 43, 131, 35, 5, 15, 51, 105, 50, 115, 25, 52, 121, 26, 6, 16, 61, 106, 60, 116, 36, 63, 136, 163, 316, 361, 613, 631, 1003, 111, 17, 7, 27, 72, 117, 37, 73, 137, 71, 107
Offset: 1

Views

Author

M. F. Hasler, Nov 09 2013

Keywords

Comments

For each n=1,2,3..., choose the smallest positive integer a(n) not occurring earlier such that the digits of a(n) and the preceding term (none for n=1) taken together can form a palindrome, when suitably reordered.
This is a variant of the original version, proposed by E. Angelini, based on nonnegative integers (cf. A228407). The two sequences start with only a few terms differing and large segments in common, and one might have expected them to join a common orbit quite early, but they rather diverge more and more.
It is conjectured that the sequence is a permutation of the positive integers, i.e., that all numbers will eventually occur. To test this conjecture, one can consider the indices n at which occur the numbers equal to the smallest integer not yet used. If the conjecture is true, this is equivalent to a(m)>a(n) for all m>n; if not, then this list ends at the first missing number. These [n,a(n)] are: [1, 1], [5, 2], [12, 3], [19, 4], [35, 5], [45, 6], [62, 7], [78, 8], [88, 9], [89, 29], [92, 39], [118, 44], [149, 45], [187, 46], [314, 47], [432, 49], [477, 59], [506, 67], [507, 76], [521, 78], [531, 79], [572, 89], [573, 98], [574, 198], [954, 211][955, 222], [956, 233], [1602, 234], [1616, 235], [1623, 237], [1924, 238], [1959, 239], [2508, 258], [2515, 278], [2536, 279], [4046, 289], [4047, 298], [4053, 489], [4054, 498], ...
Sequence A228412 is an "arithmetic" variant, where instead of the union of the digits, the sum of terms is considered. Sequence A062932 is a further variant where injectivity is replaced by monotonicity.
Sequences A231433 and A231442 are variants where "palindrome" is replaced with "prime".

Crossrefs

Programs

  • PARI
    {u=0; a=1; for(n=1,99, u+=1<
    				
  • Python
    from collections import Counter
    A228410_list, l, s, b = [1], Counter('1'), 2, set()
    for _ in range(10**2):
        i = s
        while True:
            if i not in b:
                li, o = Counter(str(i)), 0
                for d in (l+li).values():
                    if d % 2:
                        if o > 0:
                            break
                        o += 1
                else:
                    A228410_list.append(i)
                    l = li
                    b.add(i)
                    while s in b:
                        b.remove(s)
                        s += 1
                    break
            i += 1 # Chai Wah Wu, Dec 14 2014