test script: Unify triangular and square number scripts