Hacker News new | ask | show | jobs
by kalimanzaro 1215 days ago
Wouldnt the following work in basic python:

  for a_k in 1 to n:
    for a_(k-1) in 1 to a_k:
    ....
I'm a heavy user of Mma but there are better examples. Automating the rewriting of formulas to make them more concise is a big one. (But also not as straightforward as it could be, tradeoffs between conciseness, ease of reading and speed of implementation need to be triaged, similar to Lisp/APL. Maybe sympy still has a chance to be more like math/TCS)
1 comments

no because k is an argument and you have to pre-write k nested loops