Sum digits of 2^p with p<=10.000.000

Правка en1, от I_LOVE_ROMANIA, 2019-11-30 13:26:39

Hey guys! My professor proposed me to solve this problme. Given a number p <= 10^7, print the sum of the digits of 2^p. For exemple, 2^4 = 16 so we'll print 7. How can I do this properly? I first tried to use in a way or in another, the little theorem of fermat but it made no sense here.

Теги #math

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский I_LOVE_ROMANIA 2019-11-30 13:26:39 324 Initial revision (published)