We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Hackerrank Home
  • Prepare
    NEW
  • Certify
  • Compete
  • Career Fair
  • Hiring developers?
  1. All Contests
  2. ProjectEuler+
  3. Project Euler #30: Digit Nth powers

Project Euler #30: Digit Nth powers

Problem
Submissions
Leaderboard
Discussions

This problem is a programming version of Problem 30 from projecteuler.net

Surprisingly there are only three numbers that can be written as the sum of fourth powers of their digits:

As 1 = 1^4 is not a sum it is not included.
The sum of these numbers is .

Find the sum of all the numbers that can be written as the sum of powers of their digits.

Input Format

Input contains an integer

Constraints

Output Format

Print the answer corresponding to the test case.

Sample Input

4

Sample Output

19316

Author

shashank21j

Difficulty

Easy

Max Score

100

Submitted By

5192

Need Help?


View discussions
View top submissions

rate this challenge

MORE DETAILS

Download problem statement
Download sample test cases
Suggest Edits

Choose a translation


  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy