A039778 phi(n) is equal to the sum of prime factors and exponents of n+1.
32, 38, 54, 56, 84, 20720
Offset: 1
Examples
phi(38)=18, 39=3^1*13^1, 3+1+13+1=18.
Programs
-
Mathematica
Select[Range[30000], EulerPhi[#] == Plus @@ Flatten@ FactorInteger[# + 1] &] (* Giovanni Resta, Jun 11 2016 *)
-
PARI
isok(n) = (f = factor(n+1)) && (sum(i=1, #f~, f[i,2]) + sum(i=1, #f~, f[i,1]) == eulerphi(n)); \\ Michel Marcus, Jun 03 2014
Comments