The semigroup algebra K[S], where K is a field and S a semigroup, is formally defined in the same way as the group algebra K[G]. Similarly, a semigroup ring R[S] is a variation of the group ring R[G], where the group G is replaced by a semigroup S. Usually, it is required that S have an identity element e so that R[S] is a unit ring and R = R e is a subring of R[S]. The group algebra K[N] is the set of all formal expressions sum_(n = 0)^∞ a_n n, where r_n element K for all n and a_n = 0 for all but finitely many indices n so that a_n = 0 for sufficiently large n (say, n>N).