All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Algorithms
Jump around (Posted on 2005-07-09) Difficulty: 3 of 5
On a giant tape measure sits an N-frog: that is, a frog with a special preference for the number N. The frog's location at the beginning of each of its jumps is called M. The frog moves on the tape measure according to the following rules:

  • Whenever M>N, then the N-frog makes an N-jump to the left and lands on the number M-N.

  • Whenever M<N, then the N-frog makes an N-jump to the right and lands on number M+N; during landing it also changes its preference and becomes an M-frog.

  • Whenever M=N then the frog is happy and stays on that number.
  • Where will a 851-frog that sits on 1517 be happy?
    Where will an N-frog that sits on M be happy?

    See The Solution Submitted by Hugo    
    Rating: 3.5714 (7 votes)

    Comments: ( You must be logged in to post comments.)
      Subject Author Date
    SolutionSolution for positive integers M, NJosh706792005-07-11 20:57:50
    Solutionre: Why does it stop?Old Original Oskar!2005-07-10 01:27:43
    Some ThoughtsWhy does it stop?Old Original Oskar!2005-07-10 01:17:36
    More aberrant FrogsSteve Herman2005-07-09 11:57:53
    Some ThoughtsAberrant Frogs, a.k.a. Flys in the OintmentSteve Herman2005-07-09 11:48:41
    Some ThoughtsSolution to part 1, theory on part 2Tiralmo2005-07-09 07:33:11
    Frog or beast?brianjn2005-07-09 07:22:47
    Please log in:
    Login:
    Password:
    Remember me:
    Sign up! | Forgot password


    Search:
    Search body:
    Forums (1)
    Newest Problems
    Random Problem
    FAQ | About This Site
    Site Statistics
    New Comments (16)
    Unsolved Problems
    Top Rated Problems
    This month's top
    Most Commented On

    Chatterbox:
    Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information