From 8f3efd170fe447dbc5b15593020f9b574020fc3d Mon Sep 17 00:00:00 2001 From: nikhil kala Date: Fri, 17 Apr 2020 18:27:25 +0530 Subject: [PATCH] Delete eulerTotient.cpp already present --- Math/eulerTotient.cpp | 37 ------------------------------------- 1 file changed, 37 deletions(-) delete mode 100644 Math/eulerTotient.cpp diff --git a/Math/eulerTotient.cpp b/Math/eulerTotient.cpp deleted file mode 100644 index c71219641..000000000 --- a/Math/eulerTotient.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include -#include -using namespace std; - -/* -this function calculate euler totien function -*/ - -long long eulerTotient(long long n){ - - if(n == 1) return 1; - long long result = 1LL; - long long temp = n; - for(int i = 2; i <= floor(sqrt(n)) + 10; i++) { - if( temp % i == 0) { - int j = 0; - while(temp % i == 0){ - j ++; - temp /= i; - } - result = result * pow(i,j-1) * (i-1); - } - } - - if(temp == n){ - return n-1; - } - - return result; -} - -int main(){ - long long n; - cin >> n; - cout << eulerTotient(n); - -} \ No newline at end of file