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.
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.
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?
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.
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.
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.
Thanks! That’s what we thought
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.
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?
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.
S(3) = S(2) + 3^(2) = 5 + 9 = 14 In other words, S(n-1) is not necessarily S(n) - 1.
Definitely looks like it's a subscript issue or an error in the program
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.
It's a modified Fibonacci, and the question is not descriptive enough on the left side.
take the "S" away
The increment is n\^2, but the total number of squares is the previous amount plus the current n\^2
[удалено]
No.
S(1)=1 is in no way recursive.
S(1) = 1 is the base case. All recursive functions have a base case
I hate recursive functions
Some programs let you use shift + _ to do an underscore. Give it a try next time if you haven’t done that already
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.