OFFSET
2,4
LINKS
Alois P. Heinz, Table of n, a(n) for n = 2..900
EXAMPLE
a(8) = (1 + 1/3)*1*3 = 4 because 1 and 3 are those positive integers <= 8/2 and coprime to 8.
MAPLE
b:=proc(n) local B, k: B:={}: for k from 1 to n/2 do if gcd(k, n)=1 then B:=B union {k} else B:=B fi od end: a:=proc(n) add(1/b(n)[j], j=1..nops(b(n)))*product(b(n)[j], j=1..nops(b(n))) end: seq(a(n), n=2..40); # Emeric Deutsch, Apr 22 2006
# second Maple program:
a:= n-> (l-> mul(i, i=l)*add(1/i, i=l))(
select(x-> igcd(x, n)=1, [$1..n/2])):
seq(a(n), n=2..40); # Alois P. Heinz, May 22 2015
MATHEMATICA
a[n_] := Module[{r = Range[Floor[n/2]], s}, s = Select[r, GCD[#, n]==1&]; Total[1/s] Times @@ s];
a /@ Range[2, 40] (* Jean-François Alcover, Nov 18 2020 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Leroy Quet, Nov 13 2004
EXTENSIONS
More terms from Emeric Deutsch, Apr 22 2006
STATUS
approved