C# Arithmetic progression,etc
sample input (an+1 = an * 2 + 2):
1,4,10,22,46,94,190,382
exit:
766,1534,3070,6142,12286,24574,49150,98302.
task of program therefore estimate of sequence , determine how continue.
advice.
task of program therefore estimate of sequence , determine how continue.
advice.
hi,
you mean have sequence of numbers , want find rule next item?
you have implement logic determining next item. there's no other answer in opinion. take given sequence , apply tests getting next known item , verify then...
btw sequence a,n+1 = a,n + 3*i, step-count. sequence more 1 answer...
if have "rule" easier. write logic apply operations (+ - * / etc) , start @ 1 , perform enough iterations.
if want way, rewrite "rule" in way .net read expression , use tool or js.net evaluate formula.
regards,
thorsten
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment