# Sheep

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?

Result

n =  119

#### Solution:

a%b = a modulo b

n=7: n%4=3, n%5=2, n%6=1, n%7=0
n=14: n%4=2, n%5=4, n%6=2, n%7=0
n=21: n%4=1, n%5=1, n%6=3, n%7=0
n=28: n%4=0, n%5=3, n%6=4, n%7=0
n=35: n%4=3, n%5=0, n%6=5, n%7=0
n=42: n%4=2, n%5=2, n%6=0, n%7=0
n=49: n%4=1, n%5=4, n%6=1, n%7=0
n=56: n%4=0, n%5=1, n%6=2, n%7=0
n=63: n%4=3, n%5=3, n%6=3, n%7=0
n=70: n%4=2, n%5=0, n%6=4, n%7=0
n=77: n%4=1, n%5=2, n%6=5, n%7=0
n=84: n%4=0, n%5=4, n%6=0, n%7=0
n=91: n%4=3, n%5=1, n%6=1, n%7=0
n=98: n%4=2, n%5=3, n%6=2, n%7=0
n=105: n%4=1, n%5=0, n%6=3, n%7=0
n=112: n%4=0, n%5=2, n%6=4, n%7=0
n=119: n%4=3, n%5=4, n%6=5, n%7=0 <<<<<<=====

Leave us a comment of example and its solution (i.e. if it is still somewhat unclear...):

Be the first to comment!

## Next similar examples:

1. Children
Less than 20 children is played various games on the yard. They can create a pairs, triso and quartets. How many children were in the yard when Annie came to them?
2. Balls
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?
3. Toy cars
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?
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." Which
5. Antennas
If you give me two antennas will be same. If you give me again your two antenna I have a 5× so many than you. How many antennas have both mans?
6. Three-digit
How many three-digit natural numbers do not have the number 7?
7. Theorem prove
We want to prove the sentence: If the natural number n is divisible by six, then n is divisible by three. From what assumption we started?
8. Odd/even number
Pick any number. If that number is even, divide it by 2. If it's odd, multiply it by 3 and add 1. Now repeat the process with your new number. If you keep going, you'll eventually end up at 1. Every time. Prove. ..
9. 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.
10. Hexagon = 8 parts
Divide the regular hexagon into eight equal parts.
11. Divisors
The sum of all divisors unknown odd number is 2112. Determine sum of all divisors of number which is twice of unknown numbers.
12. Divisibility
Write all the integers x divisible by seven and eight at the same time for which the following applies: 100
13. Divisors
Find all divisors of number 493. How many are them?
14. Repair company
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?
15. Remainder
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 ?
16. Seamstress 2
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?
17. Numbers
Write smallest three-digit number, which in division 5 and 7 gives the rest 2.