\$n\$-perfect numbers A positive integer \$x\$ is an \$n\$-perfect number if \$\sigma(x) = nx\$, where \$\sigma(x)\$ is the divisor sum function. For example, \$120\$ is a \$3\$-perfect number because its divisors sum to \$360\$:
$$360 = 3\times120 = 1+2+3+4+5+6+8+10+12+15+20+24+30+40+60+120$$
and
$$926073336514623897600 = 6\times154345556085770649600 = 1+2+3+4+5+6+7+8+9+10+11+12+\dots+51448518695256883200+77172778042885324800+154345556085770649600$$
so \$154345556085770649600\$ is a \$6\$-perfect number.
You are to take an integer \$x\$ as input and output a value \$n\$, such that \$x\$ is an \$n\$-perfect number. If no such \$n\$ exists, you may output any consistent value that isn't a positive integer. You will never receive an input outside the bounds of your language, but your algorithm must work for arbitrarily large \$x\$.
This is code-golf so the shortest code in bytes wins.
Mini challenge: Beat 5 bytes in Jelly
Test cases
    x -&gt; n
    1 -&gt; 1
    2 -&gt; 0
    3 -&gt; 0
    4 -&gt; 0
    5 -&gt; 0
    6 -&gt; 2
   28 -&gt; 2
  120 -&gt; 3
  496 -&gt; 2
  500 -&gt; 0
  672 -&gt; 3
30240 -&gt; 4
154345556085770649600 -&gt; 6
Jelly, 5 bytes
R×iÆs

Try it online!
Explanation:
      - Explanation (sample for input 6)
R     - Range ([1, 2, 3, 4, 5, 6])
 ×    - Multiply by input ([6, 12, 18, 24, 30, 36])
   Æs - Divisor sum (12)
  i   - Index of divisor sum in list, else 0 (2)