OFFSET
1,5
COMMENTS
Number of iterations of x -> 2x needed before the result is nondeficient (sigma(x) >= 2x), when starting from x=n, or -1 if a nondeficient number would never be reached (when n is a power of 2).
If neither x and y are powers of 2, and gcd(x,y) = 1, then a(x*y) <= min(a(x),a(y)). Compare to a similar comment in A336835.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
For odd primes p, a(p) = A000523(p).
MATHEMATICA
a[n_] := Module[{e = IntegerExponent[n, 2], s}, If[n == 2^e, -1, s = DivisorSigma[-1, n/2^e]; Max[Ceiling[Log2[s/(s - 1)]] - e - 1, 0]]]; Array[a, 100] (* Amiram Eldar, Apr 01 2024 *)
PROG
(PARI) A336915(n) = if(!bitand(n, n-1), -1, for(i=0, oo, my(n2 = n+n); if(sigma(n) >= n2, return(i)); n = n2));
CROSSREFS
KEYWORD
sign
AUTHOR
Antti Karttunen, Aug 08 2020
STATUS
approved