Look out man, 5-0!
print(*[round((((5**0+5**.5)*.5)**O-((5**0+5**-.5)*.5)**O)*5**-.5) for O in range(0,50)])
Obviously you could do a lot worse in terms of obfuscation, but I like how that one-liner turned out anyway. What's your favorite obfuscated and/or confusing code? |
Quote:
|
Quote:
I'm glad you liked it! Yes, linear recurrence relations like lend themselves well to explicit solutions by the transformation , but to be fair, there aren't really that many examples of them of order that are interesting. Nonlinear ones, such as the logistic map become very interesting and intractable very quickly, though: https://www.youtube.com/watch?v=ovJcsL7vyrk Personally, I think the weird connections between recurrence relations, differential equations, generating functions and derivatives are particularly fascinating. For example, the Legendre polynomials (which have a very large number of applications in physics, probability theory, etc) can be defined in either of the following four ways: 1. In terms of a recurrence relation (with ): 2. In terms of n-th derivatives: 3. As coefficients of a series expansion (from electrostatics): 4. As polynomial solutions of an ordinary differential equation (which you get from solving Laplace's equation in spherical coordinates): If you play around with various polynomial sequences for a while (particularly orthogonal sequences), it becomes "obvious" that there's some sort of space or operator that connects all of the above. In other words, it's a bit like there "has to be" some algorithm to convert a differential equation to a recurrence relation, or vice versa, but the general theory for that is very poorly understood. Also, as a cool sidenote, you can use the zeros of the n-th Legendre polynomial for numerical integration of many "nice" functions : Gauss himself came up with that one, obviously... |
I guess I should have referred to one of my recent posts as well, on the topic of the golden ratio ...
|
Apparently I managed to find a new (?) series for the n-th Fibonacci number somehow, which looks surprisingly terrible:
http://zelaron.com/urusai/fn.png Presumably the summand can be simplified further, but I'm not seeing any obvious way of doing it. |
All times are GMT -6. The time now is 12:51 PM. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.