A while ago I started doing this with Python:
Today it dawned on me that maybe I could do it in Dynamo.
So I just had a go.
Problem #1 is super easy in Dynamo! So much easier than I found it in Python.
However Problem #2 would be a total monster in Dynamo I think so I cheated and used a Python node.
The logic of #3 was shockingly easy in Dynamo, however I got to see a new (to me) error message:
I just tried a work around but I think I have killed Dynamo
I thought some of you may fancy having a go at these challenges too… But watch out for #3
it looks like this message it thrown when the process runs out of memory, when OutOfMemoryException Class (System) | Microsoft Docs is thrown…
I’ve never seen it before. Always fun seeing new errors, I must be getting better
@Alien can you share the Dynamo graph that produced this warning?
The error happens in the first couple of nodes, not surprising though if you look at the challenge:
That’s a large number.
Had the same issue trying to stick it into a Python node too:
It kills regular (not in Dyno) python too… I think I need to rethink my logic
What about not starting at 2 but at n - 10.000 or so?
Also, you could skip over all even numbers by starting on an uneven number and doing something like this:
Yeah, I tried a few variations. It hates anything over 6-7 figures though so I’m rethinking the strategy.
Got it working in a Python node but don’t think I can Dynamo it without murdering Dynamo.
Not really. Done in a flash.
b = Math.Sum(List.TakeItems(a,-2));
b = fb(1..2);
c = ;
while (List.LastItem(b) < a)
c = fb(b);
b = c;
f1 = fib(4000001);
f2 = f1 % 2 == 0;
I did it in Python in Dyno.
By Dyno, I mean actual code blocks.
While I don’t really understand designscript, what I can make out looks like we used the same logic.