2

I am playing this cool game called Territory Idle. In this game, two types of buildings can earn resources. Some earn a resource for each worker while others add one per worker of the resource.

Here is an example: I have two temples, each with 70 workers. Each temple worker earns me 1 faith point plus as many points as there are workers in the cathedral.

territory idle faith production

I would like to know what combinations of $x$ (the total number of temple workers) and $y$ (the number of cathedral workers) amount to a rate of earning that is a multiple of 1000. For instance, with $140$ temple workers, $49$ cathedral workers give $+7000$ faith per second.

So far I have $x(y+1) \pmod{1000} = 0$

I don't even know if I'm on the right track.

Update:

Using @InterstellarProbe's answer I was able to visualize the solutions, which suits my needs.

visualization

n49o7
  • 123
  • Perhaps you can start by considering which numbers create a product of $1~000$. Notice that $1~000$ is divisible by the following numbers: $$ 1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 100, 125, 200, 500, 1000 $$ Therefore, both $x$ and $y+1$ have to be something on that list, in order for their product to be $1000$. But that's not a sufficient condition, as for example $10 \cdot 20$ is not yet $1~000$ ... – Matti P. Mar 16 '20 at 13:19
  • 1
    $7000=140(1+49)$ only seems to count faith points earned by the $140$ temple workers. Do cathedral workers not earn faith points? If they do, shouldn't the total points be $(140+49)(1+49)=9450$, with general formula $(x+y)(1+y)$? – Barry Cipra Mar 16 '20 at 13:26
  • @BarryCipra Based on the notations on the screenshot, apparently the cathedral workers do not generate faith points of their own. – David K Mar 16 '20 at 13:31
  • Indeed, each temple worker generates 1 faith point. Each cathedral worker adds 1 to that. With one cathedral worker, each temple worker generates 2 points. The total is $x(1+y)$. – n49o7 Mar 16 '20 at 14:13
  • @n49o7, thank you for the clarification. Perhaps you want to edit the statement in the post to say "Each worker in the temples earns me..." – Barry Cipra Mar 16 '20 at 16:52

1 Answers1

1

$1000 = 2^3 5^3$ so between $x$ and $y+1$, you need those prime factors. Thus, you can have any of the following:

$$\begin{array}{c}(x,y) \\ \hline (m,1000n-1) \\ (2m,500n-1) \\ (4m,250n-1) \\ (5m,200n-1) \\ (8m,125n-1) \\ (10m,100n-1) \\ (20m,50n-1) \\ (25m,40n-1) \\ (40m,25n-1) \\ (50m,20n-1) \\ (100m,10n-1) \\ (125m,8n-1) \\ (200m,5n-1) \\ (250m,4n-1) \\ (500m,2n-1) \\ (1000m,n-1)\end{array}$$

This works for any positive integers $m,n$. Just pick a pair, and plug in any positive integer $m,n$, and it will give you a valid $(x,y)$.

SlipEternal
  • 10,555
  • 1
  • 17
  • 38
  • Is (140, 49) in this list, under a different form ? – n49o7 Mar 16 '20 at 14:18
  • 1
    $$(140,49) = (20\times 7,50\times 1 - 1)$$ – SlipEternal Mar 16 '20 at 14:19
  • Thank you. The second part of the answer would be what is the next lowest pair from this one ? – n49o7 Mar 16 '20 at 15:44
  • Well, $$(20\times 8, 50\times 1 - 1) = (160,49), (50\times 3, 20\times 3 - 1) = (150,59)$$ are both very close. I am not sure what you mean by "next lowest pair". – SlipEternal Mar 16 '20 at 15:53
  • Something that I have left out is that the price of each worker increases exponentially. I wanted to know how I could reach the next thousand with the minimal number of hires. I think $(150,59)$ is it for my current game state. I'm marking as solved and will try to understand better later. – n49o7 Mar 16 '20 at 16:02
  • If it is exponential, then $(140,99) = (20\times 7, 50\times 2 - 1)$ might be less expensive even though it is technically more hires. – SlipEternal Mar 16 '20 at 16:03
  • The price rises independently in each building, following a different curve for each type of building. Monks and Bishops are roughly the same price at this point in the game. Raising the number of Bishops to 99 (50 hires in one building) is considerably more expensive than raising the number of Monks to 150 and Bishops to 59 (20 hires spread over 3 buildings). I would love to model all this but there is a lot to keep track of and I still have to get cozier with math. – n49o7 Mar 16 '20 at 16:15