login
Number of balanced numbers <= n.
1

%I #11 Feb 01 2022 09:42:02

%S 1,2,3,3,3,4,4,4,4,4,4,5,5,6,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8,

%T 9,9,9,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11,

%U 11,11,11,11,11,11,11,11,11,11,12,12,12,12,12,12,12,12,13,13,13

%N Number of balanced numbers <= n.

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

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

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

%e a(15) = 7; the 7 balanced numbers <= 15 are 1,2,3,6,12,14,15.

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

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

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

%K nonn

%O 1,2

%A _Wesley Ivan Hurt_, Jan 31 2022