login
A346422
a(n) = (1 + A014081(n))*a(A053645(n)) for n > 0 with a(0) = 1.
3
1, 1, 1, 2, 1, 1, 2, 6, 1, 1, 1, 4, 2, 2, 6, 24, 1, 1, 1, 4, 1, 1, 4, 18, 2, 2, 2, 12, 6, 6, 24, 120, 1, 1, 1, 4, 1, 1, 4, 18, 1, 1, 1, 8, 4, 4, 18, 96, 2, 2, 2, 12, 2, 2, 12, 72, 6, 6, 6, 48, 24, 24, 120, 720, 1, 1, 1, 4, 1, 1, 4, 18, 1, 1, 1, 8, 4, 4, 18, 96
OFFSET
0,4
LINKS
Michael De Vlieger, Log-log scatterplot of a(n), n = 1..2^16.
FORMULA
a(n) = (1 + A014081(n))*a(A053645(n)) for n > 0 with a(0) = 1.
a(4n+1) = a(2n) = a(n) for n > 0 with a(0) = a(1) = 1.
a(4n+3) = 2!*b(n), a(8n+11) = 2*2!*b'(n), b'(2n) = b(n), b'(2n+1) = b'(n),
a(8n+7) = 3!*c(n), a(16n+23) = 3*3!*c'(n), c'(2n) = c(n), c'(2n+1) = c'(n),
a(16n+15) = 4!*d(n), a(32n+47) = 4*4!*d'(n), d'(2n) = d(n), d'(2n+1) = d'(n),
a(32n+31) = 5!*e(n), a(64n+95) = 5*5!*e'(n), e'(2n) = e(n), e'(2n+1) = e'(n),
and so on, i.e.,
a(2^m*(n+1) - 1) = m!*z(n), a(2^m*(2n+3) - 1) = m*m!*z'(n), z'(2n) = z(n), z'(2n+1) = z'(n).
From that, we get:
a(2^3*(2n+1) + 3) = 2*a(4n+3), a(2^3*(2n+1) + 11) = a(8n+11),
a(2^4*(2n+1) + 7) = 3*a(8n+7), a(2^4*(2n+1) + 23) = a(16n+23),
a(2^5*(2n+1) + 15) = 4*a(16n+15), a(2^5*(2n+1) + 47) = a(32n+47),
a(2^6*(2n+1) + 31) = 5*a(32n+31), a(2^6*(2n+1) + 95) = a(64n+95),
and so on, i.e.,
a(2^m*(4n+3) - 1) = m*a(2^m*(n+1) - 1), a(2^m*(4n+5) - 1) = a(2^m*(2n+3) - 1).
Let
p(n) = 0 if A036987(n) = 1 otherwise p(2n+1) = 2 + p(n), p(2n) = 2 - (n mod 2) for n > 0 with p(0) = p(1) = 0,
q(2n+1) = 2^(n+2) - 1, q(2n) = 2^(n+2) + q(2n-1) for n > 0 with q(1) = 3,
p_1(n) = 0 if A036987(n) = 1 otherwise q(p(n)) for n > 0 with p_1(0) = 0,
p_2(n) = 0 if A036987(n) = 1 otherwise p_2(2n+1) = p_2(n), p_2(2n) = floor((n - 1)/2) for n > 0 with p_2(0) = p_2(1) = 0,
so
a(4n+3) = (log_2(4n+4))! if A036987(4n+3) = 1 otherwise (1 + (p(n) mod 2)*(p(n) + 1)/2)*a(p_2(n)*2^(floor(p(n)/2) + 2) + p_1(n)) for n >= 0.
a((4^n - 1)/3) = 1 for n >= 0.
a(2^m*(2^n - 1)) = n! for n > 0, m >= 0.
MATHEMATICA
Nest[Append[#1, (1 + Count[Partition[IntegerDigits[#2, 2], 2, 1], {1, 1}]) #1[[#2 - 2^Floor@ Log2[#2] + 1]]] & @@ {#, Length[#]} &, {1}, 79] (* Michael De Vlieger, Feb 04 2022 *)
PROG
(PARI)
a(n)=if(n==0, 1, (1+b(n))*a(c(n)))
b(n)=if(n==1, 0, if(n%4<2, b(n\4), b(n\2) + n%2)) \\ A014081
c(n)=if(n==1, 0, 2*c(n\2) + n%2) \\ A053645
(PARI) a(n) = my(f=1, ret=1); if(n, for(i=0, logint(n, 2), if(bittest(n, i), ret*=(f+=bittest(n, i-1))))); ret; \\ Kevin Ryde, Aug 25 2021
(Python)
from functools import lru_cache
from re import split
@lru_cache(maxsize=None)
def A346422(n): return 1 if n <= 1 else A346422(int((s:= bin(n)[2:])[1:], 2))*(1+sum(len(d)-1 for d in split('0+', s) if d != '')) # Chai Wah Wu, Feb 04 2022
CROSSREFS
Cf. A003714 (positions of 1's), A014081, A036987, A053645.
Sequence in context: A163982 A246661 A246660 * A245405 A233543 A156588
KEYWORD
nonn,base
AUTHOR
Mikhail Kurkov, Aug 08 2021 [verification needed]
STATUS
approved