Cody

Problem 189. Sum all integers from 1 to 2^n

Solution 177680

Submitted on 15 Dec 2012 by Baalzamon
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
%% x = 7; y_correct = 8256; assert(isequal(sum_int(x),y_correct))

2   Pass
%% x = 10; y_correct = 524800; assert(isequal(sum_int(x),y_correct))
{"ft_lang_label":"__label__en","ft_lang_prob":0.63033706,"math_prob":0.9848795,"size":542,"snap":"2019-43-2019-47","text_gpt3_token_len":156,"char_repetition_ratio":0.16171004,"word_repetition_ratio":0.0,"special_character_ratio":0.31734318,"punctuation_ratio":0.13592233,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.98739284,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-10-19T20:33:10Z\",\"WARC-Record-ID\":\"<urn:uuid:85fd6c70-683f-438e-ae36-d944d0a7aa45>\",\"Content-Length\":\"70320\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:410b49de-f2f8-4166-9140-6e3c94fdf2fe>\",\"WARC-Concurrent-To\":\"<urn:uuid:446a13b4-c3bb-4514-b36f-2d492ce06093>\",\"WARC-IP-Address\":\"104.110.193.39\",\"WARC-Target-URI\":\"https://jp.mathworks.com/matlabcentral/cody/problems/189-sum-all-integers-from-1-to-2-n/solutions/177680\",\"WARC-Payload-Digest\":\"sha1:TDOWMPTR3AZD7IEXAKED2C2KXVK6BHMI\",\"WARC-Block-Digest\":\"sha1:UWQKF26PKMD3F5TCZR4EGXMJ4UCCNKN7\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-43/CC-MAIN-2019-43_segments_1570986697760.44_warc_CC-MAIN-20191019191828-20191019215328-00370.warc.gz\"}"}