General Discussions

Discuss a wide range of topics! Questions about the Alteryx Platform should be directed to the appropriate Product discussion forum.

Advent of Code 2020 - BaseA Style (Day 13)

Alteryx Certified Partner

Discussion thread for day 13 of the Advent of Code :

12 - Quasar
12 - Quasar

Here's my Part A.



Added in the tools at the end to get to single cell answer.

Part B I don't think is an iterative macro, I think it's a case of getting a calculator out.



Check out my collaboration with fellow ACE Joshua Burkhow at
16 - Nebula
16 - Nebula

Here's my solve - BaseA for 95% but needed some true integer maths for last part


All maths for part 2 - googling "simultaneous equations modular arithmetic" reminded me of the maths I had long since forgotten

But had to use Python tool to correct for inaccuracy in double arithmetic.

Will do a version with some Abacus functions


17 - Castor
17 - Castor

Here's my part A and part B, though only for the sample problem.  As @jdunkerley79 mentioned, Int64 operations are required for the full solution



Alteryx Certified Partner

I caved and am using python for part 2 because I don't have the brain power to create a modinv() function from scratch in Alteryx

12 - Quasar
12 - Quasar

Part 2


So I found a tutorial which explained how to calculate the CRT and copied the logic in excel, then checked it with some of the examples given and it worked well.
replicated it in Alteryx and could get the examples working in Alteryx but couldn't get the final answer exactly as required.

Imagine it's something to do with the modulo function on very large numbers losing a bit of accuracy, so got the exact answer using (my answer is out by 198).

Then added a generate rows to go 300 numbers either side of the output generated by Alteryx and then use a modulo on the numbers to find the answer which matches.

The part 2 in Alteryx looks like this:



Check out my collaboration with fellow ACE Joshua Burkhow at
Alteryx Partner

When I need to use pen and paper I know I'm in trouble. What a brain melt! I did it baseA with an iterative, works with my input. Once the headache leaves, I'll try to read and see other people's solutions 😅


and the macro




A summary of my thought process:

I began with pen and paper, then some excel(highlighted = 54): dsmdavid_0-1607875473558.png


I started with
number 3, offset 0
number 5, offset 1
number 7, offset 2
number 11,offest 3

3&5 --> the first number that qualifies is 9 (mod(9,3) = 0 && mod(9+1,5)=0).
Then I need to find a number that qualifies for (3,5) and 7. I start with the first number that qualifies for the previous condition, go in increments of (3*5) --will all keep qualifying for mod(z,3) = 0, mod(z+1,5) = 0 -- until I find one that qualifies mod(z+2,7) = 0 (the first number that qualifies is 54)

For the next, I'll start at 54 and increase in increments of 105 (3*5*7) until I find one that qualifies mod(z+3,11) =0. (789).
And so on.

Alteryx Certified Partner

Alteryx workflow with a python tool when needed


For part 2 I used Chinese Remainder Therom as listed in here:

and grabbed a modinv() function from this stackoverflow page:

friends don't let friends reinvent the wheel 😅

Screenshot 2020-12-13 161720.png


Alteryx Certified Partner

That part 2 really hurt my head. Discovered CRT after trying to find some relation between modulos and achieved to implement it in Alteryx but couldn't figure out the exact value. I guess it's due to accuracy problems, especially after @jdunkerley79 and @cgoodman3 replies. So used dcode tool to figure out the correct value. It's also on dcode that I studied and understood-ish the CRT.


Capture d’écran 2020-12-13 à 22.30.31.png
16 - Nebula
16 - Nebula

Awesome solve @dsmdavid 


My Abacus based solution is below. Needed to use it for 1 tool.

To correct the double maths issue. I converted the integers to strings and then used some new Abacus functions to compute as Int64

 , [Product]