Cody

Problem 566. Sum of first n terms of a harmonic progression

Solution 1605828

Submitted on 10 Aug 2018 by J. S. Kowontan
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
a=1;d=1;n=1; y_correct = 1; assert(isequal(harmonicSum(a,d,n),y_correct));

2   Pass
a=2;d=2;n=5; y_correct = round(3.5746,-4); assert(isequal(round(harmonicSum(a,d,n),-4),y_correct));

3   Pass
a=4;d=5;n=2; y_correct = round(4.6667,-4); assert(isequal(round(harmonicSum(a,d,n),-4),y_correct));
{"ft_lang_label":"__label__en","ft_lang_prob":0.52660835,"math_prob":0.9856994,"size":620,"snap":"2019-43-2019-47","text_gpt3_token_len":201,"char_repetition_ratio":0.1396104,"word_repetition_ratio":0.0,"special_character_ratio":0.3419355,"punctuation_ratio":0.22972973,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9988123,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-10-14T06:27:21Z\",\"WARC-Record-ID\":\"<urn:uuid:cb18264b-d5c5-48ca-b03b-d85d57faa56f>\",\"Content-Length\":\"70691\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d478ec71-bcea-46b9-b6e4-b38eab98c5ac>\",\"WARC-Concurrent-To\":\"<urn:uuid:2a41b473-60d2-4bf7-9233-8ee8243287f8>\",\"WARC-IP-Address\":\"23.13.150.165\",\"WARC-Target-URI\":\"https://kr.mathworks.com/matlabcentral/cody/problems/566-sum-of-first-n-terms-of-a-harmonic-progression/solutions/1605828\",\"WARC-Payload-Digest\":\"sha1:QALIUORP6SXK3HVQUYQYQ2LCJ5ZGQ3UJ\",\"WARC-Block-Digest\":\"sha1:JRC34OGIGVOZO7W7PSNDDMY23DVO3ASL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-43/CC-MAIN-2019-43_segments_1570986649232.14_warc_CC-MAIN-20191014052140-20191014075140-00316.warc.gz\"}"}