snapapps / edgy

a visual programming language inspired by Scratch
http://snapapps.github.io/
GNU Affero General Public License v3.0
51 stars 21 forks source link

Collatz conjecture #382

Closed stevenbird closed 8 years ago

stevenbird commented 8 years ago

Could we please have 2+ implementations for this graph: https://xkcd.com/710/

stevenbird commented 8 years ago

e.g. some kind of dynamic programming

for i in 1..n:
    add edge (i, 2i)
    add edge (i, 3i-1) if i is odd

Any others?

cyderize commented 8 years ago

If something like this were used: collatz

We run into problems because the resultant graph isn't connected - and I think it would only become connected if we kept performing iterations forever.

I can't think of ways to obtain graph connectivity without guaranteeing it (the usual way being to start at 1 and then perform the next iteration on the newly added nodes, instead of the i+1th node)