⚠️Challenge: how many odious numbers smaller than 10.000 can you find⚠️
odious numbers are non-negative numbers that have an odd number of ones in the binary expansion # 21 = 10101 = 3 # 50 = 110010 = 3 Challenge: how many odious numbers smaller than 10000 can you find? edit: first of all, thanks to everyone for the massive response!! And of course thanks to Sololearn for making my first post ever COTD! Now, the answer is indeed: 5000. the solution is in fact quite simple: https://code.sololearn.com/cSURNat0z4aN/#rb ------------------------------------------------- WALL OF FAME (sorry if I missed yours) ------------------------------------------------- Phython https://code.sololearn.com/cTYPIZDj3jAe C# https://code.sololearn.com/cSMFtFx0ppSE/ Java https://code.sololearn.com/cY4Q8IWoXED7/ Ruby https://code.sololearn.com/cBS3MX4AJ5AG/ (ONELINER!) C https://code.sololearn.com/csYPoI3aYW3Z#c (ASSEMBLER!) C++ https://code.sololearn.com/chPjNwhxSn9G/ Python https://code.sololearn.com/cX4YOhrrwTT4/ Python https://code.sololearn.com/cypCqoU0rX (ONELINER!) PHP https://code.sololearn.com/wtNdvjh16Ac9/ C++ https://code.sololearn.com/cAgm43t2SjAp/ PHP https://code.sololearn.com/wtHvYfDAoc1d/ C# https://code.sololearn.com/cT4V6XIp87AV/ (ONELINER!) Python https://code.sololearn.com/c5jF395sA9hZ Javascript https://code.sololearn.com/W3hRTRmTmctd/ Java https://code.sololearn.com/cliBAk1pL59h/ C# https://code.sololearn.com/cTR605gBHs6H/ (PURE MATHS!) C# https://code.sololearn.com/ccMSQT42vXXd/ Python https://code.sololearn.com/c5LP4b4H85ra/ (MATH) Web https://code.sololearn.com/WN8491v4583Q/ C++ https://code.sololearn.com/c8F2EP6kdIK0/ (FLOAT) Web https://code.sololearn.com/WN7olfJj5VH4/ C++ https://code.sololearn.com/cbU813A6sLeC/