A230892 Terms of A230891 written in base 10: the binary expansions of a(n) and a(n+1) taken together can be rearranged to form a palindrome.
0, 3, 1, 2, 4, 7, 8, 5, 6, 9, 10, 12, 15, 16, 11, 13, 14, 17, 18, 20, 23, 24, 27, 29, 30, 32, 19, 21, 22, 25, 26, 28, 31, 33, 34, 36, 39, 40, 43, 45, 46, 48, 51, 53, 54, 57, 58, 60, 63, 64, 35, 37, 38, 41, 42, 44, 47, 49, 50, 52, 55, 56, 59, 61, 62, 65, 66, 68, 71
Offset: 0
Examples
From _M. F. Hasler_, Nov 12 2013: (Start) Let d(n)=a(n)-n, i.e., a(n)=n+d(n). Then we have, after initial values d(0..8)=(0, 2, -1, -1, 0, 2, 2, -2, -2), the following pattern: d(9) = d(10) = 0, ..., d(13) = 3, d(14) = -3, ..., d(17) = d(18) = 0, ..., d(25) = 7; d(26) = -7, ..., d(33) = d(34) = 0, ..., d(49) = 15, d(50) = -15, ..., d(65) = d(66) = 0, ..., d(97) = 31, d(98) = -31, ..., d(129) = d(130) = 0, ..., d(193) = 63, d(194) = -63,..., d(257) = d(258) = 0, ... (End)
Links
- Chai Wah Wu, Table of n, a(n) for n = 0..30000 (first 2051 terms from Robert G. Wilson v)
- Robert G. Wilson v, Graph of the first 1025 terms
Programs
-
PARI
{u=0; a=0; La=1; ha=0/*hack*/; for(n=1, 99, u+=1<=2^L,L++); bittest(ha+h=hammingweight(k),0)&&!bittest(La+L,0)&&next; !a&&k<3&&next; a=k; ha=h; La=L; break))} \\ M. F. Hasler, Nov 11 2013
-
Python
from collections import Counter A230892_list, l, s, b = [0, 3], Counter('11'), 1, {3} for _ in range(30001): i = s while True: if i not in b: li, o = Counter(bin(i)[2:]), 0 for d in (l+li).values(): if d % 2: if o > 0: break o += 1 else: A230892_list.append(i) l = li b.add(i) while s in b: b.remove(s) s += 1 break i += 1 # Chai Wah Wu, Jun 19 2016
Comments