OFFSET
0,1
COMMENTS
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 0..1000
Klaus Brockhaus, On the 'Reverse and Add!' algorithm in base 2
FORMULA
a(0), ..., a(11) as above; for n > 11 and
n = 0 (mod 4): a(n) = 3*2^(2*k+13)+18249*2^k-3 where k = (n-4)/4;
n = 1 (mod 4): a(n) = 6*2^(2*k+13)-12102*2^k where k = (n-5)/4;
n = 2 (mod 4): a(n) = 6*2^(2*k+13)+11718*2^k-3 where k = (n-6)/4;
n = 3 (mod 4): a(n) = 12*2^(2*k+13)-11910*2^k where k = (n-7)/4.
G.f.: 3*(179+382*x+96*x^2+60*x^3-328*x^4-444*x^5+1170*x^6+2232*x^7 +1166*x^8+5644*x^9+15402*x^10+46922*x^11+39850*x^12-62920*x^13-132612*x^14 -97532*x^15-34148*x^16+83800*x^17+109224*x^18+21856*x^19) / ((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4)).
G.f. for the sequence starting at a(12): 3*x^12*(155403+246008*x-188442*x^2-229616*x^3-260350*x^4-508920*x^5+293388*x^6+492528*x^7) / ((1-x)*(1+x)*(1-2*x^2)*(1-2*x^4))
a(n+1) = A055944(a(n)). - Reinhard Zumkeller, Apr 21 2013
EXAMPLE
537 (decimal) = 1000011001 -> 1000011001 + 1001100001 = 10001111010= 1146 (decimal).
MATHEMATICA
NestWhileList[# + IntegerReverse[#, 2] &, 537, # !=
IntegerReverse[#, 2] &, 1, 27] (* Robert Price, Oct 18 2019 *)
PROG
(PARI) trajectory(n, steps) = {local(v, k=n); for(j=0, steps, print1(k, ", "); v=binary(k); k+=sum(j=1, #v, 2^(j-1)*v[j]))};
trajectory(537, 27);
(Magma) trajectory:=function(init, steps, base) a:=init; S:=[a]; for n in [1..steps] do a+:=Seqint(Reverse(Intseq(a, base)), base); Append(~S, a); end for; return S; end function; trajectory(537, 27, 2);
(Haskell)
a077076 n = a077076_list !! n
a077076_list = iterate a055944 537 -- Reinhard Zumkeller, Apr 21 2013
CROSSREFS
Cf. A058042 (trajectory of 22 in base 2, written in base 2), A061561 (trajectory of 22 in base 2), A075253 (trajectory of 77 in base 2), A075268 (trajectory of 442 in base 2), A077077 (trajectory of 775 in base 2), A075252 (trajectory of n in base 2 does not reach a palindrome and (presumably) does not join the trajectory of any term m < n).
KEYWORD
base,nonn
AUTHOR
Klaus Brockhaus, Oct 25 2002
EXTENSIONS
Comment edited and three comments added, g.f. edited, PARI program revised, MAGMA program and crossrefs added by Klaus Brockhaus, May 12 2010
STATUS
approved