i posted this question yesterday. i really want to know how to do it.

John bought n objects, each costing n cents. The change he received from his $10 bill was less than $1 and consisted of only two denominations of coins. What was the minimum number of coins that John could have received?

Lets work in cents.

If he offered 1,000 cents and received less than 100 cents in change then the cost must have been 901 to 999. Can't be 900 as LESS than 100 cents in change and can't be 1000 cents as he received change.

If it is n objects at n cents each then we are looking for a square(s) between 901 and 999.

There is only one square between 901 and 999 which is 31x31=961

Thus the change is 39 cents.

So what was the minimum number of coins that John could have received?

1000-31^2=39 (n=31)

39=1*25+14*1 15 coins
39=3*10+9*1 12 coins
39=7*5+4*1 11 coins

Is the minimum amount 6 coins? to equal the 39 cents. 1 quarter, 1 dime and 4 pennies. 25+10+4=39

1*25+1*10+4*1=39 in six coins and three denominations.

That's what most cashiers would give you as change, using the "greedy algorithm", i.e. use the biggest possible "denomination" at all times before switching to the lower one.

However, the question requires the change to be in two denominations. Mgraph has enumerated all possible cases for two denominations: make you choice!
Note: cases that do not involve pennies are not possible.

To find the minimum number of coins that John could have received as change, we need to determine the possible combinations of two denominations that would be less than $1 and give the smallest number of coins.

Let's break down the problem step by step:

1. Determine the range of possible values for n:
Since John bought n objects, and each object costs n cents, it implies that n is a positive integer (n > 0).

2. Determine the range of possible denominations for the coins:
The denominations will be less than $1, so they can be any positive integer less than 100 (since 100 cents = $1).

3. Calculate the total cost of the objects:
Since there are n objects and each object costs n cents, the total cost would be n * n = n^2 cents.

4. Calculate the amount of change:
John paid with a $10 bill, which is equivalent to 1000 cents. Therefore, the amount of change he should receive would be 1000 - (n^2) cents.

5. Find combinations of denominations that are less than $1:
The denominations of coins can be any positive integer less than 100. Start testing combinations of denominations to find the one that gives the smallest number of coins and is less than $1.

For example, let's start with denominations of 1 cent and 5 cents:
- If the denomination of 1 cent is used, the maximum number of 1-cent coins John can receive would be (1000 - n^2) / 1.
- If the denomination of 5 cents is used, the maximum number of 5-cent coins John can receive would be (1000 - n^2) / 5.

Test different values of n within the given range to find the combination that gives the smallest number of coins.

6. Determine the minimum number of coins:
Once you find the combination of denominations that gives the smallest number of coins, add the number of coins for each denomination to get the minimum number of coins John could have received as change.

By following these steps, you should be able to find the minimum number of coins that John could have received as change.