OFFSET
1,4
EXAMPLE
The first floor(15/2) terms of the sequence are 1,1,1,2,2,3,3. Of these, five terms (1,1,1,2,2) are coprime to 15. So a(15) = 1+1+1+2+2 = 7.
MATHEMATICA
f[l_List] := Block[{n = Length[l] + 1}, Append[l, Plus @@ Select[Take[l, Floor[n/2]], GCD[ #, n] == 1 &]]]; Nest[f, {1}, 65] (* Ray Chandler, Dec 11 2006 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Dec 10 2006
EXTENSIONS
Extended by Ray Chandler, Dec 11 2006
STATUS
approved