|
|
A122847
|
|
a(0)=0. a(n) = a(n-1) + (sum of positive integers which are coprime to n, <= n and missing from {a(0),a(1),a(2),..,a(n-1)}).
|
|
1
|
|
|
0, 1, 1, 3, 3, 9, 14, 31, 43, 69, 76, 118, 141, 206, 235, 280, 331, 440, 493, 637, 704, 829, 926, 1152, 1247, 1470, 1613, 1841, 1996, 2375, 2494, 2932, 3144, 3428, 3656, 4032, 4216, 4824, 5122, 5544, 5820, 6582, 6802, 7647, 8000, 8451, 8870, 9850, 10159
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
LINKS
|
|
|
EXAMPLE
|
The positive integers which are coprime to 8 and <= 8 are 1,3,5,7. Of these, 5 and 7 are missing from the terms a(0) through a(7). So a(8) = a(7) + 5 + 7 = 43.
|
|
MATHEMATICA
|
f[l_List] := Block[{n = Length[l]}, Append[l, l[[ -1]] + Plus @@ Select[Range[n], GCD[n, # ] == 1 && FreeQ[l, # ] &]]]; Nest[f, {0}, 50] (* Ray Chandler, Oct 26 2006 *)
s={0, 1}; b=1; Do[ b=b+Total[ Select[ Range[ n ], GCD[ #1, n ]==1&&FreeQ[ s, #1 ]& ] ]; AppendTo[ s, b ], {n, 2, 100} ]; s (*Seidov*)
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|