Cody

# Problem 1486. Method of Common Differences part-2

• Created by G K

This is the inverse problem to Problem 1485. Problem 1485 illustrates the method of differences takes a sequence and takes successive differences till it hits a constant. The output was the initial values and the final common difference. This output can be used to regenerate the original sequence. Thus this problem.

Use the initial value and difference vector in the form output in 1485 and generate first n values of the sequence.

Ex: Consider the vector [1 3 2]. The last value '2' is the second order difference and the previous values are the initial values. This generates the sequence [1 4 9 16 25 36 ... ]

Problem 10) Prev: 1485 Prev: 1496

### Solution Stats

90.91% Correct | 9.09% Incorrect
Last Solution submitted on Mar 09, 2020
{"ft_lang_label":"__label__en","ft_lang_prob":0.78728193,"math_prob":0.86061466,"size":857,"snap":"2020-24-2020-29","text_gpt3_token_len":221,"char_repetition_ratio":0.15826495,"word_repetition_ratio":0.0,"special_character_ratio":0.27187866,"punctuation_ratio":0.077844314,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95866054,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-05-30T04:38:11Z\",\"WARC-Record-ID\":\"<urn:uuid:91a34882-5859-463c-a7b3-d1c183d7c2c4>\",\"Content-Length\":\"79691\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:221d416f-ae94-431e-8c52-e5afcf9fa210>\",\"WARC-Concurrent-To\":\"<urn:uuid:e03d48fa-03ea-4169-90ee-8560113e73f0>\",\"WARC-IP-Address\":\"23.66.56.59\",\"WARC-Target-URI\":\"https://se.mathworks.com/matlabcentral/cody/problems/1486-method-of-common-differences-part-2\",\"WARC-Payload-Digest\":\"sha1:I4DH7GHOLZJIHFGQ5HIRRW4D6BDUZ2NR\",\"WARC-Block-Digest\":\"sha1:4DQ2OVTOMAHLBA2ZCLJPLMENO3RRAS3U\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-24/CC-MAIN-2020-24_segments_1590347407289.35_warc_CC-MAIN-20200530040743-20200530070743-00197.warc.gz\"}"}