login
A096217
a(n) = sum of terms of {a(1),a(2),a(3),...a(n-1)} which are coprime to n.
1
1, 1, 2, 2, 6, 2, 14, 2, 24, 2, 56, 2, 114, 2, 86, 2, 318, 2, 524, 2, 632, 2, 1798, 2, 3598, 2, 6736, 2, 12138, 2, 24278, 2, 37756, 2, 72308, 2, 160424, 2, 308250, 2, 629102, 2, 1258120, 2, 937358, 2, 3453688, 2, 3437884, 2, 9395312, 2, 18802902, 2, 36816688, 2
OFFSET
1,3
COMMENTS
a(n) is 2 if n is an even integer >= 4.
a(7937) has more than 1000 decimal digits. - Chai Wah Wu, Aug 30 2014
EXAMPLE
a(1)=1, a(2)=1, a(3)=2, a(4)=2, a(6)=2, a(7)=14 and a(8)=2 are the terms, prior to a(9), which are coprime to 9. So a(9) = 1 +1 +2 +2 +2 +14 +2 = 24.
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Plus @@ (a /@ Select[Range[n - 1], GCD[ a[ # ], n] == 1 &]); Table[ a[n], {n, 56}] (* Robert G. Wilson v, Jul 31 2004 *)
PROG
(Python)
from gmpy2 import gcd
A096217 = [1]
for n in range(2, 10**4):
A096217.append(sum(x for x in A096217 if gcd(x, n) == 1))
# Chai Wah Wu, Aug 30 2014
CROSSREFS
Sequence in context: A071223 A249631 A055934 * A281145 A098555 A057562
KEYWORD
nonn
AUTHOR
Leroy Quet, Jul 28 2004
EXTENSIONS
Edited and extended by Robert G. Wilson v, Jul 31 2004
STATUS
approved