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.
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
Examples
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.
Links
- Jean-Marc Falcoz, Table of n, a(n) for n = 1..50000.
- Hans Havermann, High-resolution graph of 100000 terms showing even/odd distribution
- N. J. A. Sloane, Table of n, a(n), A329796(n), A329796(n)/a(n) for n = 1..50000
- 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.
Crossrefs
Programs
-
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
Comments