Nuts, girl and boys

Milena collected fallen nuts and called a bunch of boys let them share. She took a condition: the first boy takes one nut and tenth of the rest, the second takes 2 nuts and tenth new rest, the third takes 3 nuts and tenth new rest and so on. Thus managed to distribute all the nuts and everyone got same amounth.

Determine how many nuts gathered Milena and many boys divided the nuts.

Correct result:

nuts:  81
boys:  9

Solution:

Program in PHP:
for($o=2;$o<1000; $o++)
{
    $oo = $o;
    $ch = 1;

    $stack = array();
    do
    {
        $d = $ch + ($oo-$ch)/10;
        if($d != (int)$d)
        {
           continue(2);
        }
        $oo -= $d;
        $ch++;
        $stack[] = $d;
    }while($oo>0);

    if($oo==0)
    {
        echo "nuts=$o boys=$ch";
        print_r($stack);
        exit;
    }
}




We would be pleased if you find an error in the word problem, spelling mistakes, or inaccuracies and send it to us. Thank you!






Showing 0 comments:
avatar




You need to know the following knowledge to solve this word math problem:

Next similar math problems:

  • The dice
    hracia-kocka What is the probability of events that if we throw a dice is rolled less than 6?
  • Three-digit
    seven How many three-digit natural numbers do not have the number 7?
  • Remainder
    numbers2_35 A is an arbitrary integer that gives remainder 1 in the division with 6. B is an arbitrary integer that gives remainder 2 the division by. What makes remainder in division by 3 product of numbers A x B ?
  • Three-digit integers
    numbers2_49 How many three-digit natural numbers exist that do not contain zero and are divisible by five?
  • Seamstress 2
    krajcirka_1 Seamstress bought two kinds of textile in whole meters. One at 50 SKK and the second 70 SKK per meter. How many meter bought from this two textiles when paid totally 1540 SKK?
  • Numbers
    primes Write smallest three-digit number, which in division 5 and 7 gives the rest 2.
  • Balls
    kulicky Michal said to Martin: give me one ball and I'll have twice as you. Martin said: give me 4 and we will have equally. How many balls each have?
  • Three dice
    dices2_2 The player throwing the three dice asked G. Galilei the question: "Should I bet on the sum of 11 or the sum of 12?" What did Galilei answer him? Hint: write down all three triples of numbers that can be thrown and: have a total of 11 have a total of 12 an
  • Basket of fruit
    hrusky_jablka In six baskets, the seller has fruit. In individual baskets, there are only apples or just pears with the following number of fruits: 5,6,12,14,23 and 29. "If I sell this basket," the salesman thinks, "then I will have just as many apples as a pear." Whic
  • Air draft
    numbers2_2 The numbers 1,2,3,4,5 are written on five tickets on the table. Air draft randomly shuffled the tickets and composed a 5-digit number from them. What is the probability that he passed: and, the largest possible number b, the smallest possible number c, a
  • Sheep
    ships Shepherd tending the sheep. Tourists asked him how much they have. The shepherd said, "there are fewer than 500. If I them lined up in 4-row 3 remain. If in 5-row 4 remain. If in 6-row 5 remain. But I can form 7-row." How many sheep have herdsman?
  • Divisors
    divisors The sum of all divisors unknown odd number is 2112. Determine sum of all divisors of number which is twice of unknown numbers.
  • Intelligence test
    test Paľo, Jano, Karol, and Rišo were doing an intelligence test. Palo correctly answered half of the questions plus 7 questions, Jano to a third plus 18 questions, Karol to a quarter plus 21 questions and Risho to a fifth plus 25 questions. After the test, Ka
  • Four-digit numbers
    numberline Find four-digit numbers where all the digits are different. For numbers, the sum of the third and fourth digits is twice the sum of the first two digits, and the sum of the first and fourth digits is equal to the sum of the second and third digits. The di
  • Repair company
    servis The company repairs cars. The first day repair half of the contract second day, the half of the rest and third day 8 residue cars. How many total cars company repaired?
  • Toy cars
    numbers2_13 Pavel has a collection of toy cars. He wanted to regroup them. But in the division of three, four, six, and eight, he was always one left. Only when he formed groups of seven, he divided everyone. How many toy cars have in the collection?
  • Red and white
    tulipany Simona picked 63 tulips in the garden and tied bicolor bouquets for her girlfriends. The tulips were only red and white. She put as many tulips in each bouquet, three of which were always red. How much could Simon tear off white tulips? Write all the opti