|
|
A351114
|
|
Characteristic function of balanced numbers: a(n) = 1 if phi(n) divides sigma(n), otherwise 0.
|
|
10
|
|
|
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, 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, 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
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1
|
|
COMMENTS
|
A balanced number k is a number such that phi(k) | sigma(k).
|
|
LINKS
|
|
|
FORMULA
|
a(n) = c(sigma(n)/phi(n)), where c(n) = 1 - ceiling(n) + floor(n).
|
|
MATHEMATICA
|
a[n_] := Boole[Divisible[DivisorSigma[1, n], EulerPhi[n]]]; Array[a, 100] (* Amiram Eldar, Feb 01 2022 *)
|
|
PROG
|
(Python)
from math import prod
from sympy import factorint
f = factorint(n)
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
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
Data section extended up to a(105) and the name amended with a formula by Antti Karttunen, Jan 01 2023
|
|
STATUS
|
approved
|
|
|
|