Results 1 to 3 of 3
Like Tree2Thanks
  • 2 Post By emakarov

Math Help - Colour coded sequence pattern

  1. #1
    Newbie
    Joined
    Feb 2013
    From
    Australia
    Posts
    2

    Question Colour coded sequence pattern

    I'm terrible at maths, but I'm usually OK at generating a formula to feed a calculator or put in code.
    But for some reason, this has stumped me.

    I'm not even sure its meant to be in this forum, if not, please move it.

    I have a colour coded sequence pattern, there are 12 colours, each colour is associated with a number.

    Lets say... blue is 1, green is 2, yellow is 3, and so on until 12.

    Once you go beyond 12, it wraps back to the colour of 1 again.

    So 13 would be blue, 14 would be green, 15 yellow, etc etc.

    How would I work this out mathematically on any number?
    ie. 25 should be blue.

    Thanks in advance, I know the problem is right in front of me but I cannot seem to make it clear!
    Last edited by Montaro; February 1st 2013 at 02:28 AM. Reason: Title change
    Follow Math Help Forum on Facebook and Google+

  2. #2
    MHF Contributor
    Joined
    Oct 2009
    Posts
    5,535
    Thanks
    778

    Re: Colour coded sequence pattern

    Let (m mod n) denote the remainder when m is divided by n. Then your function is ((n - 1) mod 12) + 1.
    Thanks from Paze and Montaro
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Newbie
    Joined
    Feb 2013
    From
    Australia
    Posts
    2

    Re: Colour coded sequence pattern

    Thank you! this works perfectly!
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 0
    Last Post: September 5th 2012, 11:21 PM
  2. Replies: 1
    Last Post: November 14th 2011, 02:48 AM
  3. Row indexing
    Posted in the Advanced Algebra Forum
    Replies: 1
    Last Post: November 23rd 2010, 02:49 PM
  4. How many patterns?
    Posted in the Algebra Forum
    Replies: 4
    Last Post: September 18th 2009, 07:22 AM
  5. patterns
    Posted in the Algebra Forum
    Replies: 1
    Last Post: February 7th 2007, 10:34 AM

Search Tags


/mathhelpforum @mathhelpforum