Prove the following theorem:
Theorem
∀n ∈ Z, n is either even or odd (but not both).
Your proof must address the following points:
1. n is even or odd (and nothing else).
2. n is odd =⇒ n is not even (hint: contradiction).
3. n is even=⇒ n is not odd (hint: contrapositive).
The first point is a bit more difficult. Start by making a
statement about 0. Then assuming that n is even, what can you say
about...
//-----------------------------------------------------------------
// Counts the number of odd, even, and zero digits in an
integer
// input value. Repeat as long as the user wishes to continue
//-----------------------------------------------------------------
public static void main(String[] args)
{
// Declare the identifiers
final int SENTINEL = -99;
// Declare the remaining identifiers ...
Scanner scan = new Scanner(System.in);
// Display the programmer's information
// Input an integer number
// Count the number of odd, even, and...
1. a) Prove that if n is an odd number then 3n + 1is an even
number. Use direct proof.
b) Prove that if n is an odd number then n^2+ 3 is divisible by
4. Use direct proof.
2. a) Prove that sum of an even number and an odd number is an
odd number. Use direct proof.
b) Prove that product of two rational numbers is a rational
number. Use direct proof.
3. a) Prove that if n2is...
Create an application that checks whether an integer is an odd
or even number.
Welcome to the Odd/Even Checker! Enter an integer: ten Error!
Invalid integer. Try again. Enter an integer: 10.3 Error! Invalid
integer. Try again. Enter an integer: 10 The number 10 is even.
Continue? (y/n): Error! This entry is required. Try again.
Continue? (y/n): y Enter an integer: 9 The number 9 is odd.
Continue? (y/n): n
Specifications:
Create a version of the Console class presented in...
prove that for x is an odd, positive integer, 3x ≡−1 (mod 4).
I'm not sure how to approach the problem. I thought to assume that
x=2a+1 and then show that 3^x +1 is divisible by 4 and thus
congruent to 3x=-1(mod4) but I'm stuck.