RosettaCodeData/Task/Totient-function/Sidef/totient-function-1.sidef

6 lines
84 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
func 𝜑(n) {
n.factor_exp.prod {|p|
(p[0]-1) * p[0]**(p[1]-1)
}
}