subject

Write a function addupsquaresandcubes that adds up the squares and adds up the cubes of integers from 1 to n, where n is entered by the user. this function should return two values - the sum of the squares and the sum of the cubes. use just one loop that generates the integers and accumulates the sum of squares and the sum of cubes.

then, write two separate functions sumofsquares and sumofcubes to calculate the sums of the squares and sum of the cubes using the explicit formula below.

1**2 + 2**2 + 3**2 + + n**2 = n(n+1)(2n+1)/6
1**3 + 2**3 + 3**3 + + n**3 = n**2(n+1)**2/4
write functions to add these formulas to your program and print out their results as well as that of the explicit summations. the user dialog will look something like this:

warning: the equations above a math equation and the syntax may not work for python as written.

the sum of squares is 55
the sum of cubes is 225

the explicit sum of squares is 55
the explicit sum of cubes is 225

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 18:00
Martha is a healer, a healthcare provider, and an experienced nurse. she wants to share her daily experiences, as well as her 12 years of work knowledge, with people who may be interested in health and healing. which mode of internet communication can martha use?
Answers: 3
question
Computers and Technology, 23.06.2019 04:31
Q13 what function does a security certificate perform? a. creates user accounts b. scrambles data c. identifies users d. creates password policies e. provides file access
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
What is html ? give a small description about html
Answers: 2
question
Computers and Technology, 23.06.2019 22:50
What is an rss reader used for? for creating a user account on a social new site
Answers: 2
You know the right answer?
Write a function addupsquaresandcubes that adds up the squares and adds up the cubes of integers fro...
Questions
question
Mathematics, 11.09.2020 14:01
question
Physics, 11.09.2020 14:01
question
Biology, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Physics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Physics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Physics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
question
Mathematics, 11.09.2020 14:01
Questions on the website: 13722367