Write a program that with an input of a positive odd number
Ask Expert

Be Prepared For The Toughest Questions

Practice Problems

Write a program that with an input of a positive odd number

Question 5. Visualizing identities

Write a program that with an input of a positive odd number (not more than 30) gives as output the visual representation of the sum of positive odd numbers up to the given number.

Observation: the formula for the sum of consecutive odd natural numbers is:

1 + 3 + 5 + ... + (2 p + 1) = p2 - see the image to understand why this is a visual “proof”.

For 1+3+5+7+9=25, the output should look similar to this :


color with the same color the disks belonging to the same number (see image for 1 + 3 + 5 = 32 )

 

Hint
ComputerA visual proof, also known as a proof without words, is a proof of an identity or mathematical assertion that may be presented as self-evident with the use of a graphic and no accompanying explanatory language. Due to their self-evident character, such arguments might be regarded more elegant than more formal and mathematically rigorous proofs. ...

Know the process

Students succeed in their courses by connecting and communicating with
an expert until they receive help on their questions

1
img

Submit Question

Post project within your desired price and deadline.

2
img

Tutor Is Assigned

A quality expert with the ability to solve your project will be assigned.

3
img

Receive Help

Check order history for updates. An email as a notification will be sent.

img
Unable to find what you’re looking for?

Consult our trusted tutors.

Developed by Versioning Solutions.