Hi,
I’m playing with K language and for excercise I’ve chosen to write Sylvester sequence [1] but got stucked.
I’ve written this sequence successfully in Haskell [2].
My tryout in K is this:
> x: 2
2
> s: {((s*x)+1)}
{((s*x)+1)}
> 1 s/ 1 2
type error
1 s/ 1 2
I know that I have written s function badly but don’t know how to do it correctly.
Thanks for help,
Vaclav
[1] https://en.wikipedia.org/wiki/Sylvester's\_sequence
[2] https://github.com/wencaaa/mathfun/blob/master/sylvester.hs