Want to get involved? We're always looking for ideas and content for Weekly Challenges.
SUBMIT YOUR IDEA
Hi Maveryx,
A solution to last week’s challenge can be found here.
This challenge was submitted by Patrick Digan (@patrick_digan) an Alteryx ACE and also an active Community member who has contributed to many challenges before. Thank you, Patrick!
This week’s challenge is inspired by a special day that just passed: Pi Day! Not the delicious treat, but the number with an infinite sequence of non-repeating decimals: 3.14, which is celebrated on March 14.
In honor of pi, this week your task is to find all 13 numbers less than or equal to 100,000 that are equal to the nth power of the sum of their digits. For example, 81 is a 2-digit number, so n=2, and (8+1)2 = 81; therefore, it falls under the category we are looking for.
For the input, use the Generate Rows tool to generate numbers from 0 to 100,000.
Bonus question: If you want to take your skills to the next level, you are invited to find all 17 numbers that are equal to any nth power of the sum of its digits. For example, 4,913 works for this. While it will fail for the first task because (4 + 9 + 1 + 3)4 = 83,521, the number 4,913 works well for the bonus question since (4 + 9 + 1 + 3)3 = 4,913.
Need a refresher? Review these lessons in Academy to gear up:
Good luck!
Here is my solution:
Here's my solution for both the main task and the bonus one that doesn't use REGEx
Just doing the challenge for now - the bonus maybe another day 😊
This is very efficient 👍