(Translated by https://www.hiragana.jp/)
# Greetings from The On-Line Encyclopedia of Integer Sequences! http://oeis.org/ Search: id:a050370 Showing 1-1 of 1 %I A050370 #29 May 03 2020 06:03:03 %S A050370 1,0,0,1,0,1,0,1,1,1,0,1,0,1,1,2,0,1,0,1,1,1,0,2,1,1,1,1,0,1,0,2,1,1, %T A050370 1,3,0,1,1,2,0,1,0,1,1,1,0,3,1,1,1,1,0,2,1,2,1,1,0,3,0,1,1,4,1,1,0,1, %U A050370 1,1,0,4,0,1,1,1,1,1,0,3,2,1,0,3,1,1,1,2,0,3,1,1,1,1,1,5,0,1,1,3,0,1 %N A050370 Number of ways to factor n into composite factors. %C A050370 a(n) depends only on prime signature of n (cf. A025487). So a(24) = a(375) since 24 = 2^3*3 and 375 = 3*5^3 both have prime signature (3,1). %H A050370 Alois P. Heinz, Table of n, a(n) for n = 1..10000 %H A050370 N. J. A. Sloane, Transforms %F A050370 Dirichlet g.f.: Product_{n is composite}(1/(1-1/n^s)). %F A050370 Moebius transform of A001055. - _Vladeta Jovovic_, Mar 17 2004 %p A050370 with(numtheory): %p A050370 g:= proc(n, k) option remember; `if`(n>k, 0, 1)+ %p A050370 `if`(isprime(n), 0, add(`if`(d>k, 0, g(n/d, d)), %p A050370 d=divisors(n) minus {1, n})) %p A050370 end: %p A050370 a:= proc(n) a(n):= add(mobius(n/d)*g(d$2), d=divisors(n)) end: %p A050370 seq(a(n), n=1..100); # _Alois P. Heinz_, May 16 2014 %t A050370 g[n_, k_] := g[n, k] = If[n > k, 0, 1] + If[PrimeQ[n], 0, Sum[If[d > k, 0, g[n/d, d]], {d, Divisors[n] ~Complement~ {1, n}}]]; a[n_] := Sum[ MoebiusMu[n/d]*g[d, d], {d, Divisors[n]}]; Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Jan 23 2017, after _Alois P. Heinz_ *) %o A050370 (Python) %o A050370 from sympy.core.cache import cacheit %o A050370 from sympy import mobius, divisors, isprime %o A050370 @cacheit %o A050370 def g(n, k): return (0 if n>k else 1) + (0 if isprime(n) else sum((0 if d>k else g(n//d, d)) for d in divisors(n)[1:-1])) %o A050370 def a(n): return sum(mobius(n//d)*g(d, d) for d in divisors(n)) %o A050370 print([a(n) for n in range(1, 51)]) # _Indranil Ghosh_, Aug 19 2017, after Maple code %Y A050370 Cf. A001055, A002808, A050371, A050372, A050373, A050374, A050375. %Y A050370 a(p^k)=A002865. a(A002110)=A000296. %K A050370 nonn %O A050370 1,16 %A A050370 _Christian G. Bower_, Nov 15 1999 # Content is available under The OEIS End-User License Agreement: http://oeis.org/LICENSE