How many triangles can you see?

The FQ thread created earlier today (Geometry buffs: Pls explain this “How many triangles” puzzle) reminded me of a mathematics competition I participated in years ago. One question was similar, and I’ll pose it here.

(First, my sketches aren’t great. Please assume the triangles I sketched are all equilateral.)

The question goes like this —

If this is a triangle of side length = 1,

where you can see 1 triangle,

and if this is a triangle of side length = 2,

where you can see 5 triangles,

then how many triangles can you see for a triangle whose side length = 10?

315
1,5,13,27,48 - OEIS

I computed the first 5 and cheated my way up to 10 by searching the OEIS.

It’s tricky because the upside-down triangles are not easy to fit. The small triangles just go up with n^2, and there’s an easy formula for all the right-side-up triangles, but mid-size ones are more difficult.

There is a formula in the link above, but it uses the floor() function. It’s usually not easy to come up with explicit formulas containing those.