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 ways to split a binary number such that every part is divisible by 2
- 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
- Rearrangement of a number which is also divisible by it
- Check if a number is divisible by 23 or not
- Check if a number is divisible by 41 or not
- Number of substrings divisible by 8 but not by 3
- Number of subsets with sum divisible by M | Set 2
- Multiply the given number by 2 such that it is divisible by 10
- Check if a large number is divisible by 4 or not
- Check if a large number is divisible by 3 or not
- Check if a large number is divisible by 8 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 firstname.lastname@example.org. 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.