1518 Shares

How to prove number is divisible by four? Topic: Homeworks qs programming
June 17, 2019 / By Basmath
Question: I'm studying Precalculus, and I just learned how to do inductive proofs this lesson. However, all homework questions up to this point have an equation already laid out for me that I am supposed to prove. Then I came to this question: Q. Show that 5^n - 1 is divisible by 4 for all natural numbers n. (Read: 5 to the power of n, minus 1.) I do not ask that someone would prove this for me, but I would appreciate it if someone could give me an idea of what kind of equation it is I am trying to prove. I know in programming the modulus operator is used, or bitwise operators, to determine if some number is divisible by another, but I don't know how to do that with simple mathematics. (There is no similar example in the lesson material, although it could be I overlooked something in an earlier lesson.) Best Answers: How to prove number is divisible by four? Adelicia | 1 day ago
You don't need to use modulus operators, but just induction. First show that 5^n - 1 is divisible by 4 when n = 1. Then show that if 5^n - 1 is divisible by 4, then it follows that 5^(n+1) - 1 is divisible by 4. Assume that 5^n - 1 = 4k where k is a natural number. Solve for 5^n and plug the result into 5^(n+1) - 1 (notice that 5^(n+1) = (5^n)*(5))
👍 210 | 👎 1
Did you like the answer? How to prove number is divisible by four? Share with your friends

We found more questions related to the topic: Homeworks qs programming Originally Answered: Write a JAVA prog to check whether a number is divisible by 11.?
This is the ancient no-pencil-and-paper method for finding the remainder, mod 11. Given a positive whole number, alternately add and subtract digits starting with the ones digit and proceeding from right to left. The result has the same remainder as the original number, mod 11. As you go, you can add or subtract 11 whenever needed to keep the total from getting too big, or to keep from doing negative number arithmetic in your head. For your number, the sum is 1 - 4 + 6 - 4 + 1 = 0, if you add it up directly. I might get 11 after seeing that 1-4 would be negative, so I might add 11 to subtract 12-4=8 to get started. From there 8+6-4+1 = 11, and the number is still divisible by 11. As you can see, you can get the same total by adding up the digits on even powers of 10 (ones, hundreds, ten-thousands, ...) and separately adding the odd-power digits (tens, thousands, hundred-thousands, ...) and then subtract the odd sum from the even sum. A java snippet to simulate this brainwork: int num = 14641; String digits = ""+num; int sign = 1; int sum = 0; for (int i=digits.length()-1; i>=0; --i) { ... sum = sum + sign*(int)(digits.charAt(i) - '0'); ... sign = -sign; } Of course, you could use if/then/else to add to one of two different sums (oddsum, evensum) variables instead. Or you can use two separate loops to get the even/odd sums. The odd on might look like: int oddsum = 0; for (int i=digits.length-2; i>=0; i -= 2) { ... oddsum += (int)(digits.charAt(I) - '0'); } Get your version working first, then look at adding/subtracting 11 in the loop to keep the total in bounds. You can set things up so that the final sum (or difference if using two sums) is always in the range 0-10, and is the remainder of the original number, mod 11. Note the use of (int)(digit - '0') to convert a digit character to the equivalent int value. This only works if the digits string has only ASCII digit characters in the range '0'..'9'. If the original number was negative, this assumption will fail. Handle this condition, or make sure the number is not negative. Originally Answered: Write a JAVA prog to check whether a number is divisible by 11.?
Well it appears this is for a school project, so I am not going to give you a direct answer, but what I will do is give you a hint to look outside the box and come up with an answer that is completly different then what the teacher is expecting. My favorite way to learn was when I came up with a solution that NO ONE else thought of. take the number input, devide it by 11 and pass the result to a floating point number. Convert the floating point number to a string, split the string at the decimal and convert the numbers to the right of the dec to an integer and then check if the value of the int is 0. Originally Answered: How many 4-digit numbers are not divisible by 11?.?
Assuming that 0000 doesn't count, and that negative numbers don't count, you're left with all the numbers from 1000 to 9999. Do A) first. 10000 is too big. 999 is too small. How many numbers are in between? 9999 minus 999 = 9000. B) 1000 doesn't divide by 11 evenly. 1001 does. If you add 11, you get 1012. So every 11th number is divisible by 11. 9000 / 11 * 10 = 818.18. Or, either 818 or 819 are divisible. You could write something like: 990 + x times 11 = y. when x = 0, y = 990, but that's outside of 1000 - 9000 so that doesn't count. If x = 1, then y = 1001, that works. Now try x = 818. 990 + 818 * 11 = 9988. That's within range. Try the last one: x = 819. 990 + 819 * 11 = 9999. That works too. There are 819 numbers divisible by 11 between 1000 and 9999 inclusive. C) 9000 - 819 = 8181. Originally Answered: How many 4-digit numbers are not divisible by 11?.?
a) 9000 4-digit numbers you take the last 4-digit number (9999) and subtract the number of >4-digit numbers (999) and you get 9000 4-digit numbers left. (b) 819 4-digit numbers just divide 9000 by 11, then you should get that number.... I'm not sure if this is right, it should be right, considering if I divide 9000 by 10, I would 900, so dividing 9000 by 11 shouldn't be that far off from dividing with 10. (c) 8181 4-digit numbers just subtract 818 from 9000 OF COURSE, THIS ONLY APPLIES IF YOU'RE GOING TO THINK THAT THERE ARE NO ZEROES IN FRONT OF OF THE >4-DIGIT NUMBERS. IF YOU DO THINK THAT THERE ARE ZEROES IN FRONT OF THE >4-DIGIT NUMBERS, JUST USE 10000 (9999 NUMBERS, ALSO ADDING 0000) INSTEAD OF 9000. Originally Answered: How many 4-digit numbers are not divisible by 11?.?
9 options for the first digit 10 options for each of the second, third and fourth digits A total of 9×10×10×10 = 9000 four digit numbers. Smallest four digit number divisible by 11 is 1001 = 11×91 Largest four digit number divisible by 11 is 9999 = 11×909 Number of four digit numbers divisible by 11 is 909-91+1 = 819 Number of four digit numbers NOT divisible by 11 is 9000-819 = 8181

If you have your own answer to the question homeworks qs programming, then you can write your own version, using the form below for an extended answer.