Hacker News new | past | comments | ask | show | jobs | submit login
The astonishing behavior of recursive sequences (quantamagazine.org)
101 points by pseudolus on Nov 17, 2023 | hide | past | favorite | 15 comments



Somewhat related, I have found The On-Line Encyclopedia of Integer Sequences[1] to be an amazing resource when I come across interesting numeric sequences.

[1] https://oeis.org/


I've solved many gnarly problems by numerically building a sequence then looking up a formula that generalizes it in OEIS.


That's such a cool idea. Do you then prove it is the formula you need, or do you just assume that if it matches for 10 terms it's probably the formula?

A math professor I had in college, Dave Kelly, had a trick where he'd show a seemingly reasonably-behaved sequence, explain where it came from, then show that the rest of the sequence was absurd -- like, it would be exponential for a while and then zero, or increase arithmetically for a while and then become undefined, etc. I wish I had taped that.


Rarely have I found it to be that easy. Generally you'll get a hit on a partial match of your sequence but from that you'll learn about some number theory regarding that sequence or there will be links, formulas and code snippets that help you further research your specific algorithm you're trying to solve. You're just looking for that 'aha!' moment and this database usually delivers. Sometimes that 'aha' is the realization that it's going to be impossible or take too much time or resources to compute and that's just as helpful.

Recursive/fractal sequences are toughest because there's very likely no direct computation. Say your sequence matches with a fractal sequence at only every fifth element, you still have to compute the elements you don't need to get the ones you do need. Sometimes you need a number theory math library to do the computation and that kind of dependency is overkill so now you've got to figure out how recreate just the parts of that math library you need or discover a shortcut (again, using the sequence database.) Invariably you'll discover something new and be able to contribute back.


Ditto, especially with certain programming interview problems or Advent of Code, etc.

You build the small-N brute forcing demo, and then the integer sequences (from correct answers, or from how the overall number of solutions grows) may help find the formal math jargon name behind whatever's going on.

For example, Stirling Numbers of the First Kind [0].

[0] https://en.m.wikipedia.org/wiki/Stirling_numbers_of_the_firs...


+1, amazing resource.


https://www.youtube.com/watch?v=p-HN_ICaCyM

As always, there is a numberphile video.


Interesting how the nth term index for n-Sonos non-integral is itself monotonic. Intuitively it seems it doesn’t have to be. (Handwavy looking at the n-S() behavior as hitting a ‘catastrophic’ transition at the n-th, so question is why is this index increasing as n increases?)

https://oeis.org/A030127


I used to think mathematics was about counting. Now I know better: it's about perspective.


Mathematics is about following the rules, you first define some formal rules, then you study the consequences of such definition.

A well-known example: 5th Euclid axiom leads to Euclidean geometry, while a different axiom leads to non-euclidean geometries.


I think its about making complicated stuff reduce down to counting.


Can someone explain why it goes from strictly multiplication/division for Somos 1,2 and 3 but then at Somos 4 the addition operation is added? It seems completely arbitrary.


Here's a definition from Wolfram math world that includes an addition operation for any valid value of k: https://mathworld.wolfram.com/SomosSequence.html

Are you talking about the behavior of the floor operator in determining the number of terms in the sum? For k in {1,2,3}, floor(k/2) = 1. So there would only be one term and thus no addition.


floor(1/2) is not 1.


Ah, heh. True. I guess Somos-1 would then be undefined? Because \sum_{n=1}^{0} doesn't make much sense.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: