login
a(n) = (Product k) * (Sum 1/k), where both the product and the sum are over those positive integers k, where k <= n and gcd(k,n) = 1.
4

%I #20 Oct 18 2019 04:00:16

%S 1,1,3,4,50,6,1764,176,4968,300,10628640,552,1486442880,34986,2024400,

%T 4098240,70734282393600,133542,22376988058521600,16294800,

%U 121402713600,2612325870,4148476779335454720000,61931424,138951136600657920000,1330269185700

%N a(n) = (Product k) * (Sum 1/k), where both the product and the sum are over those positive integers k, where k <= n and gcd(k,n) = 1.

%C Since Sum_{k|n} k * Sum_{1<=m<=k, gcd(m,k)=1} 1/m = n*H(n), Sum_{k>=1} (Sum_{1<=m<=k, gcd(m,k)=1} 1/m) /k^2 = 2. - _Leroy Quet_, Nov 13 2004

%H Alois P. Heinz, <a href="/A056855/b056855.txt">Table of n, a(n) for n = 1..450</a>

%F Sum_{1<=m<=n, gcd(m,n)=1} 1/m = (1/n)*Sum_{k|n} mu(n/k)*k*H(k), where H(k) = Sum_{j=1..k} 1/j. - _Leroy Quet_, Nov 13 2004

%e a(8) = 1*3*5*7*(1 + 1/3 + 1/5 + 1/7) = 176 because 1, 3, 5 and 7 are the positive integers <= 8 that are relatively prime to 8.

%p a:= n-> (l-> mul(i, i=l)*add(1/i, i=l))(

%p select(x-> igcd(x, n)=1, [$1..n])):

%p seq(a(n), n=1..40); # _Alois P. Heinz_, May 22 2015

%t f[n_] := Block[{k = Select[Range[n], GCD[ #, n] == 1 &]}, Plus @@ (Times @@ k*Plus @@ 1/k)]; Table[ f[n], {n, 25}] (* _Robert G. Wilson v_, Nov 16 2004 *)

%K easy,nonn

%O 1,3

%A _Leroy Quet_, Aug 30 2000