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-4 of 4 results.

A303572 a(n) = palindrome arising when A228410(n+1) is formed (if there is more than one, use the smallest).

Original entry on oeis.org

101, 10001, 10101, 121, 212, 1221, 12021, 20102, 10201, 12021, 232, 313, 1331, 13031, 30103, 10301, 13031, 343, 414, 1441, 14041, 40104, 14041, 14241, 2442, 12421, 12321, 2332, 13231, 13431, 3443, 13431, 13531, 535, 515, 1551, 15051, 50105, 15051, 15251, 2552, 12521
Offset: 0

Views

Author

N. J. A. Sloane, Apr 27 2018

Keywords

Comments

Let A228410(n) = X, A228410(n+1) = Y. The digits of X and Y can be rearranged to form a palindrome, possibly in several ways; a(n) is the smallest such palindrome.
Numbers with an even number of digits without a digit 0 are in A113585. - David A. Corneth, Apr 28 2018

Crossrefs

Extensions

More terms by David A. Corneth, Apr 27 2018

A228407 The digits of a(n) and a(n+1) together can be reordered to form a palindromic integer; the lexicographically earliest injective sequence of nonnegative integers with this property.

Original entry on oeis.org

0, 11, 1, 10, 100, 12, 2, 20, 101, 22, 3, 13, 31, 103, 30, 110, 33, 4, 14, 41, 104, 40, 114, 24, 42, 112, 21, 102, 120, 201, 210, 1000, 105, 15, 5, 25, 52, 115, 35, 53, 113, 23, 32, 121, 26, 6, 16, 61, 106, 60, 116, 36, 63, 131, 34, 43, 134, 143, 314
Offset: 0

Views

Author

Eric Angelini and M. F. Hasler, Nov 09 2013

Keywords

Comments

For each n=0,1,2,3..., choose the smallest nonnegative integer a(n) not occurring earlier such that the digits of a(n) and a(n-1) (none for n=0) taken together can form a palindrome when suitably reordered.
It is conjectured that the sequence is a permutation of the nonnegative integers (motivating the choice of offset 0), i.e., that all numbers will eventually occur. (The conjecture is true - see below. - N. J. A. Sloane, Nov 12 2013)
To test this conjecture, consider the indices n where the smallest integers not yet used occur. 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: [0, 0], [2, 1], [6, 2], [10, 3], [17, 4], [34, 5], [45, 6], [65, 7], [81, 8], [118, 9], [119, 29], [122, 39], [145, 44], [152, 45], [197, 46], [230, 47], [271, 48], [362, 49], [533, 57], [740, 58], [754, 68], [816, 69], [855, 89], [856, 98], [857, 198], [1011, 211], [1012, 222], [1110, 224], [1232, 225], [1385, 234], [1406, 236], [1413, 237], [1767, 238], [1921, 239], [2555, 257], [2590, 259], [2597, 269], [4354, 279], [4355, 297], [4361, 379], [4362, 397], [4368, 479], [4369, 497],...
See A228410 for the variant considering only positive integers, and comments about the differences.
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.
From N. J. A. Sloane, Nov 13 2013: (Start)
Theorem. In any base b >= 2, Eric Angelini's "palindrome" sequence (A228407 in base 10, A230891 and A230892 in base 2) contains every number n >= 0 and is therefore a permutation of the numbers n >= 0.
Proof. Fix the base b >= 2. Classify numbers n into 2^b classes according to the parity of the numbers of 0's, 1's, ..., b-1's they contain.
Construct a graph G with these 2^b classes as nodes, with two nodes joined by an edge iff they are at Hamming distance 0 or 1 apart. This is the b-dimensional cube graph with a loop at each node.
Let S = a(0), a(1), ... denote Angelini's palindromic sequence in base b. A set of digits can be arranged to form a palindrome iff there is an even number of copies of every digit or exactly one of the digits occurs an odd number of times.
At step n, write a(n) on the node of G corresponding to its parity class. The previous remark implies that the successive a(i) will trace out an infinite path in the graph.
At least one node must be visited infinitely often.
The rule for constructing the sequence implies that each node adjacent to a node that is visited infinitely often must also be visited infinitely often. Since G is connected, every node is visited infinitely often. Therefore every number must appear in the sequence, for if a number never appeared, the node corresponding to its parity class would only be visited finitely many times. QED.
Thanks to Rob Arthan for comments on the original version of this proof. (End)
From Robert G. Wilson v, Dec 31 2013: (Start)
Records: 0, 11, 100, 101, 103, 110, 114, 120, 201, 210, 1000, 1003, 1007, 1008, 1020, 1029, 1030, 1040, 1047, 1048, 1082, 1208, 1280, 1802, 1820, 2018, 2081, 2108, 2180, 2801, 2810, 8012, 8021, 8102, 8120, 8201, 8210, 10002, 10004, 10007, 10020, 10060, 10080, 10081, 10100, 10105, 10113, 10304, ... [See A377925, A377926. - N. J. A. Sloane, Dec 14 2024]
Last occurrence: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 29, 39, 44, 45, 46, 47, 48, 49, 57, 58, 68, 69, 89, 98, 198, 211, 222, 224, 225, 234, 236, 237, 238, 239, 257, 259, 269, 279, 297, 379, 397, 479, 497, 589, ... ;
Index of last occurrence: 0, 2, 6, 10, 17, 34, 45, 65, 81, 118, 119, 122, 145, 152, 197, 230, 271, 362, 533, 740, 754, 816, 855, 856, 857, 1011, 1012, 1110, 1232, 1385, 1406, 1413, 1767, 1921, 2555, 2590, 2597, 4354, 4355, 4361, 4362, 4368, 4369, ... . (End)

Examples

			The second term cannot be "1", because a palindrome cannot be formed from the digits in "01". The second term cannot be "10" because "010", though a palindrome, is not a palindromic integer. However "11" is permissible because "101" is a palindrome. Thus the second term is 11.
The third term can be 1 because 111 is a palindrome.
		

Crossrefs

A228730, A231880, A231881 are similar sequences.
Records: A377925, A377926.

Programs

  • Mathematica
    a[0] = 0; a[n_] := a[n] = Block[{k = 1, idm = IntegerDigits@ a[n - 1]}, Label[ start]; While[ MemberQ[ a@# & /@ Range[n - 1], k], k++]; While[ idk = IntegerDigits @k; Select[ Permutations[ Join[idm, idk]], #[[1]] != 0 && # == Reverse@# &] == {}, k++; Goto[start]]; k]; Array[ a, 60, 0] (* Robert G. Wilson v, Nov 10 2013 *)
  • PARI
    {u=0; a=0; for(n=1,99, u+=1<
    				
  • Python
    from collections import Counter
    A228407_list, l, s, b = [0, 11], Counter('11'), 1, set([11])
    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:
                    A228407_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

Extensions

Terms independently calculated by Rob Arthan, Nov 09 2013
Comments edited by N. J. A. Sloane, Dec 14 2024

A228730 Lexicographically earliest sequence of distinct nonnegative integers such that the sum of two consecutive terms is a palindrome in base 10.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 16, 17, 27, 28, 38, 39, 49, 50, 51, 15, 7, 26, 18, 37, 29, 48, 40, 59, 42, 13, 9, 24, 20, 35, 31, 46, 53, 58, 8, 14, 19, 25, 30, 36, 41, 47, 52, 69, 32, 12, 10, 23, 21, 34, 43, 45, 54, 57, 44, 11, 22, 33, 55, 56, 65, 66, 75, 76, 85, 86, 95, 96
Offset: 0

Views

Author

Paul Tek, Aug 31 2013

Keywords

Comments

From M. F. Hasler, Nov 09 2013: (Start)
At each step, choose the smallest number not occurring earlier and such that a(n+1)+a(n) are palindromes, for all n.
Conjectured to be a permutation of the nonnegative integers.
See A062932 where injectivity is replaced by monotonicity; the sequences differ from a(16)=15 on.
This is an "arithmetic" analog to sequences A228407 and A228410, where instead of the sum, the union of the digits of subsequent terms is considered. (End)

Examples

			a(1) + a(2) = 3.
a(2) + a(3) = 5.
a(3) + a(4) = 7.
a(4) + a(5) = 9.
a(5) + a(6) = 11.
a(6) + a(7) = 22.
a(7) + a(8) = 33.
		

Crossrefs

Cf. A062932 (strictly increasing variant).

Programs

  • PARI
    {a=0;u=0; for(n=1, 99, u+=1<A002113(a+k)&&(a=k)&&next(2)))} \\ M. F. Hasler, Nov 09 2013
    
  • Perl
    See Link section.
    
  • Python
    from itertools import islice
    def ispal(n): s = str(n); return s == s[::-1]
    def agen(): # generator of terms
        aset, an, mink = {0}, 0, 1
        yield 0
        while True:
            k = mink
            while k in aset or not ispal(an + k): k += 1
            an = k; aset.add(an); yield an
            while mink in aset: mink += 1
    print(list(islice(agen(), 70))) # Michael S. Branicky, Nov 07 2022

Extensions

a(0)=0 added by M. F. Hasler, Nov 15 2013

A231433 The digits of a(n) and a(n+1) taken together are the digits of a prime; least permutation of the nonnegative integers with this property.

Original entry on oeis.org

0, 11, 2, 3, 1, 4, 7, 6, 10, 9, 5, 12, 8, 18, 13, 15, 14, 17, 20, 23, 21, 16, 19, 22, 30, 25, 27, 26, 29, 24, 31, 28, 33, 32, 35, 36, 34, 37, 39, 38, 41, 42, 43, 45, 47, 44, 51, 40, 49, 46, 57, 50, 53, 48, 59, 56, 63, 52, 61, 54, 67, 55, 69, 58, 70, 60, 71, 62, 72
Offset: 0

Views

Author

Eric Angelini and M. F. Hasler, Nov 09 2013

Keywords

Comments

The offset is zero to have a permutation.
Sequence A128280 is an "arithmetic" analog, where instead of concatenation of digits, the terms are added.
Sequences A228407 and A228410 are the variants where "prime" is replaced by "palindrome".

Examples

			Start with a(0)=0. The least prime having this digit is 101, so a(1)=11. Since 0 cannot be used any more and 111 is not a prime, the least digit that can be added to get the digits of some prime (namely 211) is a(2)=2, then a(3)=3 yields 23, etc.
See also the link to Angelini's post.
		

Programs

  • PARI
    {a=u=0;for(n=1,99,u+=1<"0"&&(a=k)&&next(3))))}
Showing 1-4 of 4 results.