Python Forum
[Learning] 3 hours for one simple exercise
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Learning] 3 hours for one simple exercise
#3
Please explain explicitly how these number are calculated: (12 + 52 + 92 + 132 + ...)
Please explain what is meant with this statement: "return the sum of the squares of those numbers between 1 and N that are separated from each other by four units."
What is meant with "4 units"?
Where did you get this exercise? Do you know the solutions for numbers n == 1,2,3,4,5,6 etc?
----------------------------------
Let´s look at the number 1 to 10 and their squares:
1 1, 2 4, 3 9, 4 16, 5 25, 6 36, 7 49, 8 64, 9 81, 10 100
If n == 1: the sum of the square of 1 is 1.
if n == 2: the sum is 1 + 5 = 6
if n == 3: the sum is 1+5+9 = 15
if n == 4: the sum is 1+5+9+16 = 31
if n == 5: the sum is 1+5+9+16+25 = 56
n == 6: 56+36 = 92
n == 7: 92+49 = 141
n == 8: 141+64 = 205
n == 9: 205+81 = 286
n == 10: 286+100 = 386

I don´t find any of those sums in your numbers, so i don´t understand your exercise or the numbers you provided have nothing to do with that exercise.
Reply


Messages In This Thread
RE: [Learning] 3 hours for one simple exercise - by ThomasL - Aug-25-2019, 07:41 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Plz help Ive tried for hours and cant do these three problems VB4 1 2,000 Mar-17-2018, 04:59 AM
Last Post: micseydel
  Simple exercise - how to write in python tomtom55 6 5,023 Sep-28-2017, 07:18 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020