login
A387422
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
1, 1, 1, 1, 1, 3, 1, 1, 1, 2, 1, 2, 2, 2, 2, 1, 3, 4, 2, 4, 2, 2, 1, 2, 2, 1, 1, 5, 3, 1, 1, 1, 1, 1, 1, 2, 4, 1, 1, 3, 4, 1, 3, 3, 2, 2, 1, 2, 2, 1, 1, 3, 4, 2, 1, 3, 1, 1, 3, 1, 4, 2, 2, 1, 2, 3, 4, 1, 1, 3, 3, 1, 5, 1, 1, 3, 1, 2, 2, 3, 1, 1, 4, 1, 1, 2, 1, 5, 5, 1, 1, 3, 2, 2, 1, 2, 5, 1, 1, 3, 5, 3, 3, 6, 3
OFFSET
1,6
FORMULA
a(n) = (1+A000523(n)) - A387423(n).
MATHEMATICA
A387422[n_] := LengthWhile[Transpose[IntegerDigits[{n, DivisorSigma[1, n]}, 2][[All, ;; BitLength[n]]]], Equal @@ # &];
Array[A387422, 100] (* Paolo Xausa, Sep 03 2025 *)
PROG
(PARI) A387422(n) = { my(a=binary(n), b=binary(sigma(n)), i=1); while(i<=#a, if(a[i]!=b[i], return(i-1)); i++); (#a); };
(Python)
from os.path import commonprefix
from sympy import divisor_sigma
def A387422(n): return len(commonprefix([bin(n)[2:], bin(divisor_sigma(n))[2:]])) # Chai Wah Wu, Sep 03 2025
CROSSREFS
Cf. also A347380, A387412.
Sequence in context: A209155 A376369 A082062 * A030370 A100808 A010277
KEYWORD
nonn,base
AUTHOR
Antti Karttunen, Sep 01 2025
STATUS
approved