## Favorite number sequences?

For the discussion of math. Duh.

Moderators: gmalivuk, Moderators General, Prelates

King Author
Posts: 736
Joined: Sun Apr 12, 2009 12:30 pm UTC
Location: Pennsylvania, USA

### Favorite number sequences?

What's your favorite number sequence? I know it's an odd question, but go with it. And tell us why it's your favorite -- usefulness, quirkiness, beauty?

I don't know many number sequences, since I'm a layperson, not a smarty, but I'm partial to the Fibonacci sequence because I'm an amateur videogame designer and it makes for a quick, useful and infinitely-scalable Experience Points table. So do the Triangular Numbers, which I just recently learned about, but those ones you have to manually add together, unless you use a non-cumulative Experience Point system (i.e. your XP resets to 0 every time you level up).
I have signitures disabled. If you do, too...you can't read this, so nevermind >_>

Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

### Re: Favorite number sequences?

Euclid-Mullin sequence

Because
1. It involves primes.
2. There's some unanswered questions about it (whether it contains every prime)
3. It's not strictly increasing like most sequences in number theory.
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?

Avatar by Matt

gmalivuk
GNU Terry Pratchett
Posts: 25037
Joined: Wed Feb 28, 2007 6:02 pm UTC
Location: Here and There
Contact:

### Re: Favorite number sequences?

King Author wrote:So do the Triangular Numbers, which I just recently learned about, but those ones you have to manually add together
What do you mean by this? Can't you just check the total XP against the triangular numbers like you would the Fibonacci numbers? Spreadsheets I've made for D&D 3 and 3.5 characters basically did just that, since those editions required 1000n points to move from level n to level n+1.
Unless stated otherwise, I do not care whether a statement, by itself, constitutes a persuasive political argument. I care whether it's true.
---
If this post has math that doesn't work for you, use TeX the World for Firefox or Chrome

(he/him/his)

King Author
Posts: 736
Joined: Sun Apr 12, 2009 12:30 pm UTC
Location: Pennsylvania, USA

### Re: Favorite number sequences?

gmalivuk wrote:
King Author wrote:So do the Triangular Numbers, which I just recently learned about, but those ones you have to manually add together
What do you mean by this? Can't you just check the total XP against the triangular numbers like you would the Fibonacci numbers? Spreadsheets I've made for D&D 3 and 3.5 characters basically did just that, since those editions required 1000n points to move from level n to level n+1.

Yes, technically I could treat the Triangular XP like Fibonacci XP (yikes, I think I just broached the nerdiness density limit), but they scale differently so they need to be treated differently; every couple of iterations in the sequence, the Fibonacci numbers add an order of magnitude, whereas the Triangular numbers stay the same number of digits for long stretches. Like, Fibonacci 50 is 12,586,269,025. Triangle 50 is 1275. Fibonacci 100 is up to 354,224,848,179,261,915,075 which is ridiculously higher than Fibonacci 50. In contrast, Triangle 100 is 5050; not even quadruple Triangle 50.

So if the characters in the game in question have a cumulative XP stat, Fibonacci works better because each next number in the sequence is just the next milestone for your constantly-accumulating XP. And more importantly, the rate at which the Fibonacci numbers scale is perfectly suited to something like cumulative XP progression; assuming that higher and higher-level monsters/whatever give you progressively higher amounts of XP, you'll never level up too fast or too slow.

With the Triangular numbers, however, because each number in the sequence is so close to the number before and after it, if you had cumulative XP, you'd level up ridiculously fast. Take Fib 50 and Tri 50 again -- to get from Fib 50 to Fib 51 you need to gain 7,778,742,049 additional XP. To get from Fib 51 to Fib 52, you need an additional 12,586,269,025 XP -- a significant increase from the last level-to-level amount. By contrast, to get from Tri 50 to Tri 51 you need, obviously, 51 additional XP. To get from 51 to 52, you need an additional 52; the "XP to Next Level" using Triangular numbers is always only one more than you needed last time, a very linear, very shallowly-increasing amount. When using Fibonacci numbers, on the other hand, the "XP to Next Level" starts jumping up by larger leaps and bounds the higher level you get.

So what I was saying was, if you want to use Triangular numbers (which I highly recommend for tabletop RPGs where humans are dealing with the numbers -- Fibonacci is better for computer and videogames where the electronic brain is doing all the maths), it's a good idea to zero-out XP after every level up. Such that, going back to the earlier example, to get from Level 50 to Level 51 you'd need 1,326 XP (rather than 51). To get from 51 to 52, you'd need an additional 1,378 (rather than 52). And again, every time you level up, your XP is reset to zero and you have a new goal to shoot for, rather than your XP just being a running total of all XP you've ever obtained.

By the way -- what's it say that you can google "first 1000 fibonacci numbers" and get a first-page hit, while googling "first 1000 triangular numbers" doesn't get you what you're looking for?
I have signitures disabled. If you do, too...you can't read this, so nevermind >_>

gmalivuk
GNU Terry Pratchett
Posts: 25037
Joined: Wed Feb 28, 2007 6:02 pm UTC
Location: Here and There
Contact:

### Re: Favorite number sequences?

It probably says that triangular numbers are stupid easy to compute, so do the math your own self, you lazy bum.
Unless stated otherwise, I do not care whether a statement, by itself, constitutes a persuasive political argument. I care whether it's true.
---
If this post has math that doesn't work for you, use TeX the World for Firefox or Chrome

(he/him/his)

King Author
Posts: 736
Joined: Sun Apr 12, 2009 12:30 pm UTC
Location: Pennsylvania, USA

### Re: Favorite number sequences?

gmalivuk wrote:It probably says that triangular numbers are stupid easy to compute, so do the math your own self, you lazy bum.

That's what I figured :p

Actually, I could probably easily write a program (in anything, really, even in RPG Maker) to do it for me. Shouldn't take all of fifteen minutes. I'm not going to do it, of course, but I could.
I have signitures disabled. If you do, too...you can't read this, so nevermind >_>

Snark
Posts: 425
Joined: Mon Feb 27, 2012 3:22 pm UTC

### Re: Favorite number sequences?

I don't think it matters much whether you use Fibb or Triangular numbers for xp as long as your monsters xp is proportional to the same numbers.

Code: Select all

`for(i=1; i<=1000; i++)  printf("%d\n", i*(i+1)/2);`

There's your list you were looking for. Took me slightly less than 15 minutes.
Dashboard Confessional wrote:I want to give you whatever you need. What is it you need? Is it within me?

Avatar by Matt

King Author
Posts: 736
Joined: Sun Apr 12, 2009 12:30 pm UTC
Location: Pennsylvania, USA

### Re: Favorite number sequences?

Snark wrote:I don't think it matters much whether you use Fibb or Triangular numbers for xp as long as your monsters xp is proportional to the same numbers.

True. However, in game design, which is typically a collaborative process, it's more likely that I have to fit something to something someone else has already made and either can't or is unwilling to change. Not to mention the afforementioned-problem of "with tabletop RPGs, it's better to use small, easy-to-work-with numbers, since regular humans will be doing all the maths."

Snark wrote:

Code: Select all

`for(i=1; i<=1000; i++)  printf("%d\n", i*(i+1)/2);`

There's your list you were looking for. Took me slightly less than 15 minutes. :)

I'm a beginning coder, jerk :p Woulda taken me fifteen minutes T3T
I have signitures disabled. If you do, too...you can't read this, so nevermind >_>

Posts: 716
Joined: Sat Oct 27, 2007 5:51 pm UTC

### Re: Favorite number sequences?

You know that even if you reset to zero each time, you'll still level up much faster with triangular numbers, right? It's the difference between cubic and exponential growth, I believe.
Let's have a fervent argument, mostly over semantics, where we all claim the burden of proof is on the other side!

Thesh
Has the Brain Worms, In Case You Forgot.
Posts: 5014
Joined: Tue Jan 12, 2010 1:55 am UTC

### Re: Favorite number sequences?

Favorite sequences of numbers?

Code: Select all

`f(x) = { 0; if x = 0, 1; if x = 1, 2 * f(x-1) - f(x-2) + 2; if x > 1f(0),f(1),f(2),f(3),f(4),f(5),...`
But I do and I don't want to care anymore.
If I close my eyes, would it spare me the sight of decay, corruption?
How we nurture destruction and everything that will doom us all.

Qaanol
The Cheshirest Catamount
Posts: 2990
Joined: Sat May 09, 2009 11:55 pm UTC

### Re: Favorite number sequences?

Thesh wrote:Favorite sequences of numbers?

Code: Select all

`f(x) = { 0; if x = 0, 1; if x = 1, 2 * f(x-1) - f(x-2) + 2; if x > 1f(0),f(1),f(2),f(3),f(4),f(5),...`

You’re such a square.
wee free kings

Timefly
Posts: 56
Joined: Sun Nov 14, 2010 7:30 pm UTC

### Re: Favorite number sequences?

f(n+1) = (n+2)-f(n), f(0) = 1

King Author
Posts: 736
Joined: Sun Apr 12, 2009 12:30 pm UTC
Location: Pennsylvania, USA

### Re: Favorite number sequences?

MartianInvader wrote:You know that even if you reset to zero each time, you'll still level up much faster with triangular numbers, right? It's the difference between cubic and exponential growth, I believe.

Yes, Triangular XP still gives faster, more regular levelups, but if you reset to zero, it's a lot less severe than if you don't. To get from Level 49 to Level 50, you'd need 1,275 XP rather than 50 XP. Although as gmalivuk said, if you adjust the XP giveouts, you could make it as slow as you want.

I specifically avoided using the term "exponential" to describe Fibonacci 'cause I wasn't sure if it was technically correct.

*looks around*

Anyone? Is it?
I have signitures disabled. If you do, too...you can't read this, so nevermind >_>

nxcho
Posts: 12
Joined: Wed Sep 30, 2009 9:12 am UTC

### Re: Favorite number sequences?

My favorite sequence in the sense that it is the one I use the most is clearly the sequence of natural numbers (a_0 = 0, a_n = a_(n-1)+1). It is very useful for example counting things and it is easy to remember.
On the less trivial side of things I like sequences with a nice geometrical interpretation, like https://oeis.org/A089187

ElCarl
Posts: 26
Joined: Sat Aug 06, 2011 6:23 pm UTC
Location: London, UK

### Re: Favorite number sequences?

Probably the fibonacci sequence...
So many interesting things about it
If you write down the sequence, then write down the differences between the numbers below it, you get the fibonacci sequence back out again!
And if you keep doing it to a long enough starting list, you begin to get the sequence coming out again on the left, except with alternating negatives and positive values.

i.e. you get:

...-21,13,-8,5,-3,2,-1,1,0,1,1,2,3,5,8,13,...

gmalivuk
GNU Terry Pratchett
Posts: 25037
Joined: Wed Feb 28, 2007 6:02 pm UTC
Location: Here and There
Contact:

### Re: Favorite number sequences?

King Author wrote:I specifically avoided using the term "exponential" to describe Fibonacci 'cause I wasn't sure if it was technically correct.
It is in the limit, with the ratio of successive terms approaching the golden ratio.
Unless stated otherwise, I do not care whether a statement, by itself, constitutes a persuasive political argument. I care whether it's true.
---
If this post has math that doesn't work for you, use TeX the World for Firefox or Chrome

(he/him/his)

King Author
Posts: 736
Joined: Sun Apr 12, 2009 12:30 pm UTC
Location: Pennsylvania, USA

### Re: Favorite number sequences?

nxcho wrote:My favorite sequence in the sense that it is the one I use the most is clearly the sequence of natural numbers (a_0 = 0, a_n = a_(n-1)+1). It is very useful for example counting things and it is easy to remember.
On the less trivial side of things I like sequences with a nice geometrical interpretation, like https://oeis.org/A089187

Ooh, that second one's pretty cool.
...
>_>
<_<

ElCarl wrote:Probably the fibonacci sequence...
So many interesting things about it :)
If you write down the sequence, then write down the differences between the numbers below it, you get the fibonacci sequence back out again!
And if you keep doing it to a long enough starting list, you begin to get the sequence coming out again on the left, except with alternating negatives and positive values.

i.e. you get:

...-21,13,-8,5,-3,2,-1,1,0,1,1,2,3,5,8,13,...

Huh, never knew that. Neat. Did you know that if you use adjacent Fibonacci numbers in architecture, the result typically "looks" porportional and pleasing to the human eye? By "adjacent Fibonacci numbers" I mean if you want to build a rectangular room, if it's 13 meters lengthwise and 8 meters otherwise, for example. Of if you're building a step design, have the first be 3 feet, then 5, then 8, then 13, etc.

gmalivuk wrote:
King Author wrote:I specifically avoided using the term "exponential" to describe Fibonacci 'cause I wasn't sure if it was technically correct.
It is in the limit, with the ratio of successive terms approaching the golden ratio.

Ah, alright. Thanks.

I'm always wary of calling something "exponential" to simply mean "goes up a whole lot," because I do that sometimes in game design circles when talking about a given mechanic, and some mathy usually chews me out. "That's not exponential! It doesn't involve an exponent!"
I have signitures disabled. If you do, too...you can't read this, so nevermind >_>

ElCarl
Posts: 26
Joined: Sat Aug 06, 2011 6:23 pm UTC
Location: London, UK

### Re: Favorite number sequences?

King Author wrote:Huh, never knew that. Neat. Did you know that if you use adjacent Fibonacci numbers in architecture, the result typically "looks" porportional and pleasing to the human eye? By "adjacent Fibonacci numbers" I mean if you want to build a rectangular room, if it's 13 meters lengthwise and 8 meters otherwise, for example. Of if you're building a step design, have the first be 3 feet, then 5, then 8, then 13, etc.

Well, I knew that successive terms of the sequence approximate the golden ratio, and that that's used a lot as an aesthetically pleasing ratio - another one of those weird but interesting things about the sequence

letterX
Posts: 535
Joined: Fri Feb 22, 2008 4:00 am UTC
Location: Ithaca, NY

### Re: Favorite number sequences?

King Author wrote:I'm always wary of calling something "exponential" to simply mean "goes up a whole lot," because I do that sometimes in game design circles when talking about a given mechanic, and some mathy usually chews me out. "That's not exponential! It doesn't involve an exponent!"

I also tend to get annoyed at people calling merely big things exponential. However, in this case it actually is exponential.

In case you haven't seen it before, there's actually a closed form expression for the nth Fibbonacci number, namely F_n = (phi^n - psi^n)/sqrt(5), where phi is the golden ratio, (1+sqrt(5))/2 and psi is (1-sqrt(5))/2. Since the absolute value of phi is bigger than that of psi, we have that F_n is O(phi^n) (which is computer science speak for saying that the fibbonacci numbers have the same "order of growth" as phi^n, which really is exponential).

On the other hand, it's been pointed out that the nth triangular number is n(n+1)/2 = (n^2 + n)/2. So this is basically n^2 (by which I mean it's O(n^2)), so we'd call it quadratic growth.

Also, this has been mentioned several times already but I'll just spell it out concretely: adding up the first n triangular numbers is actually a quantity called the nth tetrahedral number. It also has a closed form expression, which is n(n+1)(n+2)/6 which, by expanding out that product, has a leading term of n^3/6, so we call it cubic growth or O(n^3).

Coding
Posts: 47
Joined: Thu Sep 15, 2011 6:59 pm UTC

### Re: Favorite number sequences?

Fibonacci and relatives (tribonacci, tetranacci, etc.) are pretty cool. I am also a bit partial to sequences that I "discovered" on my own before reading about them or anything, so I like the free polyomino sequence and the triangular numbers.

Qaanol
The Cheshirest Catamount
Posts: 2990
Joined: Sat May 09, 2009 11:55 pm UTC

### Re: Favorite number sequences?

I’m going with the Bernoulli numbers, because they’re pretty deeply connected to prime number theory. (Also because I discovered them on my own before learning about them—and to this day have never been formally taught about them.)
wee free kings

cyanyoshi
Posts: 315
Joined: Thu Sep 23, 2010 3:30 am UTC

### Re: Favorite number sequences?

I am myself quite partial to fractal sequences such as the sequence a(n) that you get when the digits of the nonnegative integer n (in base 2, in this case) are added together:
Spoiler:
0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,...

In particular, I find it cool that the sequences a(2n), a(4n), a(8n), etc. are the exact same as a(n). This can be extended without much difficulty as a function of all nonnegative real numbers that have a terminating binary representation, but you have to hunt elsewhere for a function of negative numbers. You may then want to try the sequence of adding up the digits in negabinary or balanced ternary (still interesting).
You can look, but don't touch.

post count unintentional

antonfire
Posts: 1771
Joined: Thu Apr 05, 2007 7:31 pm UTC

### Re: Favorite number sequences?

I like the look and say sequence, mostly because how fast it grows is hilarious.
Jerry Bona wrote:The Axiom of Choice is obviously true; the Well Ordering Principle is obviously false; and who can tell about Zorn's Lemma?

tomtom2357
Posts: 563
Joined: Tue Jul 27, 2010 8:48 am UTC

### Re: Favorite number sequences?

I like it too, because when it is started with most different numbers the growth rate is an algebraic number of degree 71.
I have discovered a truly marvelous proof of this, which this margin is too narrow to contain.

MrDrake
Posts: 7
Joined: Wed Apr 11, 2012 12:20 pm UTC
Location: Sydney, NSW, Australia

### Re: Favorite number sequences?

My favourite sequences are ones that can't be fully defined. For example, A(n) = An(n)+1 where An is the nth sequence in the OEIS.

A = 2, 3, 2, 1, 3, 4, 1, 7, 7, 5, ...

Ironically, this sequence is A102288 (https://oeis.org/A102288), which means that A(102288) is undefined!