28 Replies
Index 0: 2
Index 1: -1
....
this 98 is a pain
Basically, I know this piece of a sequence:
2, -1, 8, -4, 26, -16, 98, ...
And I have to find the value in the input
index.
So, if anyone inputs 0, it returns 2
If anyone inputs 1, it returns -1
And so on...
My uni teacher
lol
I broke it down to this, although it is python, let me send
** = ^ in c#my guy
😌
there isn't much more to say
It's really just that
i'm pretty sure the professor didn't want you to analyze the sequence
get an index as input and return the value in that position
on this given sequence
The "homework" is literally that lol
analyze?
I'll translate
i can make tons of different sequences that start with
2, -1, 8, -4, 26, -16, 98, ...
let's say, as many as the number of real numbersTried to translate
So, no
I don't need to literally write that lol
how is this possible
Wym?
We have to believe that there is a logic behind that sequence, and find out what the logic is
For example,
0, 1, 2, 3, 4, 5, 6, ...
literally how can i find 10th number when just 7 numbers and nothing else are given
It's clear that I'd have to simply
Console.WriteLine(input)
is that clear?
why 9 cannot come after 6?
Yes, that's what anyone with a basic logical thinking would deduct by seeing this piece of the sequence
holy fuck
Well, not much more than that
We'd have to try and deduct the logic behind it
... that doesn't make sense
Imho, it's clear that after 98 we'd have a -64
mathematicians will get upset lol
Idk if there is a math formula for this sequence
Most likely that there isn't
for instance, i can set the sequence
a[n] = \sum_{i=1}^7 c_i a[n-i]
for n > 6 for arbitrary values c_1, ..., c_7 and it's validI do feel like this is the way it should be at least, or something near to that
btw how did you do that
(solving a linear simultaneous equations)
how about this for
0, 1, 2, ..., 6
1,-1,1,...,-1
?