Can you identify this weird mathmatical patern?

I’m working on a design project for a computer game in which abstract visuals for space ships are created from arrangements of squares. I’d link to my online design docs, but apparently the 40k character url is too long for the post submission field, and TinyURL is choking on it.

Um, lessee, how to make this work…

Okay, here are some examples:

Anyway, part of the design involves using a small number of standardized square sizes for all ships, and at first I was just kind of arbitrarily choosing sizes based on quarter units: .5, .75, 1, 1.25, and so on. But I kept running into a weird phenomenon where some sizes seemed to “mesh” well when placed next to other differently sized squares while others didn’t. It was so irritating and unpredictable that I got obsessed with it and ended up coming up with this formula:

2a + b + 2g = 2b + 2c + 5g

and this one:

a + b + 2g = b + 2c + 3g

…to represent the ratios between the lengths of the sides of sets of three consecutive sizes of squares that seemed to mesh, where g is the “unit” and the square’s sides are a, b, and c, with a being largest and c being smallest.

So, if g = 1, then c = 3, b = 5, and a = 7.

I think these formulas may actually be bad. I dunno. I asked several people at the office to look at it, and one person suggested that the sequence may just be prime numbers, because 11 worked but 9 didn’t. It definitely seemed like all the squares needed odd dimensions.

But then when I finally had enough squares that “worked” and got into some serious asset diagramming, I noticed a new relationship, and that led to this diagram:

The number sequence that diagram suggests is:

1, 2, 3, 5, 7, 11, 15, 23, 31, 47, 63, 95, 127, 191, 255, …

It involves a lot of primes, but it diverges from them. I tried putting it into Google and it doesn’t appear to be a sequence of any particular note, but again I’m still not sure if I’ve even identified it correctly, and the elusive “meshy” property I totally subjectively feel it gives to the squares when trying to arrange them into visually pleasing arrangements may be entirely my imagination, and at any rate it continues to elude more practical description.

Can someone help shed some light on this?

The Online Encyclopedia of Integer sequences ( , 2, 3, 5, 7, 11, 15, 23, 31, 47, 63, 95, 127, 191, 255, - OEIS ) suggests that 383 and 511 are the next numbers in this sequence, and gives some links to related sequences that might help.

If you add 1 to each of the numbers you’ve listed above, you get

2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, …

The upright numbers are just the powers of 2; the italicized ones are three times a power of 2. The reason you need to add 1 to all of your square sizes is, I think, solely because you’ve got an implicit “border” that’s one unit wide around all of your squares. If you redrew your last diagram by “tacking on” this extra border to each square (one extra unit along each square’s right and bottom edges, say), you’d see that your diagram is 48 squares wide, and that the smaller squares are telling you that 48 is nicely divisible by 2, 3, 4, 6, 8, 12, and 16.

The number of squares per row is: 3, 4, 6, 8, 12, 16, 24
Add a 2 at the front, and those are the factors of 48.

Thanks for all the responses, guys!

AndyL, I did find the Online Encyclopedia of Integer Sequences entry, and one other on a different site that had number lists, but I could not and still can not make any sense of the information they offer. It still seems to me the site is saying the sequence is not particularly notable. More importantly, I wasn’t sure if that was the correct sequence; until I understand why the squares behave the way they do, I can’t say the sequence isn’t diverging.

MikeS, I did notice the powers of 2 thing but the in-between numbers were stumping me and the rate of increase kept plateauing in an uneven way because of it- it goes 1, 1, 2, 2, 4, 4, 8, 8, 16, 16, 32, 32, 64, 64, …- and that suggest what I have isn’t a single sequence but two sequences woven together. The “a power of 2 times 3” thing is new, though. I think the divisors of 48 thing may actually be right on the money, though; I’m going to look into that more closely.

PacifistPorcupine, I did not notice that! And, there totally should be a row with just two squares at the bottom that my graph paper app didn’t have room to draw. Again, I think this factors thing may be really close to the answer. I’m going to try and build a new rows-of-squares diagram working down from 60 (on account of Babylonians) and see what patterns emerge.

One of the comments on the OEID link says that it’s the number of palindromic binary numbers less than 2^n, where n is the position in the sequence (starting with 0).

As mentioned, the number pattern you’re seeing is related to 2^n alternating with 3/2 * 2^n. That it involves a lot of prime numbers is because of your 1 unit border around the squares resulting in 2^n - 1, which are Mersenne primes, so I’d imagine you’ll also have a lot of primes with 3/2 * 2^n - 1, those just aren’t a special class of primes.

So, I think to understand it, we should ignore the - 1. Based on that, we’re basically creating restrictions with each new row. The first two rows are 2x2 and 3x3, and those can be made to line up evenly every 6 units. So now all future numbers must be divisible by 2 and 3 of which the next up from 6 units is 12 units. What numbers go evenly into 12 that’s not already in the list but 4x4 and 6x6. So now all future numbers have to be divisible by 4x4 and 6x6. Of those, the next is 24, which gives us 8x8 and 12x12.

From that, we quickly see the pattern arising that the first number will always be a power of two and the second will always be 3 and a power of 2. So it’s not that you’re seeing a divisor of 48 because the same would apply to the next set unit set which is 96 or 198.

So, really, you’re just finding divisors for an arbitrarily large integer of the form 3 * 2^n.

And the differences between those numbers have the pattern of:

1, 1, 2, 2, 4, 4, 8, 8, 16, 16…

Which is 2 raised to the power of:

0, 0, 1, 1, 2, 2, 3, 3, 4, 4…

Totally off-topic, but I’m curious how you can have a URL that is 40,000 characters long, I’ve never come across any URL longer than a few hundred characters or something (one of those that mainly consists of some seemingly random sequence of numbers and letters).

I’ve been using this online graph paper tool written in HTML5 to sketch designs:

It’s feature-poor but super convenient, and it outputs PNGs when you want to save your work. I was going to link directly to the output in the OP, and cut and paste one of the URLs into it, only to have the SDMB inform me when I tried to preview my post that it had over 40k characters and something like 25k was the limit. I believe this is because it’s some kind of crazy new HTML5 image file format where the data for the web page is entirely contained within the URL. Essentially, the SDMB accepts about 25 kilobytes of text data per post, and I inadvertently tried to feed it a 39 kilobyte image.