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, 21.06.2019 21:30
What’s the process of observing someone actually working in a career that interests you?
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
The average cost of one year at a private college in 2012-2013 is $43,289. the average grant aid received by a student at a private college in 2012-2013 is $15,680.   what is the average student contribution for one year at a private college in 2012-2013?
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:30
Which of the following would not be considered a pc? a. mainframe b. desktop c. tablet pc d. laptop
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, 14.10.2021 19:50
question
Mathematics, 14.10.2021 20:00
question
Law, 14.10.2021 20:10
Questions on the website: 13722367