login
A329545
After a(1) = 1, add the even terms and subtract the odd ones, the result must always be a palindrome. This is the lexicographically earliest sequence of distinct positive integers with this property.
2
1, 2, 3, 4, 18, 11, 5, 16, 13, 7, 6, 14, 15, 26, 22, 33, 17, 28, 25, 36, 35, 9, 8, 58, 55, 44, 46, 10, 20, 30, 73, 77, 66, 24, 40, 50, 103, 79, 68, 34, 23, 81, 48, 47, 80, 83, 72, 54, 43, 85, 52, 49, 38, 37, 70, 64, 53, 87, 32, 27, 60, 57, 90, 12, 45, 59, 92, 42, 75, 61, 94, 62, 95, 63, 74, 69, 194
OFFSET
1,2
COMMENTS
Negative palindromes are not allowed. After 50000 terms, the smallest unused integers are 964, 1020, 1029, 1031, 1038, 1041, 1047, 1051, ... and the largest used is 173410. The largest palindrome produced so far is 309903. Is the sequence a permutation of the integers > 0?
a(63411) = 964. Rémy Sigrist's comment in A329544 shows that terms in A104444 are not in the sequence. Conjecture: Sequence is a permutation of positive integers not in A104444. - Chai Wah Wu, Dec 11 2019
LINKS
EXAMPLE
The sequence starts with 1, smallest positive integer.
1 + 2 = 3 (palindrome)
1 + 2 - 3 = 0 (palindrome)
1 + 2 - 3 + 4 = 1 (palindrome)
1 + 2 - 3 + 4 + 18 = 22 (palindrome)
1 + 2 - 3 + 4 + 18 - 11 = 11 (palindrome)
1 + 2 - 3 + 4 + 18 - 11 - 5 = 6 (palindrome)
1 + 2 - 3 + 4 + 18 - 11 - 5 + 16 = 22 (palindrome), etc.
PROG
(PARI) A329545_vec(N, u=1, U, a, s=2, 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. A329544 (same idea, but where the odd integers are added and the even ones are subtracted).
Cf. A002113 (palindromes), A086862 (first differences of palindromes).
Cf. A104444.
Sequence in context: A037430 A377958 A370868 * A187075 A154715 A077407
KEYWORD
base,nonn
AUTHOR
STATUS
approved