OFFSET
1,13
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
Hamed Mousavi and Maxie D. Schmidt, Factorization Theorems for Relatively Prime Divisor Sums, GCD Sums and Generalized Ramanujan Sums, arXiv:1810.08373 [math.NT], 2018. See Remark 2.2, pp. 6-7.
FORMULA
a(n) = -Sum_{1 <= k <= n-1, gcd(k, n+1) = 1} a(k).
EXAMPLE
a(7) = 1 since the positive integers < 8 and coprime to 8 are 1, 3, 5, 7, and thus a(1) + a(3) + a(5) + a(7) = 1 - 1 - 1 + 1 = 0.
MAPLE
A:= Vector(100):
A[1]:= 1:
for n from 2 to 100 do
A[n]:= -convert(A[select(t -> igcd(t, n+1)=1, [$1..n-1])], `+`)
od:
convert(A, list); # Robert Israel, Oct 26 2020
MATHEMATICA
a[1] = 1; a[n_] := a[n] = Block[{k = Select[ Range[n - 1], GCD[ #, n + 1] == 1 &]}, -Plus @@ (a /@ k)]; Table[ a[n], {n, 94}] (* Robert G. Wilson v, Aug 24 2004 *)
CROSSREFS
KEYWORD
sign
AUTHOR
Leroy Quet, Aug 10 2004
EXTENSIONS
Edited and extended by Robert G. Wilson v, Aug 24 2004
STATUS
approved