Masala #M0UVX3OJPM
Armstrong sonlar
Soliha matematika faniga qiziqadi va u Armstrong sonlarini o'rganib chiqdi va yangi masala tuzishga qaror qildi. Solihaning masalasini yechishga harakat qiling.
Sizga (0<N≤1000000000) oraliqdagi N soni beriladi. Agar N soni Armstrong soni bo'lmasa shu songacha bo'lgan juft va toq Armstrong sonlarining nechta ekanligini chop eting. N Armsrtrong soni bo'lsa nechta toq va juft Armstrong sonlari borligi va shu Armstrong sonini ham chop eting.
Natijani chiqaring.
# | input.txt | output.txt |
---|---|---|
1 |
10 |
4 5 |
2 |
153 |
4 6 Armstrong soni |
Armstrong sonini topish formulasi quyidagicha:
\(abcd...=a^n+b^n+c^n+d^n+....=N\)
153 soni Armstrong soni chunki
\(1^3+5^3+3^3=1+125+27=153\)
54748 ham Armstrong soni
\(5^5 + 4^5 + 7^5 + 4^5 + 8^5 = 3125 + 1024 + 16807 + 1024 + 32768 = 54748\)