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.
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.
- 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
- Minimum number of swaps required to make a number divisible by 60
- Check if a large number is divisible by a number which is a power of 2
- Check if a number is divisible by all prime divisors of another number
- Number of digits to be removed to make a number divisible by 3
- Find if a number is divisible by every number in a list
- Number of substrings with length divisible by the number of 1's in it
- Number of divisors of a given number N which are divisible by K
- Find the Kth number which is not divisible by N
- Check if a number is divisible by 47 or not
- Check if a number is divisible by 31 or not
- Number of substrings divisible by 8 but not by 3
- Check if the given number is divisible by 71 or not
- Check if the number is divisible 43 or not
- Multiply the given number by 2 such that it is divisible by 10
- Number of subsets with sum divisible by M | Set 2
- Check if a number is divisible by 41 or not
- Check if a number is divisible by 23 or not
- Rearrangement of a number which is also divisible by it
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.