We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

General Discussions

Discuss any topics that are not product-specific here.

Euleryx Project 1 - Multiples of 3 or 5

Pilsner
13 - Pulsar

Euleryx Problem 1 - Multiples of 3 or 5

 

Pilsner_1-1753967002059.png

 

Here's my full workflow and Answer:

Spoiler
Pilsner_2-1753967021472.png

 

Answer: 233168  

 

Method:

 

With this being the first problem in the series, we’re kicking things off with a relatively simple challenge. Typically, the challenges do get harder (which will likely become clear by Problem 3), but rest assured, we will do our best to explain what we’ve done.

 

That being said, the solution below is just one way to solve this problem; there are many different available routes! 

Pilsner_3-1753967266803.png

 

 

 

Here's how I tackled this problem:

 

  1. I began by creating two lists, one list containing all the multiples of 3, and the other list containing all the multiples of 5. I found the Generate Rows tool to be ideal for this task.

    Pilsner_6-1753967422431.png

     

  2. Using both the Union and the Unique tool, I created a list of all the distinct multiples of 3 or 5 (below 1000).

    Pilsner_7-1753967429133.png

     



  3. Finally, to sum the column, I used the Summarise tool.

    Pilsner_8-1753967459220.png

     

  4. Submit your answer to the Project Euler website. 

Pilsner_9-1753967466986.png

 

 

Congratulations, you’ve finished your first Project Euler challenge! Looking forward to seeing you all this time next week for Problem 2.

 

 

DoneImDoneGIF.gif



Summary

In just 3 simple steps, we have already found an answer to the first Project Euler challenge. Please feel free to share your solutions below. I hope you enjoyed the first challenge.

 

 

 

 

28 REPLIES 28
patrick_digan
17 - Castor
17 - Castor

Similar to others. Kept reducing tools

Spoiler
image.png
BS_THE_ANALYST
15 - Aurora
15 - Aurora

@patrick_digan I think the IsInteger function would be a nice replacement for you filter in method 2. Although I do like the way yours reads currently 😆

All the best,
BS

LinkedIN

Bulien
patrick_digan
17 - Castor
17 - Castor

@BS_THE_ANALYST ah thanks! 

aatalai
15 - Aurora

3 tools too 

BS_THE_ANALYST
15 - Aurora
15 - Aurora

@aatalai the problem stated multiples below 1000. Your generate rows includes 1000 so your answer is slightly bloated. You can submit the answer on Project Euler if you wanna test if the result is correct 😈

Me and you went for the exact same route, by the way. Everything the same including the 1000 🥴🤣

All the best,
BS

LinkedIN

Bulien
Pilsner
13 - Pulsar

The IsInteger function is a nice idea @BS_THE_ANALYST 

Having said that, I'm enjoying the different approaches too. I like @aiahwieder's use of the mod function

Qiu
21 - Polaris
21 - Polaris

@Pilsner 
At least, judging by the snapshot of spoiler, no one has been using Multi-row tool? 😁

 

Spoiler
Euleryx Project 1-r1.png

  

Erin
11 - Bolide

Spoiler
Euler1.jpg
Pretty much same approach as @TheOC 
Pilsner
13 - Pulsar

@Qiu I think your right, I like your solution! The multi-row is such a flexible tool, I should consider it more than I currently do.

CoG
14 - Magnetar

Using math to get the 2 Tool increment value: 

Spoiler
RowCount + Min(5-Mod(RowCount,5),3-Mod(RowCount,3))

Screenshot 0001.png

Happy Solving, everybody!

Labels
Top Solution Authors