login
a(1) = a(2) = 1. a(n) = a(n-2) + (largest power of 2 dividing a(n-1)).
1

%I #9 Aug 09 2015 15:23:55

%S 1,1,2,3,3,4,7,5,8,13,9,14,11,15,12,19,13,20,17,21,18,23,19,24,27,25,

%T 28,29,29,30,31,31,32,63,33,64,97,65,98,67,99,68,103,69,104,77,105,78,

%U 107,79,108,83,109,84,113,85,114,87,115,88,123,89,124,93,125,94,127,95,128

%N a(1) = a(2) = 1. a(n) = a(n-2) + (largest power of 2 dividing a(n-1)).

%e 4 is the largest power of two dividing a(18) = 20. So a(19) = a(17) + 4 = 17.

%p A006519 := proc(n::integer) RETURN(gcd(2^n,n)) ; end; A119795 := proc(nmax::integer) local a,n; a := array(1..nmax) ; a[1] := 1 ; a[2] := 1 ; for n from 3 to nmax do a[n] := a[n-2]+A006519(a[n-1]) ; end ; RETURN(a) ; end ; nmax := 200 ; a := A119795(nmax) ; for n from 1 to nmax do printf("%d,",a[n]) ; od ; # _R. J. Mathar_, Aug 04 2006

%Y Cf. A006519.

%K nonn

%O 1,3

%A _Leroy Quet_, Jul 30 2006

%E More terms from _R. J. Mathar_, Aug 04 2006