login
A127463
a(0)=1. a(n) = number of earlier terms a(k), 0<=k<=n-1, such that (k+a(k)) is coprime to n.
2
1, 1, 1, 2, 3, 4, 3, 6, 7, 5, 6, 11, 4, 12, 8, 9, 9, 17, 6, 19, 6, 13, 10, 23, 6, 20, 10, 18, 11, 29, 3, 31, 14, 19, 14, 26, 7, 37, 16, 22, 11, 41, 8, 42, 18, 25, 19, 47, 11, 46, 13, 32, 21, 53, 15, 40, 25, 36, 29, 58, 9, 59, 31, 36, 34, 46, 16, 67, 33, 41, 24, 71, 17, 72, 37, 37, 37
OFFSET
0,4
EXAMPLE
(a(0)+0) is coprime to 12; (a(3)+3) is coprime to 12; (a(4)+4) is coprime to 12; and (a(7)+7) is coprime to 12. These 4 cases are the only cases where (a(k)+k) is coprime to 12, for 0<=k<=11. So a(12)=4.
MATHEMATICA
f[l_List] := Block[{n = Length[l]}, Append[l, Count[Table[GCD[n, k - 1 + l[[k]]], {k, n}], 1]]]; Nest[f, {1}, 78] (* Ray Chandler, Jan 22 2007 *)
CROSSREFS
Sequence in context: A347123 A318510 A048276 * A076618 A116550 A283165
KEYWORD
nonn
AUTHOR
Leroy Quet, Jan 15 2007
EXTENSIONS
Extended by Ray Chandler, Jan 22 2007
STATUS
approved