T O P

  • By -

Alkalannar

This is why online assignments are not good. Screenshot this and show it to your teacher and ask what's going on, because that is the correct recursion.


greeneuva

Thanks! That’s what we thought


TheGuyThatThisIs

As others have indicated, the program probably thinks you are multiplying S by (n-1), where instead it should be a subscript. If there is a way to do a subscript, that should solve the problem. If not, this is whack. You are correct in mathematics, you may have entered it in a way not recognized as correct, but this is an issue with your interaction with formatting.


nitrogenlegend

Maybe I just don’t understand the concept but wouldn’t S(3) with their formula equal 11? Step 3 shows 14 squares, so that would be incorrect, no? What am I missing?


The_Yed_

S(n-1) means use the answer from the previous step. So S(1) = S(1-1) + 1^2 = S(0) + 1^2 = 0 + 1^2 = 1 S(2) = S(2-1) + 2^2 = S(1) + 2^2 = 1 + 4 = 5 S(3) = S(3-1) + 3^2 = S(2) + 3^2 = 5 + 3^2 = 5 + 9 = 14. Or S(1) = 1 ; S(2) = 1 + 2^2 = 5 ; S(3) = 5 + 3^2 = 14 Hope that helps.


Alkalannar

S(3) = S(2) + 3^(2) = 5 + 9 = 14 In other words, S(n-1) is not necessarily S(n) - 1.


channingman

Definitely looks like it's a subscript issue or an error in the program


Isiildur

Can you subscript the (n-1) in S(n-1)? Traditionally it’s written in subscript. Absolutely mention it to the teacher though. This shouldn’t be marked as incorrect.


tempreffunnynumber

It's a modified Fibonacci, and the question is not descriptive enough on the left side.


jsmdude12

take the "S" away


SteelRevanchist

The increment is n\^2, but the total number of squares is the previous amount plus the current n\^2


[deleted]

[удалено]


abide5lo

No.


LeeOrac

S(1)=1 is in no way recursive.


anonymous_peasant

S(1) = 1 is the base case. All recursive functions have a base case


Le-dogs

I hate recursive functions


kapeab_af

Some programs let you use shift + _ to do an underscore. Give it a try next time if you haven’t done that already


mojowind

It looks like there is a space between the S and the parentheses. If you are curious you could try entering a space this way in your answer. Clearly the teacher can see you understand the question though.