implemented solution to constant difference equation