Find the number puzzle.

Ankita Katdare

Ankita Katdare

@abrakadabra Oct 25, 2024
There is a number less than 3000 that when divided by 2 leaves a remainder of 1, when divided by 3 leaves a remainder of 2, when divided by 4 leaves a remainder of 3, When divided by 5 leaves a remainder of 4, when divided by 6 leaves a remainder of 5, and so on up to nine.

What is that number?
Please provide step by step solution to this problem.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • kedarjk

    kedarjk

    @kedarjk-R7FdZW Dec 3, 2013

    2519
    I wrote a simple python program to find it out. 😉
  • Ankita Katdare

    Ankita Katdare

    @abrakadabra Dec 3, 2013

    kedarjk
    2519
    I wrote a simple python program to find it out. 😉
    Please share the script, friend! 😁
  • kedarjk

    kedarjk

    @kedarjk-R7FdZW Dec 3, 2013

    Its no brainer...
    -----------------------------------------
    for i in range (1,3000):
    if i%9==8:
    if i%8==7:
    if i%7==6:
    if i%6==5:
    if i%5==4:
    if i%4==3:
    if i%3==2:
    if i%2==1:
    print "This is the number: "+ str(i)

    -----------------------------------------

    I was curious to check if there is really such number, so wrote a simple script. There must be some other logic to find it out.
  • Anoop Kumar

    Anoop Kumar

    @anoop-kumar-GDGRCn Dec 3, 2013

    That's an bad programming, number of loops will be 2519.

    This is class 8th problem which is calculated by following method, It's like following

    LCM (reminders) *x - GCD(Numbers) until you find the solution. x is an Integer.

    I don't remember that exact method.
  • Alok mishra

    Alok mishra

    @alok-mishra-E4tgN8 Dec 5, 2013

    ianoop
    That's an bad programming, number of loops will be 2519.

    This is class 8th problem which is calculated by following method, It's like following

    LCM (reminders) *x - GCD(Numbers) until you find the solution. x is an Integer.

    I don't remember that exact method.
    its n*LCM(divisor)-(difference Between divisor and remainder) , n is any natural number .
  • Anoop Kumar

    Anoop Kumar

    @anoop-kumar-GDGRCn Dec 5, 2013

    Another example of this question is
    find x such that
    reminder is 2 when divided by 3,
    3 when divided by 4,
    1 when it's 5.
  • smorgasbord

    smorgasbord

    @smorgasbord-Aq7fYb Apr 23, 2014

    Ankita Katdare
    There is a number less than 3000 that when divided by 2 leaves a remainder of 1, when divided by 3 leaves a remainder of 2, when divided by 4 leaves a remainder of 3, When divided by 5 leaves a remainder of 4, when divided by 6 leaves a remainder of 5, and so on up to nine.

    What is that number?
    Please provide step by step solution to this problem.
    A number when
    divided by 2 leaves a remainder of 1 = divided by 2 leaves a remainder of 1
    divided by 3 leaves a remainder of 2 = divided by 3 leaves a remainder of 1
    divided by 4 leaves a remainder of 3 = divided by 4 leaves a remainder of 1
    divided by 5 leaves a remainder of 4 = divided by 5 leaves a remainder of 1
    .
    .
    .
    . = divided by 9 leaves a remainder of 1

    Which means we need LCM of 2,3,4,5 ( 60 ), 7 ( 420 ), 8 (420*2=840), 9 ( 840*3 ) = 2520 ... and something.

    if we need all the right hand side of the ='s to be set right we need to add one to 2520, but we need all the left hand side of the ='s written above to be true, so need to subtract one from it.
    2519.
  • smorgasbord

    smorgasbord

    @smorgasbord-Aq7fYb Apr 23, 2014

    Hell! i made an egregious error:
    A number when
    divided by 2 leaves a remainder of 1 = divided by 2 leaves a remainder of -1
    divided by 3 leaves a remainder of 2 = divided by 3 leaves a remainder of -1
    divided by 4 leaves a remainder of 3 = divided by 4 leaves a remainder of -1
    divided by 5 leaves a remainder of 4 = divided by 5 leaves a remainder of -1
    .
    .
    .
    . = divided by 9 leaves a remainder of -1

    Which means we need LCM of 2,3,4,5 ( 60 ), 7 ( 420 ), 8 (420*2=840), 9 ( 840*3 ) = 2520, & -1 = 2519
    sorry. 😛