Given a large number n, find if the number is divisible by 29.
Input : 363927598 Output : No Input : 292929002929 Output : Yes
A quick solution to check if a number is divisible by 29 or not is to add 3 times of last digit to rest number and repeat this process until number comes 2 digit. The given number is divisible by 29 iff the obtained two digit number is divisible by 29.
Number is 348,
Three times of last digit + Rest of the number = 8*3 + 34 = 58
Since 58 is divisible by 29, 348 is also divisible by 29.
- Count the number of pairs (i, j) such that either arr[i] is divisible by arr[j] or arr[j] is divisible by arr[i]
- Number of digits to be removed to make a number divisible by 3
- Check if a number is divisible by all prime divisors of another number
- Find if a number is divisible by every number in a list
- Number of divisors of a given number N which are divisible by K
- Check if a number is divisible by 23 or not
- Rearrangement of a number which is also divisible by it
- Check if a number is divisible by 41 or not
- Multiply the given number by 2 such that it is divisible by 10
- Number of substrings divisible by 8 but not by 3
- Smallest number divisible by first n numbers
- Numbers that are not divisible by any number in the range [2, 10]
- Smallest K digit number divisible by X
- Largest K digit number divisible by X
- Check if a large number is divisible by 2, 3 and 5 or not
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.