Clear[a]

a[1] := 1

a[n_] := a[n - 1] + 3

a[11]

Clear[M]

M[k_] := If[a[k] < 50, k + 1, k]

M[11]