47 Answers
New AnswerBetrothed numbers (quasi-amicable numbers) are two positive integers - m,n - satisfying the following relation: sum of dividers of m is n+1 AND sum of dividers of n is m+1 Examples are: (48, 75), (140, 195), (1050, 1925) task: write a code that, given an upper limit, finds all betrothed numbers from 1 to limit and displays the couples write code in any language you prefer :) additional task (the easy part :D): display the couples' count in the given range! good work!
8/22/2017 7:14:19 PM
Luca47 Answers
New Answerhttps://code.sololearn.com/cEBRL2A23iPQ/?ref=app https://code.sololearn.com/cjBYLwf6rych/#cpp
My try. [HTML,CSS,JS] https://code.sololearn.com/WvRowj9um83m/#html You will like it a lot!
@Baptiste 48 is also divisible by 3 :) anyway, here there is wikipedia page about betrothed numbers https://en.wikipedia.org/wiki/Betrothed_numbers i think wikipedia is better than me at explaining :D
My attempt in PHP: https://code.sololearn.com/wO40M7D6815K/#php Got a little longer than expected because I had to filter duplicates.
Betrothed numbers https://code.sololearn.com/ct5au1faVoS5/?ref=app if you input 6200, you get this: [[48, 75], [140, 195], [1050, 1925], [1575, 1648], [2024, 2295], [5775, 6128]] total: 6
@Kiew which problem? this is a challenge thread, task was provided in the OP and answers are solution codes/comments on them... no problems :)
@Antoine here is your code corrected. I saved it as mine only to share the link, all credits (as stated in the code) go to you! https://code.sololearn.com/WxV9u93upSTD/#html
again, thanks everybody for participating the challenge, very appreciated 😊 please give an upvote if you liked it, so (maybe) other users can see it and enjoy it too 😁 hope to see a lot of new answers with new codes!!!
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message