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
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.
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.
prove that the sum of two odd integers is even
prove that the sum of two odd integers is even
Prove, using induction, that any integer n ≥ 14 can be written as a sum of...
Prove, using induction, that any integer n ≥ 14 can be written as a sum of a non-negative integral multiple of 3 and a non-negative integral multiple of 8, i.e. for any n ≥ 14, there exist non-negative integers a and b such that n = 3a + 8b.
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT