Given a function, Y = (X^6 + X^2 + 9894845) % 971 for a given value. The task is to find the value of the function.
Input: x = 5 Output: 469 Input: x = 654654 Output: 450
Y = (X^6 + X^2 + 9894845) % 971.
If we break down the equation we get Y = (X^6)%971 + (X^2)%971 +(9894845)%971
and we can reduce the eqution to Y=(X^6)%971 + (X^2)%971 + 355.
Below is the required implementation:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find the maximum possible value for the given periodic function
- Find Landau's function for a given number N
- Find Cube root of a number using Log function
- Find number from given list for which value of the function is closest to A
- Find Maximum and Minimum of two numbers using Absolute function
- Find ceil of a/b without using ceil() function
- Spt function or Smallest Parts Function of a given number
- How to call some function before main() function in C++?
- Difference between Virtual function and Pure virtual function in C++
- Find the value of f(n) / f(r) * f(n-r)
- Find 2^(2^A) % B
- Find N from the value of N!
- Find value of (n^1 + n^2 + n^3 + n^4) mod 5 for given n
- Find value of (1^n + 2^n + 3^n + 4^n ) mod 5
- Find K such that |A - K| = |B - K|
- Find the value of max(f(x)) - min(f(x)) for a given F(x)
- Find (1^n + 2^n + 3^n + 4^n) mod 5 | Set 2
- Find the other number when LCM and HCF given
- Find N values of X1, X2, ... Xn such that X1 < X2 < ... < XN and sin(X1) < sin(X2) < ... < sin(XN)
- Find (a^b)%m where 'b' is very large
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.