login
a(1) = 1; for n >= 1, if a(n) is odd then a(n+1) = a(n) followed by a(n)+1, but if a(n) is even then a(n+1) = a(n)/2.
1

%I #6 Aug 26 2015 00:38:54

%S 1,12,6,3,34,17,1718,859,859860,429930,214965,214965214966,

%T 107482607483,107482607483107482607484,53741303741553741303742,

%U 26870651870776870651871,2687065187077687065187126870651870776870651872

%N a(1) = 1; for n >= 1, if a(n) is odd then a(n+1) = a(n) followed by a(n)+1, but if a(n) is even then a(n+1) = a(n)/2.

%e 17 is odd so the next term is 1718; 1718 is even so the next term is 1718/2 = 859.

%p catL := proc(a,b) a*10^( max(ilog10(b)+1,1)) +b ; end: A131570 := proc(n) option remember ; local prev; if n = 1 then 1 ; else prev := A131570(n-1) ; if prev mod 2 = 1 then catL(prev,prev+1) ; else prev/2 ; fi ; fi ; end: seq(A131570(n),n=1..20) ; # _R. J. Mathar_, Oct 26 2007

%t a = {1}; Do[If[OddQ[a[[ -1]]], AppendTo[a, FromDigits[Join[IntegerDigits[a[[ -1]]], IntegerDigits[a[[ -1]] + 1]]]], AppendTo[a, a[[ -1]]/2]], {25}]; a (* _Stefan Steinerberger_, Oct 26 2007 *)

%K nonn,base

%O 1,2

%A _Rodolfo Kurchan_, Aug 27 2007

%E More terms from _R. J. Mathar_ and _Stefan Steinerberger_, Oct 26 2007