free geoip Anyone See the Pattern? - Jayson's Blog - jaysonKnight.com
jaysonKnight.com
A conduit to the voices inside my head.
Anyone See the Pattern?

[update] Understanding why for n=1;n+2 ((n^2)-1)%8==0 isn't the point of this exercise...look at the pattern in the results of each iteration. That's what has me baffled. Haacked has a great proof explaining what's going on on the left side of the operand, but I'm more interested in what's up with the right side. [/update]


This just popped into my head the other day for no other reason than to bug me:  Square all odd numbers starting with 1…subtract 1 from the result…then divide by 8.  Now look for the pattern in the results.

static void Process(int count)
{
    for (int i = 1; i < count; i += 2)
    {
        int iSquared = (i * i);
 
        if (((iSquared) - 1) % 8 == 0)
        {
            int result = ((iSquared - 1) / 8);
            Console.WriteLine(i + "^2 = " + iSquared + " - 1 = " + ((iSquared) - 1) + " / 8 = " + result);
        }
        else
        {
            Console.WriteLine("false");
        }
    }
    Console.ReadLine();
}

Squint for a second or 2 and you’ll see it.  Anyone out there with a degree in mathematics care to explain why that happens?


Posted Thu, Oct 20 2005 7:21 PM by Jayson Knight
Filed under:
comments powered by Disqus

Comments

Aaron Robinson wrote re: Anyone See the Pattern?
on Fri, Oct 21 2005 4:45 AM
I don't know why your formula get the numbers, but that's the triangular number series... http://ptri1.tripod.com/#tri
Aaron Robinson wrote re: Anyone See the Pattern?
on Fri, Oct 21 2005 4:48 AM
Keyvan Nayyeri wrote Several replies!
on Fri, Oct 21 2005 9:35 AM
Well! 1- About your pattern: You've been hacked proved it but I'm looking for a way to prove his proof is true in all cases or give another proof. 2- I haven't use EiffelEnvision yet but try to check it asap. Thank you for references. 3- Maryam Ghaemmaghami (Scoble's wife) is Iranian and live in US. I don't like to check the stats of my website. Sometimes I use an application (It uses IIS logs) to check my referrers and total hits. It has good details. For my blog I think that the number of hits are depend on my posts so try to write better. Although I don't write to get better traffics. But thank you for StatsCounter it's a great website ;) On the other hand if you read my last posts I analyze the traffic with some statistical methods (Time Series) and they are absolutely better than this kind of stats. 4- This comment: http://nayyeri.net/archive/2005/10/08/207.aspx#238 beat me to give this link if you want to use GTalk with Trillian (Pro version): http://www.google.com/support/talk/bin/answer.py?answer=24077&topic=1415
Haacked wrote re: Anyone See the Pattern?
on Fri, Oct 21 2005 9:49 AM
Well my proof is true in all cases where x is an odd integer. The same is not true for n being even. I wrote more on the Triangular series in the comments of my post. The pattern you see is a consequence of the triangular series as the commenter said. Check out this... http://ptri1.tripod.com/ Scroll down to triangular numbers. See how they are a part of Pascal's triangle? Interesting eh?
Haacked wrote re: Anyone See the Pattern?
on Fri, Oct 21 2005 11:12 AM
I think I answered your question better in my latest post (http://haacked.com/archive/2005/10/21/10910.aspx). I try and explain WHY your formula gets the triangular series. It's an algebraic identity.
Keyvan Nayyeri wrote Pattern in a sequence of numbers
on Fri, Oct 21 2005 1:15 PM
Yesterday&amp;nbsp;Jayson Knight had pointed to a pattern in sequence of odd numbers and had written a code...
Jayson Knight wrote re: Anyone See the Pattern?
on Sat, Oct 22 2005 2:27 AM
And of course there's a Wiki on the triangular number series: http://en.wikipedia.org/wiki/Triangular_number
protected virtual void jaysonBlog { wrote Best of JaysonKnight.com -- Happy New Year!
on Fri, Dec 30 2005 1:39 AM
One thing that really bugs me about blogs is that it&amp;rsquo;s still really damn hard to find specific...
Keyvan Nayyeri wrote Pattern in a sequence of numbers
on Sun, Jul 16 2006 2:13 AM

YesterdayJayson Knight had pointed to a pattern in sequence of odd numbers and had written a code to

Copyright © :: JaysonKnight.com
External Content © :: Respective Authors

Terms of Service/Privacy Policy