Finding the first term of arithmetic sequence given are sn and d