Cant find working function for this problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Nikolai Onken

    Cant find working function for this problem

    Hey,

    I got a rather more mathematical Problem but have no idea how to solve
    it:
    I have following values and want them to return other values as stated
    below:
    (Best seen with fixed pitch font)
    3/8 = 1/4
    --
    5/8 -
    6/8 | = 2/4
    7/8 -
    --
    9/8 -
    .. | = 4/4
    15/8 -
    --
    17/8 -
    .. | = 8/4
    31/8 -
    --
    33/8 -
    .. | = 16/4
    63/8 -
    .........
    I was trying to create a function which returns the right values but
    it didn't work.
    I hope it is kind of clear what I am looking for - I have no idea how
    to solve that problem... Maybe someone knows.
    Thanks alot,

    Nikolai Onken
  • Andreas Paasch

    #2
    Re: Cant find working function for this problem

    Nikolai Onken wrote:
    [color=blue]
    > Hey,
    >
    > I got a rather more mathematical Problem but have no idea how to solve
    > it:
    > I have following values and want them to return other values as stated
    > below:
    > (Best seen with fixed pitch font)
    > 3/8 = 1/4
    > --
    > 5/8 -
    > 6/8 | = 2/4
    > 7/8 -
    > --
    > 9/8 -
    > . | = 4/4
    > 15/8 -
    > --
    > 17/8 -
    > . | = 8/4
    > 31/8 -
    > --
    > 33/8 -
    > . | = 16/4
    > 63/8 -
    > ........
    > I was trying to create a function which returns the right values but
    > it didn't work.
    > I hope it is kind of clear what I am looking for - I have no idea how
    > to solve that problem... Maybe someone knows.
    > Thanks alot,
    >
    > Nikolai Onken[/color]

    Somehow the mod function might be helpful.
    It will give you the rest of a division. What you have to do, is divide the
    counter of the /8 fractal with 4 and see if it gives you any rest ... if no
    rest, it's dividable by 4. And if it's dividable by 4, just do it then you
    have the counter of the /4 fractal.

    /Andreas

    --
    Registeret Linux user #292411

    Comment

    • matty

      #3
      Re: Cant find working function for this problem

      Nikolai Onken wrote:
      [color=blue]
      > Hey,
      >
      > I got a rather more mathematical Problem but have no idea how to solve
      > it:
      > I have following values and want them to return other values as stated
      > below:
      > (Best seen with fixed pitch font)
      > 3/8 = 1/4
      > --
      > 5/8 -
      > 6/8 | = 2/4
      > 7/8 -[/color]

      You just have to factorize the two numbers, and find the lowest common
      denominator, just as you would if doing it by hand.

      Comment

      Working...