Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Euleryx Project 13 – Large Sum

Pilsner
13 - Pulsar

Euleryx Problem 13 – Large Sum

Pilsner_0-1761257019529.png

 

 

My workflow:

Spoiler
Pilsner_1-1761257031307.png

 



Answer: 5537376230



Last Week's Favourite Solution:
Well, compared to my solution, everyone else's solutions ran in an instance so it was very helpful to see all the different ways to solve problem 12 quickly. Key take away for me was to look carefully at any iteratives (use a generate rows if possible)! But as always there is a winner, it was a particularly tough decision but for a very impressive run time of <2 seconds and no macros required, @CoG has won this weeks award! Please find this solution on page one of last week's post or click here.

 

 

Mathematical Theory:

This week's challenge is admittedly very easy for Alteryx to handle, so I'm going to add an extra layer to think about. What if we wanted the first 20 digits from the sum?

Some numeric data types only allow for a certain level of precision, whilst a double can often seem like the easy option, it comes with its own challenges when dealing with large numbers. If you look at the documents, you’ll quickly realise that a double is only accurate to 15 digits.

https://help.alteryx.com/current/en/designer/file-types-support/data-types.html#id624812

So how can we handle 50 digits? I could attempt to explain this myself, but instead, I would like to point you in the direction of the article that first taught me how to get around this issue. Yes, I have referenced this blog before, but I'm going to do so again -  @Gaurav_Dhama_  released a blog that not only discusses this issue but also explains how certain tools can be deceptive and even convert numeric values to different data types in the background. For anyone interested, I would strongly recommend a read. (Handling Unusually Large Numbers)

 

Method:
1) Convert the data type of the inputs to a fixed decimal. As there are 100, 50-digit numbers, we know the maximum number of digits possible after summing them will be 52 so just make sure the fixed decimal precision is > 52.

Pilsner_2-1761257077826.png

 



2) Use the summarise tool to sum the data.

Pilsner_3-1761257082436.png

 



3) Submit your answer to the Project Euler Website!

WalkingDeadEasyGIF.gif




Summary:

Although the problem itself is no match for Alteryx, this problem can help highlight the importance of numeric data types and draw attention to the fact that you can't just set everything to be a double! For anyone seeking more of a challenge, don't worry, next weeks problem certainly requires more than 2 tools.

 

Want to find out more, follow this link to our introduction post - Euleryx: Let The Games Begin.

8 REPLIES 8
Qiu
21 - Polaris
21 - Polaris

Thank you for another new one.
I also used the FixedDecimal data type for this one.
We can also use the Number to String then perfrom string addtion approach, which will appear in latter problems. 😁

Spoiler
Euleryx Project 13A.png
DaisukeTsuchiya
14 - Magnetar
14 - Magnetar
Spoiler
I calculated it after dividing by 10^40.

スクリーンショット 2025-10-24 085720.jpg
.
patrick_digan
17 - Castor
17 - Castor
Spoiler
image.png
AkimasaKajitani
17 - Castor
17 - Castor

Regarding to this problem, "double" works well because the calculation was performed within the range of double precision.

 

However I created the big number calculate method for the future problems. In the future problem, I create the macro.

 

Spoiler
AkimasaKajitani_0-1761362432224.png

 

 

 

NicoleJ
Alteryx
Alteryx

Fun one to solve in DCloud! Not sure I've ever had to carry over a number quite that large in math before, though... 

Spoiler
NicoleJ_0-1761695472180.png

 

Cheers!
NJ
Director, Product Management
Alteryx
Hub119
11 - Bolide
11 - Bolide

We need to get these things popping up on the featured carousel on the Community home page so I don't miss them when they get posted...

Spoiler
Went the route of separating and summing individual digits:
PE-13.png

 

jrlindem
12 - Quasar

This one's not so heavy on math theory.  My kind of math problem 😅

 

After reading up on the handling of very large numbers, I also settled on the FixedDecimal method and went the step further and added the first 1- digits constraint:

 

Spoiler
jrlindem_0-1761706335132.png

 

Looking forward to the next one (as I got back and catch up on the previous ones).  -Jay

PangHC
13 - Pulsar

i foresee it will have lot of bigInt problem. i built some bigint macro. 
hope i not wrong 😂

and i wonder why alteryx not support bigInt, as I guess most of the alteryx is built by python. (I guess so, because it said use python to support AMP engine, when i search how to build own tool).

Spoiler
PangHC_0-1761712231663.png

 

Labels