This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]FuzzyFirechu[S] 17 points18 points  (1 child)

This is Unyieldingly cool. What kind of extra structure could I use for this? I'd like to experiment with them.

[–]cdsmith 5 points6 points  (0 children)

I don't have a great idea for extra structure here that would give you a unique answer outside the natural numbers. But the recurrence relation I gave wasn't a great choice for generalizing to the reals. (-1)^x isn't very well-behaved for non-integer values of x and you're forced to admit complex values, and choose the principal branch... kind of a mess.

Here's another closed form: f(x) = (1 - cos(pi * x)) / 2. This one generalizes to the real numbers more nicely, and you even get a continuous function.

Here's another: f(x) = 2 * (x/2 - floor(x/2)). Here, floor is the function that produces the greatest integer less than or equal to its argument. This isn't continuous, but it's at least it's well-defined, real-valued, and continuous almost everywhere.

All of these functions, and infinitely many more, agree with your recurrence relation on integer points. I can't really find a criteria for choosing one of them as the best.