What's the odd one out? You are to write a program which outputs a single positive integer \$n\$. The integer may have leading zeros and whitespace, and/or trailing whitespace.
Then, choose a positive integer \$m &gt; 1\$. When the program is repeated exactly \$m\$ times, it should output \$m \times n\$ (and only \$m\times n\$). When repeated any number of times other than \$m\$, it should output \$n\$ (and only \$n\$).
You may choose the value of \$m\$, so long as it is a positive integer greater than 1.
In this context, &quot;repeated \$m\$ times&quot; means that the whole program is repeated \$m\$ times, rather than each character. For example, repeating abcde \$4\$ times yields  abcdeabcdeabcdeabcde.
This is code-golf so the shortest code (not repeated \$m\$ times) in bytes wins.

For example, if your program is print 5 which outputs 5, and you choose \$m = 3\$, then:

print 5 should output 5
print 5print 5 should output 5
print 5print 5print 5 should output 15
print 5print 5print 5print 5 should output 5
print 5print 5print 5print 5print 5 should output 5
etc.
R, 16 bytes

T=a=1+!T;T=T-1;a

Try it online!
Works with \$n=1\$ and \$m=2\$.

Previous version:
R, 24 23 21 19 bytes
-4 bytes thanks to Dominic van Essen

T=a=1+0^T^2;T=T-1;a

Try it online!
Works with \$n=1\$ and \$m=2\$. This uses the fact that
\$0^k = \begin{cases} 1 &amp; \text{ if } k=0\\0&amp; \text { otherwise.}\end{cases}\$
Therefore, when the code is repeated \$k\$ times, we output \$1+0^{(2-k)^2}\$, which is worth \$2\$ when \$k=2\$, and \$1\$ otherwise.