id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

test2022_05_16_APSL_factorSum


Write a method that returns a string showing the sum of all the proper factors as shown in the test data. For example, for 6 you would return "2+3=5" because 2 and 3 are all the proper factors of 6 and 2+3=5. Look at the test data for additional examples.


test2022_05_16_APSL_factorSum(362880) → "2+3+4+5+6+7+8+9+10+12+14+15+16+18+20+21+24+27+28+30+32+35+36+40+42+45+48+54+56+60+63+64+70+72+80+81+84+90+96+105+108+112+120+126+128+135+140+144+160+162+168+180+189+192+210+216+224+240+252+270+280+288+315+320+324+336+360+378+384+405+420+432+448+480+504+540+560+567+576+630+640+648+672+720+756+810+840+864+896+945+960+1008+1080+1120+1134+1152+1260+1296+1344+1440+1512+1620+1680+1728+1890+1920+2016+2160+2240+2268+2520+2592+2688+2835+2880+3024+3240+3360+3456+3780+4032+4320+4480+4536+5040+5184+5670+5760+6048+6480+6720+7560+8064+8640+9072+10080+10368+11340+12096+12960+13440+15120+17280+18144+20160+22680+24192+25920+30240+36288+40320+45360+51840+60480+72576+90720+120960+181440=1118159"
test2022_05_16_APSL_factorSum(105) → "3+5+7+15+21+35=86"
test2022_05_16_APSL_factorSum(42367) → "13+3259=3272"

...Save, Compile, Run (ctrl-enter)

public String test2022_05_16_APSL_factorSum(int num) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 250

Copyright Nick Parlante 2017 - privacy