Skip to content

learn-co-students/project-euler-power-digit-sum-onl01-seng-ft-012120

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Euler Power Digit Sum

Write a method, power_digit_sum, that takes a base (x) and an exponent (n) as arguments and returns the sum of the digits of x raised to the power of n. It should work for arbitrarily large n (at least up to n = 1000).

For example, power_digit_sum(2, 4) would return 7:

  • 2 to the power of 4 is 16
  • 1 + 6 = 7

Run learn until you get all of the RSpec tests to pass.

Source

View Project Euler Power Digit Sum on Learn.co and start learning to code for free.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages