I'm going to change your scalars to k and l, since n is normally used to signify the length of a vector.

Since you don't know the dimension the vector is in, you have to use infinite sequence notation:

In R^n:

a = <a0, a1, .... an>

Then:

k(la) = k(<la0, la1, .... lan>) = <kla0, kla1, ... klan>

But

l(ka) = l(<ka0, ka1, ... kan>) = <kla0, kla1, ... klan>

And are thus, equal.