login
Sum of the balanced numbers <= n.
1

%I #17 May 09 2022 17:26:47

%S 1,3,6,6,6,12,12,12,12,12,12,24,24,38,53,53,53,53,53,53,53,53,53,53,

%T 53,53,53,53,53,83,83,83,83,83,118,118,118,118,118,118,118,160,160,

%U 160,160,160,160,160,160,160,160,160,160,160,160,216,216,216,216,216,216,216

%N Sum of the balanced numbers <= n.

%C A balanced number k is a number such that phi(k) | sigma(k).

%H Harvey P. Dale, <a href="/A351116/b351116.txt">Table of n, a(n) for n = 1..1000</a>

%F a(n) = Sum_{k<=n, phi(k)|sigma(k)} k.

%F a(n) = Sum_{k=1..n} k * c(k), where c is the characteristic function of balanced numbers (A351114).

%e a(15) = 53; the sum of the balanced numbers <= 15 is 1+2+3+6+12+14+15 = 53.

%t f[n_] := n * Boole[Divisible[DivisorSigma[1, n], EulerPhi[n]]]; Accumulate @ Array[f, 100] (* _Amiram Eldar_, Feb 01 2022 *)

%t Accumulate[Table[If[Divisible[DivisorSigma[1,n],EulerPhi[n]],n,0],{n,70}]] (* _Harvey P. Dale_, May 09 2022 *)

%o (PARI) a(n) = sum(k=1, n, if (!(sigma(k) % eulerphi(k)), k)); \\ _Michel Marcus_, Feb 01 2022

%Y Cf. A000010 (phi), A000203 (sigma), A020492 (balanced numbers), A351114, A351115.

%K nonn

%O 1,2

%A _Wesley Ivan Hurt_, Jan 31 2022