octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Euler's totient function


From: Fotios Kasolis
Subject: Euler's totient function
Date: Tue, 16 Nov 2010 16:21:55 +0100

Does Octave have Euler’s totient function? If not, what do you think about including it? It could be as simple as sth like
 
function x = phi (n)
x = sum (gcd ([1:n], repmat (n, 1, n)) == 1)
endfunction
 
or slightly different to allow vector argin.
 
 
/Fotis

reply via email to

[Prev in Thread] Current Thread [Next in Thread]