login
A329544
Add the odd terms and subtract the even ones, the result must always be a palindrome. This is the lexicographically earliest sequence of distinct positive integers with this property.
11
1, 3, 2, 5, 4, 19, 11, 22, 6, 17, 14, 8, 7, 15, 16, 27, 24, 13, 18, 29, 26, 37, 33, 44, 28, 39, 36, 25, 30, 41, 38, 49, 46, 35, 40, 51, 48, 59, 45, 10, 68, 32, 21, 20, 9, 55, 58, 47, 50, 61, 60, 71, 66, 77, 23, 12, 88, 191, 101, 111, 91, 112, 31, 81, 121, 131, 141, 70, 132, 80, 122, 90, 142, 174, 43, 54, 72, 83, 53, 42
OFFSET
1,2
COMMENTS
Negative palindromes are not allowed (0 is OK). After 50000 terms, the smallest unused integers are 919, 1020, 1029, 1031, 1038, 1041, 1047, ... and the largest used is 208831. The largest palindrome produced so far is 1000001. Is the sequence a permutation of the integers > 0?
After one million terms, the smallest unused integers are still the seven mentioned (above) for 50000 terms. - Hans Havermann, Nov 27 2019
This sequence is not a permutation of the nonnegative integers because it cannot contain any term of A104444. The value 919 may only appear after a running total equal to 0 (see A083142, A084843). - Rémy Sigrist, Dec 11 2019. There are only two 0's in the first million terms of A329796, at n=12 and n=1002, so the chance that this happens seems slight. On the other hand, the zeros in the base 3 analog, A330314, are more plentiful (see A330325), so further investigation is needed. - Hans Havermann and N. J. A. Sloane, Dec 12 2019
LINKS
N. J. A. Sloane (in collaboration with Scott R. Shannon), Art and Sequences, Slides of guest lecture in Math 640, Rutgers Univ., Feb 8, 2020. Mentions this sequence.
EXAMPLE
The sequence starts with 1 which is positive and a palindrome.
1 + 3 = 4 (palindrome). (2 is not allowed because 1 - 2 < 0.)
1 + 3 - 2 = 2 (palindrome)
1 + 3 - 2 + 5 = 7 (palindrome)
1 + 3 - 2 + 5 - 4 = 3 (palindrome)
1 + 3 - 2 + 5 - 4 + 19 = 22 (palindrome)
1 + 3 - 2 + 5 - 4 + 19 + 11 = 33 (palindrome)
1 + 3 - 2 + 5 - 4 + 19 + 11 - 22 = 11 (palindrome), etc.
PROG
(PARI) A329544_vec(N, u=1, U, a, s, d)={vector(N, n, a=u; while(bittest(U, a-u)|| Vecrev(d=digits(s-(-1)^a*a))!=d|| (a>s&&!bittest(a, 0)), a++); s-=(-1)^a*a; U+=1<<(a-u); while(bittest(U, 0), U>>=1; u++); a)} \\ M. F. Hasler, Nov 16 2019
CROSSREFS
Cf. A329545 (same idea, but where the odd integers are subtracted and the even ones are added).
Cf. A002113 (palindromes), A086862 (first differences), A104444, A329796 (running totals), A329797, A329798 (records), A330311 (when n appears).
Sequence in context: A302698 A205401 A366264 * A095006 A159587 A369992
KEYWORD
base,nonn,look
AUTHOR
STATUS
approved