login
A122456
a(0)=1, a(1)=1; for n>1, a(n) = the sum of the two largest earlier terms which are both coprime to n.
2
1, 1, 2, 3, 4, 7, 8, 12, 10, 18, 10, 30, 8, 48, 4, 16, 10, 78, 8, 126, 10, 26, 10, 204, 8, 330, 10, 42, 4, 534, 8, 864, 10, 42, 10, 1398, 8, 2262, 10, 26, 10, 3660, 2, 5922, 10, 52, 10, 5922, 8, 5922, 10, 78, 10, 11844, 8, 17766, 4, 78, 10, 29610, 8, 47376, 10, 78, 10
OFFSET
0,3
EXAMPLE
a(0)=1, a(1)=1, a(5)=7 are the terms which are coprime to 12 and which occur among {a(0),a(1),...a(11)}. 1 and 7 are the two largest of these terms, so a(12) = 1 + 7 = 8.
MATHEMATICA
f[s_] := Append[s, Plus @@ Take[Sort[Select[s, GCD[ #, Length[s]] == 1 &]], -2]]; Nest[f, {1, 1}, 64] (* Ray Chandler, Sep 11 2006 *)
CROSSREFS
Cf. A122457.
Sequence in context: A256219 A078662 A050048 * A186243 A073882 A015840
KEYWORD
nonn
AUTHOR
Leroy Quet, Sep 07 2006
EXTENSIONS
Extended by Ray Chandler and Robert G. Wilson v, Sep 11 2006
STATUS
approved