|
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 |
[Prev in Thread] | Current Thread | [Next in Thread] |