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.

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

This page as a plain text file.
%I A228730 #34 Nov 08 2022 01:41:26
%S A228730 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,
%T A228730 42,13,9,24,20,35,31,46,53,58,8,14,19,25,30,36,41,47,52,69,32,12,10,
%U A228730 23,21,34,43,45,54,57,44,11,22,33,55,56,65,66,75,76,85,86,95,96
%N A228730 Lexicographically earliest sequence of distinct nonnegative integers such that the sum of two consecutive terms is a palindrome in base 10.
%C A228730 From _M. F. Hasler_, Nov 09 2013: (Start)
%C A228730 At each step, choose the smallest number not occurring earlier and such that a(n+1)+a(n) are palindromes, for all n.
%C A228730 Conjectured to be a permutation of the nonnegative integers.
%C A228730 See A062932 where injectivity is replaced by monotonicity; the sequences differ from a(16)=15 on.
%C A228730 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)
%H A228730 Paul Tek, <a href="/A228730/b228730.txt">Table of n, a(n) for n = 0..10000</a> (corrected by Michel Marcus, Jan 19 2019)
%H A228730 Paul Tek, <a href="/A228730/a228730.txt">PERL program for this sequence</a>
%e A228730 a(1) + a(2) = 3.
%e A228730 a(2) + a(3) = 5.
%e A228730 a(3) + a(4) = 7.
%e A228730 a(4) + a(5) = 9.
%e A228730 a(5) + a(6) = 11.
%e A228730 a(6) + a(7) = 22.
%e A228730 a(7) + a(8) = 33.
%o A228730 (Perl) See Link section.
%o A228730 (PARI) {a=0;u=0; for(n=1, 99, u+=1<<a; print1(a", "); for(k=1, 9e9, !bittest(u, k)&&is_A002113(a+k)&&(a=k)&&next(2)))} \\ _M. F. Hasler_, Nov 09 2013
%o A228730 (Python)
%o A228730 from itertools import islice
%o A228730 def ispal(n): s = str(n); return s == s[::-1]
%o A228730 def agen(): # generator of terms
%o A228730     aset, an, mink = {0}, 0, 1
%o A228730     yield 0
%o A228730     while True:
%o A228730         k = mink
%o A228730         while k in aset or not ispal(an + k): k += 1
%o A228730         an = k; aset.add(an); yield an
%o A228730         while mink in aset: mink += 1
%o A228730 print(list(islice(agen(), 70))) # _Michael S. Branicky_, Nov 07 2022
%Y A228730 Cf. A002113, A055266.
%Y A228730 Cf. A062932 (strictly increasing variant).
%K A228730 nonn,base
%O A228730 0,3
%A A228730 _Paul Tek_, Aug 31 2013
%E A228730 a(0)=0 added by _M. F. Hasler_, Nov 15 2013