3
$\begingroup$

So I recently thought of something. What if you take an integer (like 17 in this case), and find the set of numbers that add together in the closest form, of length 2, but increasing each level. So you would divide 17 into 8 and 9. But then those two numbers would be divided 3 times, producing 2, 3, 3 and 3, 3, 3 respectively. You go any number of levels until the resulting numbers are 0 or 1. Then you count the number of levels. This creates a sort of magnitude of the number. In this case, that magnitude is 3, because it required 3 levels to reach 1's and 0's. enter image description here

Now the question is, is there any mathematical way of doing this? Any formula that could produce the magnitude of an integer?

$\endgroup$
7
  • 1
    $\begingroup$ Probably more suited for math.se. $\endgroup$
    – Zimonze
    Commented Feb 16, 2019 at 23:03
  • $\begingroup$ Can $17$ be reduced to any two numbers e.g. $6$ and $11$? $\endgroup$
    – athin
    Commented Feb 17, 2019 at 0:37
  • $\begingroup$ Inverse factorial, rounded down $\endgroup$
    – Dr Xorile
    Commented Feb 17, 2019 at 0:58
  • $\begingroup$ Actually rounded up and minus 1 $\endgroup$
    – Dr Xorile
    Commented Feb 17, 2019 at 1:13
  • $\begingroup$ @athin It says 'that add together in the closest form'. Bit obscure, but I think it means the set of numbers on the lower level can differ by at most 1. $\endgroup$
    – ZanyG
    Commented Feb 17, 2019 at 1:40

3 Answers 3

3
$\begingroup$

As Dr Xorile noted in the comments, all numbers, $k$, which are of magnitude $N$ satisfy

$N! <k \leq (N+1)!$

Reasoning

Consider the largest number represented by a given magnitude $N$.

For this number, the bottom layer would consist entirely of groups of $N+1$ $1$s. The number of groups in this bottom layer is just $N!$ (since the $n$th layer has $n$ times more factors than the $(n-1)$th layer) and the sum of the numbers in the bottom layer is equal to the original number.

Hence, this largest number of magnitude $N$ is $k = (N+1)N! = (N+1)!$

Increasing this number by $1$ guarantees that we are forced to have at least one $2$ in the $(N+1)$th layer and so the magnitude must increase by $1$.

$\endgroup$
1
  • $\begingroup$ Wow! I wasn't expecting this to actually work. Good job guys lol. $\endgroup$
    – Rigidity
    Commented Feb 17, 2019 at 22:50
2
$\begingroup$

You basically follow the formula $ceil(ceil(n/2)/3)...$ and see how many steps are needed. If it was a factorial written as $x!$, the magnitude would be $x-1$ with only 1s left at the end, and if $x!<n<(x+1)!$, it will take more steps after $x-1$ steps and no more than $x$ ones, so $x$ steps are necessary.

$\endgroup$
2
$\begingroup$

Well, I put together a little java program:

public class NumberMagnitude {

public static void main(String[] args) { int value = 17; int k = value; int magnitude = 2; while(true) { k=(k/magnitude); (k<=1) { break; } magnitude++; } System.out.println("The magnitude of " + value + " equals " + magnitude); } }
I'm not sure if this is exactly what you where looking for when you asked for a formula, but I figured it couldn't hurt.
You can modify the variable named "value" to test a different number; you could also create a fancier application that asks the user for input or used GUI, but I didn't have time for that.

$\endgroup$
1
  • $\begingroup$ Cool, this could help. $\endgroup$
    – Rigidity
    Commented Feb 17, 2019 at 22:51

Not the answer you're looking for? Browse other questions tagged or ask your own question.