{"id":8329,"date":"2009-01-11T03:32:00","date_gmt":"2009-01-11T03:32:00","guid":{"rendered":"http:\/\/melotopia.net\/b\/?p=8329"},"modified":"2009-01-11T03:32:00","modified_gmt":"2009-01-11T03:32:00","slug":"abundant-number","status":"publish","type":"post","link":"http:\/\/melotopia.net\/b\/?p=8329","title":{"rendered":"Abundant number"},"content":{"rendered":"<div class=\"desc\">\n        Project Euler\uc758 23\ubc88 \ubb38\uc81c<br \/>\n        <br \/>\n        &#8220;2\uac1c\uc758 Abundant Number\uc758 \ud569\uc73c\ub85c \ud45c\ud604\ud560 \uc218 \uc5c6\ub294 \ubaa8\ub4e0 \uc591\uc758 \uc815\uc218\uc758 \ud569\uc744 \uad6c\ud558\uc5ec\ub77c&#8221;<br \/>\n        <br \/>\n        (\ub2e8, 28123\ubcf4\ub2e4 \ud070 \uc815\uc218\ub294 \ubaa8\ub450 2\uac1c\uc758 Abundant Number\uc758 \ud569\uc73c\ub85c \ud45c\ud604\ud560 \uc218 \uc788\ub2e4)<br \/>\n        <br \/>\n        http:\/\/projecteuler.net\/index.php?section=problems&#038;id=23<\/p>\n<div class=\"txc-textbox\" style=\"border: 1px solid rgb(254, 254, 184); padding: 10px; background-color: rgb(254, 254, 184);\">\n         #include <stdio.h><br \/>\n         <br \/>\n         #define TRUE 1<br \/>\n         <br \/>\n         #define FALSE 0<\/p>\n<p>         int isAbundantNumber(int);<br \/>\n         <br \/>\n         int sumOfDivisors(int );<\/p>\n<p>         int main(void){<br \/>\n         <br \/>\n         int  i,j,n,sum;<br \/>\n         <br \/>\n         int  abun[6965];<br \/>\n         <br \/>\n         for(i=1;i<28124;i++){\n         <br \/>\n         if(isAbundantNumber(i) == TRUE){<br \/>\n         <br \/>\n         abun[j]=i;<br \/>\n         <br \/>\n         j++;<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         for(i=1;i<28124;i++){\n         <br \/>\n         if(isRepresentable(i, abun)==TRUE){<br \/>\n         <br \/>\n         n+=i;<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         n = (28123*28124\/2)-n;<br \/>\n         <br \/>\n         printf(&#8220;The answer is %d\\n&#8221;, n);<br \/>\n         <br \/>\n         return TRUE;<br \/>\n         <br \/>\n         }<\/p>\n<p>         int isAbundantNumber(int  a){<br \/>\n         <br \/>\n         if(a<sumOfDivisors(a)){\n         <br \/>\n         return TRUE;<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         else{<br \/>\n         <br \/>\n         return FALSE;<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         }<\/p>\n<p>         int isRepresentable(int a, int *b){<br \/>\n         <br \/>\n         int i,j,sum;<br \/>\n         <br \/>\n         for(i=0;i<6965;i++){\n         <br \/>\n         for(j=0;j<6965;j++){\n         <br \/>\n         sum=b[i]+b[j];<br \/>\n         <br \/>\n         if(sum==a){<br \/>\n         <br \/>\n         return TRUE;<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         return FALSE;<br \/>\n         <br \/>\n         }<\/p>\n<p>         int  sumOfDivisors(int  a){<br \/>\n         <br \/>\n         int  i,n;<br \/>\n         <br \/>\n         n=1;<br \/>\n         <br \/>\n         for(i=2;i<a;i++){\n         <br \/>\n         if(a%i==0){<br \/>\n         <br \/>\n         n+=i;<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         }<br \/>\n         <br \/>\n         return n;<br \/>\n         <br \/>\n         }<br \/>\n         \n<\/div>\n<p>\n        \uc774\ubc88\uc5d0\ub3c4 1\ubd84\uc774 \ub118\uae34 \ud588\uc9c0\ub9cc&#8230;-_-;<br \/>\n        <br \/>\n        \uc544\ubb34\ud2bc \ud480\uc5c8\ub2e4.<br \/>\n        <br \/>\n        \uc794\uba38\ub9ac \uad74\ub9ac\ub2e4\uac00 \uc790\uafb8 \ud2c0\ub824\uc11c, \uadf8\ub0e5 Brutal Force \ubc29\uc2dd\uc73c\ub85c \ub54c\uc6e0\ub2e4.<\/p>\n<div style=\"width:100%;margin-top:30px;clear:both;height:30px\">\n<div style=\"width:31px;float:left;\">\n<a href=\"\/toolbar\/popup\/abuseReport\/?entryId=1133\" onclick=\"window.open(this.href, 'tistoryThisBlogPopup', 'width=550, height=510, toolbar=no, menubar=no, status=no, scrollbars=no'); return false;\"><br \/>\n<img data-recalc-dims=\"1\" decoding=\"async\" alt=\"\uc2e0\uace0\" src=\"https:\/\/i0.wp.com\/t1.daumcdn.net\/tistory_admin\/static\/ico\/ico_spam_report.png\" style=\"border:0\"\/><br \/>\n<\/a>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Project Euler\uc758 23\ubc88 \ubb38\uc81c &#8220;2\uac1c\uc758 Abundant Number\uc758 \ud569\uc73c\ub85c \ud45c\ud604\ud560 \uc218 \uc5c6\ub294 \ubaa8\ub4e0 \uc591\uc758 \uc815\uc218\uc758 \ud569\uc744 \uad6c\ud558\uc5ec\ub77c&#8221; (\ub2e8, 28123\ubcf4\ub2e4 \ud070 \uc815\uc218\ub294 \ubaa8\ub450 2\uac1c\uc758 Abundant Number\uc758 \ud569\uc73c\ub85c \ud45c\ud604\ud560 \uc218 \uc788\ub2e4) http:\/\/projecteuler.net\/index.php?section=problems&#038;id=23 #include #define TRUE 1 #define FALSE 0 int isAbundantNumber(int); int sumOfDivisors(int ); int main(void){ int i,j,n,sum; int abun[6965]; for(i=1;i<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[12],"tags":[],"class_list":["post-8329","post","type-post","status-publish","format-standard","hentry","category-12"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8o6gA-2al","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/8329","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=8329"}],"version-history":[{"count":0,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=\/wp\/v2\/posts\/8329\/revisions"}],"wp:attachment":[{"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=8329"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=8329"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/melotopia.net\/b\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=8329"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}