Posts

Showing posts with the label digit fifth powers

Digit fifth powers | Project Euler | Problem #30

URL to the problem page:  https://projecteuler.net/problem=30 Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits: 1634 = 1⁴ + 6⁴ + 3⁴ + 4⁴ 8208 = 8⁴ + 2⁴ + 0⁴ + 8⁴ 9474 = 9⁴ + 4⁴ + 7⁴ + 4⁴ As 1 = 1⁴ is not a sum it is not included. The sum of these numbers is 1634 + 8208 + 9474 = 19316. Find the sum of all the numbers that can be written as the sum of fifth powers of their digits. #include   <iostream> using   namespace   std ; long   long   int   power ( long   long   int   a ,  long   long   int   b ) {      long   long   int  result =  1 ;      for  ( int  i =  0 ; i < b; i++) {         result = result * a;     }      return...
My photo
Ercan Tomac
instagram.com/ercantomac