0

Could you please help me to understand the task.

The topic of the task is Recurrence formula. There is a txt file with integers that represent the members of the row of a(k), starting with k = 0. It is required to calculate the value of S (100), starting with k = 3, if S (k) = S (k-1) + 2 * a (k + 1) + a (k) and S (2) = 5.

As far as I understand the conditions of the task, each namber is a(k), where k = 0, ..., n. If this is correct, then the first number is a(0) = 197, the second number is a(1) = 381, the third is a(2) = 171, etc. I don't understand what S(k) is.

By definition, a recurrence formula is a formula that expresses each term in a sequence through the previous terms. Does this mean that S (100) is the hundredth term in the sequence of numbers? If so, then why was it expressed through the new letter S(k), and not left a(k)? It turns out that the formula contains both S(k) and a(k), denoting the same thing, which seems to be nonsense. And again, if S(k) is the k-th term, then why S(2) = 5? Where does 5 come from?

For some reason, the name of the text file with numbers contains the word sum - sum_recurr_rd_1.txt. Does this mean that S(k) is not the k-th term, but the sum of the k-th terms and I need to find the sum of the first 100 numbers but starting from a(3) = 385 instead of a(0) = 197 since it is said to start with k = 3. But even if we assume that this is the case (although I'm not sure), then the result of summ of firts 100 terms is not the correct answer. I checked. Or maybe I need to sort the sequence of numbers before starting the calculation? Although nothing is said about this.

I see that my understanding of the assignment and perhaps the topic itself is not correct. Please help me figure out what is the S(k) that need to be find?

Thank you!

197
381
171
385
30
417
105
125
191
347
311
158
281
114
184
241
234
228
181
531
154
422
62
204
458
222
162
160
501
287
555
428
465
168
125
206
13
191
100
129
198
399
301
419
12
543
180
472
427
462
444
506
520
122
246
140
233
219
415
324
195
539
6
197
160
291
524
245
383
400
517
363
260
361
168
26
182
230
560
185
357
206
295
442
201
198
507
311
352
521
565
491
30
288
211
402
318
142
376
302
437
336
170
205
492
287
245
178
72
119
448
341
133
311
33
472
301
309
186
236
274
549
239
552
352
101
78
385
451
565
256
278
252
144
508
328
475
313
370
144
192
282
122
482
14
366
154
54
435
376
459
394
389
259
507
289
252
119
449
121
553
107
129
202
351
87
495
219
180
333
342
334
36
365
325
215
86
376
92
236
336
15
251
416
131
259
342
176
404
64
268
434
559
349
485
440
337
31
153
0
299
204
483
246
88
44
234
445
133
100
376
136
160
3
535
562
101
463
401
104
443
365
315
394
345
126
188
234
258
316
61
74
564
108
178
190
383
506
295
560
333
398
476
16
63
242
272
358
510
300
377
328
450
465
465
156
387
528
449
180
260
175
157
225
176
309
349
129
484
247
167
345
565
420
387
144
83
215
137
532
116
185
392
307
388
184
282
35
299
226
165
432
37
21
156
67
191
259
532
482
518
178
214
103
413
296
179
326
232
230
258
154
358
73
293
287
315
385
28
202
321
247
13
350
391
510
147
417
20
510
433
544
140
217
364
415
418
31
119
43
73
58
329
533
204
336
566
74
50
42
198
186
277
471
60
437
308
76
329
552
480
355
306
514
20
545
116
561
256
46
192
251
398
413
395
402
264
530
193
499
428
426
74
385
263
61
566
518
236
345
259
51
391
67
126
34
356
117
213
240
442
182
249
94
59
102
183
283
522
418
381
14
228
350
301
344
79
320
51
72
266
42
287
357
428
477
396
335
445
323
307
544
416
133
193
188
507
364
457
508
546
411
27
126
497
355
197
126
151
132
509
403
492
183
121
28
188
115
344
154
460
406
394
386
100
477
474
261
240
528
529
9
58
442
372
320
437
110
558
69
253
521
257
560
532
346
29
405
557
314
388
54
122
225
490
187
373
416
369
24
116
185
180
268
540
313
464
418
503
327
50
17
219
329
545
139
454
16
319
391
304
244
477
15
499
114
60
223
23
132
456
1
426
203
104
447
223
360
114
16
344
512
72
325
151
299
289
352
418
431
513
423
76
510
45
499
154
220
405
249
352
247
281
486
303
14
353
341
445
109
437
418
271
318
8
496
190
128
539
129
135
348
31
555
437
455
424
486
249
149
457
82
4
334
127
82
368
444
307
357
99
184
143
431
476
108
392
101
84
519
149
344
426
158
367
434
309
71
419
313
124
455
534
179
44
51
471
446
177
406
146
73
283
515
50
123
348
154
407
242
181
320
533
390
293
39
527
110
230
5
143
559
112
345
170
138
344
62
46
410
444
566
89
476
316
432
35
469
53
207
56
150
88
523
14
237
436
221
219
498
466
209
138
443
333
213
285
406
360
431
380
65
368
481
18
122
254
35
266
396
324
379
40
141
248
382
157
193
281
156
184
410
516
482
100
207
314
239
564
33
388
291
29
171
403
419
516
346
75
430
325
326
170
142
280
360
475
43
452
123
384
244
281
188
502
377
489
431
362
89
142
380
544
112
434
364
197
108
36
284
261
305
410
219
298
132
143
336
173
301
468
0
501
10
388
243
369
456
136
3
453
350
107
275
318
0
184
286
57
338
210
369
101
367
470
160
494
559
501
112
148
453
59
154
149
25
45
366
546
324
101
89
301
288
196
293
251
146
309
38
411
228
91
84
172
277
526
336
426
194
308
249
14
120
79
454
307
220
533
512
56
380
267
488
305
332
163
176
376
496
446
507
409
53
449
207
517
134
557
163
420
554
235
217
552
470
86
208
351
320
528
252
436
187
144
210
510
36
129
397
428
511
193
440
450
23
369
2
340
336
53
177
239
485
72
24
452
394
166
317
339
544
423
6
235
196
215
86
154
351
2
360
414
308
239
174
464
253
539
145
346
252
162
259
419
207
406
173
23
451
477
318
303
125
300
260
185
494
262
158
511
104
152
318
164
439
333
384
378
435
77
11
398
120
407
38
12
320
493
98
78
269
241
443
160
20
136
527
274
237
116
235
344
298
186
22
226
175
64
53
211
313
58
174
159
165
268
310
216
316
57
318
4
128
335
245
390
315
377
176
Gelios
  • 3

1 Answers1

0

In the context, it is reasonable to assume S(k) is the sum of first k terms and a(k) is each term. We need to know S(2) (or a(1)+a(2)),a(3),a(4) and a(101) to get S(100)as proved below. Not sure how to link this with the data, as you said it is not clear where S(2)=5 comes from.

S(k)=S(k-1)+2a(k+1)+a(k)

S(100)=S(99)+2a(101)+a(100)

S(99)=S(98)+2a(100)+a(99)

S(98)=S(97)+2a(99)+a(98)

...

S(4)=S(3)+2a(5)+a(4)

S(3)=S(2)+2a(4)+a(3)

So

S(100)=S(2)+2a(101)+2a(4)+a(3)+3(a(4)+a(5)+...+a(100))

S(100)=S(2)+2a(101)+2a(4)+a(3)+3S(100)-3(a(1)+a(2)+a(3))

S(100)=-$\frac{S(2)+2a(101)+2a(4)+a(3)-3(a(1)+a(2)+a(3))}{2}$

S(100)=S(2)-a(101)-a(4)+a(3)

S(100)=S(2)+a(3)-a(4)-a(101)

Star Bright
  • 2,338
  • thank you! I got it. This formula is for finding terms in a new set of numbers. I thought it was for the existing set of numbers that are given in the problem. – Gelios Mar 22 '21 at 07:54