login
A387412
The length of the maximal common prefix of the binary expansions of n and A003961(n), where A003961 is fully multiplicative with a(p) = nextprime(p).
6
1, 1, 1, 3, 1, 2, 1, 1, 1, 4, 1, 1, 1, 1, 1, 2, 3, 5, 2, 1, 1, 2, 1, 1, 4, 3, 2, 2, 3, 2, 1, 1, 5, 1, 3, 1, 2, 3, 2, 3, 4, 4, 3, 1, 3, 3, 1, 4, 2, 1, 1, 1, 2, 1, 1, 1, 6, 1, 3, 1, 1, 2, 1, 2, 1, 1, 4, 2, 3, 1, 3, 2, 4, 1, 1, 1, 3, 1, 2, 2, 2, 2, 3, 1, 2, 2, 2, 3, 1, 2, 4, 2, 6, 2, 3, 1, 4, 1, 1, 3, 5, 1, 3, 2, 3
OFFSET
1,4
FORMULA
a(n) = (1+A000523(n)) - A387413(n).
PROG
(PARI)
A003961(n) = { my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); };
A387412(n) = { my(a=binary(n), b=binary(A003961(n)), i=1); while(i<=#a, if(a[i]!=b[i], return(i-1)); i++); (#a); };
(Python)
from os.path import commonprefix
from math import prod
from sympy import factorint, nextprime
def A387412(n): return len(commonprefix([bin(n)[2:], bin(prod(nextprime(p)**e for p, e in factorint(n).items()))[2:]])) # Chai Wah Wu, Sep 03 2025
CROSSREFS
Cf. also A387422.
Sequence in context: A243977 A328569 A377514 * A016569 A072801 A098872
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 01 2025
STATUS
approved