%I #16 Apr 18 2024 18:44:34
%S 1,1,2,2,4,4,6,6,6,8,10,10,12,12,12,12,16,16,18,18,18,20,22,22,24,24,
%T 24,24,28,28,30,30,30,32,34,34,36,36,36,36,40,40,42,42,42,44,46,46,48,
%U 48,48,48,52,52,54,54,54,56,58,58,60,60,60,60,60,60,66,66,66,68,70,70,72
%N a(1)=1. a(n) = n - GCD(a(n-1),n).
%C a(n) is even for n >= 3. a(n+1) >= a(n). - _Robert Israel_, Apr 18 2024
%H Robert Israel, <a href="/A124195/b124195.txt">Table of n, a(n) for n = 1..10000</a>
%p A[1]:= 1:
%p for n from 2 to 100 do A[n]:= n - igcd(A[n-1],n) od:
%p seq(A[i],i=1..100); # _Robert Israel_, Apr 18 2024
%t f[l_List] := Block[{n = Length[l] + 1},Append[l, n - GCD[l[[ -1]], n]]];Nest[f, {1}, 75] (* Ray Chandler, Dec 11 2006 *)
%t RecurrenceTable[{a[1]==1,a[n]==n-GCD[a[n-1],n]},a,{n,80}] (* _Harvey P. Dale_, Jul 05 2013 *)
%K nonn
%O 1,3
%A _Leroy Quet_, Dec 06 2006
%E Extended by _Ray Chandler_, Dec 11 2006
|