A230594 Number of ways to write n as n = x*y, where x, y = noncomposite numbers (A008578), 1 <= x <= n, 1 <= y <= n.
1, 2, 2, 1, 2, 2, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 2, 0, 2, 0, 2, 2, 2, 0, 1, 2, 0, 0, 2, 0, 2, 0, 2, 2, 2, 0, 2, 2, 2, 0, 2, 0, 2, 0, 0, 2, 2, 0, 1, 0, 2, 0, 2, 0, 2, 0, 2, 2, 2, 0, 2, 2, 0, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 2, 0, 0, 2, 0, 2, 0, 0, 2, 2, 0, 2, 2, 2
Offset: 1
Keywords
Examples
For n = 6: a(6) = Sum_(d|6) A080339(d) * A080339(6/d) = 1*0 + 1*1 + 1*1 + 0*1 = 2.
Links
Programs
-
Mathematica
a[n_] := Switch[FactorInteger[n][[;;, 2]], {2}, 1, {1}, 2, {1, 1}, 2, , 0]; a[1] = 1; Array[a, 100] (* _Amiram Eldar, Aug 29 2023 *)
-
PARI
A080339(n) = ((1==n)||isprime(n)); A230594(n) = sumdiv(n,d,(A080339(d)*A080339(n/d))); \\ Antti Karttunen, Jul 27 2017
-
Python
from sympy import factorint def A230594(n): return 0 if sum(f:=factorint(n).values())>2 else (1 if n==1 or max(f)==2 else 2) # Chai Wah Wu, Jul 23 2024
Comments