A066059 Integers such that the 'Reverse and Add!' algorithm in base 2 (cf. A062128) does not lead to a palindrome.
22, 26, 28, 35, 37, 41, 46, 47, 49, 60, 61, 67, 75, 77, 78, 84, 86, 89, 90, 94, 95, 97, 105, 106, 108, 110, 116, 120, 122, 124, 125, 131, 135, 139, 141, 147, 149, 152, 155, 157, 158, 163, 164, 166, 169, 172, 174, 177, 180, 182, 185, 186, 190, 191, 193, 197, 199
Offset: 1
Links
- A.H.M. Smeets, Table of n, a(n) for n = 1..20000
- Klaus Brockhaus, On the'Reverse and Add!' algorithm in base 2
- Index entries for sequences related to Reverse and Add!
Programs
-
ARIBAS
: For function b2reverse see A066057; function a066059(mx,stop: integer); var k,c,m,rev: integer; begin for k := 1 to mx do c := 0; m := k; rev := b2reverse(m); while m <> rev and c < stop do inc(c); m := m + rev; rev := b2reverse(m); end; if c >= stop then write(k," "); end; end; end; a066059(210,300).
-
Mathematica
limit = 10^4; (* Assumes that there is no palindrome if none is found before "limit" iterations *) Select[Range[200], Length@NestWhileList[# + IntegerReverse[#, 2] &, #, # != IntegerReverse[#, 2] &, 1, limit] == limit + 1 &] (* Robert Price, Oct 14 2019 *)
Comments