Let K be an arbitrary field of characteristic zero, P n : = K [ x 1 , … , x n ] be a polynomial algebra, and P n , x 1 : = K [ x 1 −1 , x 1 , … , x n ] , for n ⩾ 2 . Let σ ′ ∈ Aut K ( P n ) be given by x 1 ↦ x 1 − 1 , x 2 ↦ x 2 + x 1 , … , x n ↦ x n + x n − 1 . It is proved that the algebra of invariants, F n ′ : = P n σ ′ , is a polynomial algebra in n − 1 variables which is generated by [ n 2 ] quadratic and [ n − 1 2 ] cubic (free) generators that are given explicitly. Let σ ∈ Aut K ( P n ) be given by x 1 ↦ x 1 , x 2 ↦ x 2 + x 1 , … , x n ↦ x n + x n − 1 . It is well known that the algebra of invariants, F n : = P n σ , is finitely generated (theorem of Weitzenböck [R. Weitzenböck, Über die invarianten Gruppen, Acta Math. 58 (1932) 453–494]), has transcendence degree n − 1 , and that one can give an explicit transcendence basis in which the elements have degrees 1 , 2 , 3 , … , n − 1 . However, it is an old open problem to find explicit generators for F n . We find an explicit vector space basis for the quadratic invariants, and prove that the algebra of invariants P n , x 1 σ is a polynomial algebra over K [ x 1 , x 1 −1 ] in n − 2 variables which is generated by [ n − 1 2 ] quadratic and [ n − 2 2 ] cubic (free) generators that are given explicitly. The coefficients of these quadratic and cubic invariants throw light on the ‘unpredictable combinatorics’ of invariants of affine automorphisms and of SL 2 -invariants.