VOOZH about

URL: https://oeis.org/A387423

⇱ A387423 - OEIS


login
A387423
The length of binary expansion of n minus the length of the maximal common prefix of the binary expansions of n and sigma(n), where sigma is the sum of divisors function.
5
0, 1, 1, 2, 2, 0, 2, 3, 3, 2, 3, 2, 2, 2, 2, 4, 2, 1, 3, 1, 3, 3, 4, 3, 3, 4, 4, 0, 2, 4, 4, 5, 5, 5, 5, 4, 2, 5, 5, 3, 2, 5, 3, 3, 4, 4, 5, 4, 4, 5, 5, 3, 2, 4, 5, 3, 5, 5, 3, 5, 2, 4, 4, 6, 5, 4, 3, 6, 6, 4, 4, 6, 2, 6, 6, 4, 6, 5, 5, 4, 6, 6, 3, 6, 6, 5, 6, 2, 2, 6, 6, 4, 5, 5, 6, 5, 2, 6, 6, 4, 2, 4, 4, 1, 4
OFFSET
1,4
COMMENTS
Positions of 0's in this sequence is given by such numbers n that sigma(n) = 2^k * n + r, for some n >= 1, k >= 0, 0 <= r < 2^k. These would include also quasi-perfect numbers and their generalizations, numbers n such that sigma(n) = 2^k * n + 2^k - 1, for some n > 1, k > 0 (see comments in A332223), if such numbers exist. However, it is conjectured that there are no other zeros than those given by A336702.
FORMULA
a(n) = (1+A000523(n)) - A387422(n).
MATHEMATICA
A387423[n_] := BitLength[n] - LengthWhile[Transpose[IntegerDigits[{n, DivisorSigma[1, n]}, 2][[All, ;; BitLength[n]]]], Equal @@ # &];
Array[A387423, 100] (* Paolo Xausa, Sep 03 2025 *)
PROG
(PARI) A387423(n) = { my(a=binary(n), b=binary(sigma(n)), i=1); while(i<=#a, if(a[i]!=b[i], return(#a-(i-1))); i++); (0); };
(Python)
from os.path import commonprefix
from sympy import divisor_sigma
def A387423(n): return n.bit_length()-len(commonprefix([bin(n)[2:], bin(divisor_sigma(n))[2:]])) # Chai Wah Wu, Sep 03 2025
CROSSREFS
Cf. A000203, A000523, A332223, A336700, A336701, A336702 (conjectured positions of 0's), A387422.
Cf. also A347381, A387413.
Sequence in context: A072738 A165316 A362991 * A215976 A141058 A102706
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 01 2025
STATUS
approved