login
Characteristic function of balanced numbers: a(n) = 1 if phi(n) divides sigma(n), otherwise 0.
10

%I #20 Jul 23 2023 22:22:16

%S 1,1,1,0,0,1,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,

%T 1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,

%U 0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1

%N Characteristic function of balanced numbers: a(n) = 1 if phi(n) divides sigma(n), otherwise 0.

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

%C If a(x) = 1, a(y) = 1, and gcd(x,y) = 1, then a(x*y) = 1 also. - _Antti Karttunen_, Jan 01 2023, based on _Enrique PĂ©rez Herrero_'s Sep 05 2010 comment in A020492.

%H Antti Karttunen, <a href="/A351114/b351114.txt">Table of n, a(n) for n = 1..100130</a>

%H <a href="/index/Ch#char_fns">Index entries for characteristic functions</a>

%F a(n) = c(sigma(n)/phi(n)), where c(n) = 1 - ceiling(n) + floor(n).

%F a(n) = [A063514(n) == 0], where [ ] is the Iverson bracket. - _Antti Karttunen_, Jan 01 2023

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

%o (Python)

%o from math import prod

%o from sympy import factorint

%o def A351114(n):

%o f = factorint(n)

%o return int(not prod(p*(p**(e+1)-1) for p, e in f.items()) % (n*prod((p-1)**2 for p in f))) # _Chai Wah Wu_, Feb 01 2022

%o (PARI) A351114(n) = !(sigma(n)%eulerphi(n)); \\ _Antti Karttunen_, Jan 01 2023

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

%K nonn

%O 1

%A _Wesley Ivan Hurt_, Jan 31 2022

%E Data section extended up to a(105) and the name amended with a formula by _Antti Karttunen_, Jan 01 2023