Let Sn denote the sum of n terms of an A.P. whose first term is a. If the common difference d is given by d=Sn−k Sn−1+Sn−2, then k =