Question

Use induction to prove the following: - Prove that the sum of the first n odd...

Use induction to prove the following:

- Prove that the sum of the first n odd integers is n2

writing a proof and then a program to go along with it.

Homework Answers

Answer #1

Program

#include <stdio.h>
#include <math.h>
int main()
{
    int i, num, sum=0, sqr=0;
  
    printf("Enter Value Of N: ");
    scanf("%d", &num);
    i=num;
    while(i>0)
    {
       sum = sum + ((i * 2)-1);
       i--;  
    }
    printf("\nSum of First %d odd numbers is = %d\n",num ,sum);
   sqr = num*num;
   printf("\nSquare Root of %d is = %d\n",num, sqr);
    return 0;
}

OUTPUT

We need to Prove the following

1+3+5+...+(2n-1) =n2

1=1=12
1+3=4=22
1+3+5=9=32
1+3+5+7=16=42
1+3+5+7+9=25=52

So the Answer is 1+3+5+...+(2n-1) = n2

Proof

Step 1.
For n = 1 it's true that 1 = 2*1-1

Step 2.
We suppose that 1+3+5+...+(2n-1) = n2 and need to prove the equation 1+3+5+...+(2(n+1)-1) = (n+1)2

Hence if we add (2(n+1) -1) to the equation it becomes
1+3+5+...+(2n-1) = n2

And the equation becomes
1+3+5+...+(2n-1) + (2(n+1) -1) = n2 + (2(n+1) -1)

After Simplification
1+3+5+...+(2(n+1) -1) = n2 + 2n+2 -1

but we have n2+2n+1 = (n+1)2

So it proves our theorm.
1+3+5+...+(2(n+1)-1) = (n+1)2

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using PMI prove that the sum of the first n positive odd integers is n2? Is...
Using PMI prove that the sum of the first n positive odd integers is n2? Is there a way to prove it substituting n+1 for n in the LHS and RHS?
Statement: "For all integers n, if n2 is odd then n is odd" (1) prove the...
Statement: "For all integers n, if n2 is odd then n is odd" (1) prove the statement using Proof by Contradiction (2) prove the statement using Proof by Contraposition
Prove the following: If n is odd, use divisibility arguments to prove that n3 −n is...
Prove the following: If n is odd, use divisibility arguments to prove that n3 −n is divisible by 24. If the integer n is not divisible by 3, prove that n2 + 2 is divisible by 3.
Use mathematical induction to prove that 12+22+32+42+52+...+(n-1)2+n2= n(n+1)(2n+1)/6. (First state which of the 3 versions of...
Use mathematical induction to prove that 12+22+32+42+52+...+(n-1)2+n2= n(n+1)(2n+1)/6. (First state which of the 3 versions of induction: WOP, Ordinary or Strong, you plan to use.) proof: Answer goes here.
Use Mathematical Induction to prove that for any odd integer n >= 1, 4 divides 3n+1.
Use Mathematical Induction to prove that for any odd integer n >= 1, 4 divides 3n+1.
Prove the following: Let n∈Z. Then n2 is odd if and only if n is odd.
Prove the following: Let n∈Z. Then n2 is odd if and only if n is odd.
1. Use mathematical induction to show that, ∀n ≥ 3, 2n2 + 1 ≥ 5n 2....
1. Use mathematical induction to show that, ∀n ≥ 3, 2n2 + 1 ≥ 5n 2. Letting s1 = 0, find a recursive formula for the sequence 0, 1, 3, 7, 15,... 3. Evaluate. (a) 55mod 7. (b) −101 div 3. 4. Prove that the sum of two consecutive odd integers is divisible by 4 5. Show that if a|b then −a|b. 6. Prove or disprove: For any integers a,b, c, if a ∤ b and b ∤ c, then...
Use strong induction to prove that every natural number n ≥ 2 can be written as...
Use strong induction to prove that every natural number n ≥ 2 can be written as n = 2x + 3y, where x and y are integers greater than or equal to 0. Show the induction step and hypothesis along with any cases
Prove by induction that if n is an odd natural number, then 7n+1 is divisible by...
Prove by induction that if n is an odd natural number, then 7n+1 is divisible by 8.
1) Prove by induction that 1-1/2 + 1/3 -1/4 + ... - (-1)^n /n is always...
1) Prove by induction that 1-1/2 + 1/3 -1/4 + ... - (-1)^n /n is always positive 2) Prove by induction that for all positive integers n, (n^2+n+1) is odd.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT