Husk, 5 bytes
KΣK+1 Explanation
I admitIt's quite difficult to construct a repeatable program in Husk. Because the type system forbids a function that can be applied to itself, I have no idea why it works yetto somehow allow the first part to evaluate to a function, and the remainder to evaluate to a value, and the types of existing built-ins are designed to prevent this kind of ambiguity. I'll figure it out The tokens of the program are
K, which constructs a constant function.K a bis equivalent toa.Σ, which takes an integer n and returns the nth triangular number.+, which adds two numbers.1, which is the literal 1.
The original program is interpreted like this:
K Σ (K+) 1 == Σ 1 == 1 The (K+) is a nonsensical function that gets eaten by the first K.
The twice repeated program is interpreted like this:
K Σ (K+1KΣK+) 1 == Σ 1 == 1 The function in parentheses is again eaten by the first K.
The thrice repeated program is interpreted like this:
K (Σ (K (+1) (KΣK+) 1)) (KΣK+1) == Σ (K (+1) (KΣK+) 1) == Σ ((+1) 1) == Σ (+1 1) == Σ 2 == 3