This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A056674 #31 Jul 24 2024 09:20:52 %S A056674 0,0,0,1,0,0,0,1,1,0,0,2,0,0,0,1,0,2,0,2,0,0,0,2,1,0,1,2,0,0,0,1,0,0, %T A056674 0,3,0,0,0,2,0,0,0,2,2,0,0,2,1,2,0,2,0,2,0,2,0,0,0,4,0,0,2,1,0,0,0,2, %U A056674 0,0,0,3,0,0,2,2,0,0,0,2,1,0,0,4,0,0,0,2,0,4,0,2,0,0,0,2,0,2,2,3,0,0,0,2,0 %N A056674 Number of squarefree divisors which are not unitary. Also number of unitary divisors which are not squarefree. %C A056674 Numbers of unitary and of squarefree divisors are identical, although the 2 sets are usually different, so sizes of parts outside overlap are also equal to each other. %H A056674 Antti Karttunen, <a href="/A056674/b056674.txt">Table of n, a(n) for n = 1..10000</a> %H A056674 <a href="/index/Eu#epf">Index entries for sequences computed from exponents in factorization of n</a>. %F A056674 a(n) = A034444(n) - A056671(n) = A034444(n) - A000005(A055231(n)) = A034444(n) - A000005(A007913(n)/A055229(n)). %e A056674 For n = 252, it has 18 divisors, 8 are unitary, 8 are squarefree, 2 belong to both classes, so 6 are squarefree but not unitary, thus a(252) = 6. The set {2,3,14,21,42} forms squarefree but non-unitary while the set {4,9,36,28,63,252} of same size gives the set of not squarefree but unitary divisors. %t A056674 Table[DivisorSum[n, 1 &, And[SquareFreeQ@ #, ! CoprimeQ[#, n/#]] &], {n, 105}] (* _Michael De Vlieger_, Jul 19 2017 *) %t A056674 f[p_, e_] := If[e == 1, 2, 1]; a[1] = 0; a[n_] := 2^Length[fct = FactorInteger[n]] - Times @@ (f @@@ fct); Array[a, 100] (* _Amiram Eldar_, Jul 24 2024 *) %o A056674 (PARI) %o A056674 A034444(n) = (2^omega(n)); %o A056674 A057521(n) = { my(f=factor(n)); prod(i=1, #f~, if(f[i, 2]>1, f[i, 1]^f[i, 2], 1)); } \\ _Charles R Greathouse IV_, Aug 13 2013 %o A056674 A055231(n) = n/A057521(n); %o A056674 A056674(n) = (A034444(n) - numdiv(A055231(n))); %o A056674 \\ Or: %o A056674 A055229(n) = { my(c=core(n)); gcd(c, n/c); }; \\ _Charles R Greathouse IV_, Nov 20 2012 %o A056674 A056674(n) = ((2^omega(n)) - numdiv(core(n)/A055229(n))); %o A056674 \\ _Antti Karttunen_, Jul 19 2017 %o A056674 (PARI) a(n) = {my(f = factor(n), e = f[,2]); 2^omega(f) - prod(i = 1, #e, if(e[i] == 1, 2, 1));} \\ _Amiram Eldar_, Jul 24 2024 %o A056674 (Python) %o A056674 from sympy import gcd, primefactors, divisor_count %o A056674 from sympy.ntheory.factor_ import core %o A056674 def a055229(n): %o A056674 c=core(n) %o A056674 return gcd(c, n//c) %o A056674 def a056674(n): return 2**len(primefactors(n)) - divisor_count(core(n)//a055229(n)) %o A056674 print([a056674(n) for n in range(1, 101)]) # _Indranil Ghosh_, Jul 19 2017 %Y A056674 Cf. A000005, A007913, A034444, A055229, A055231, A056671. %K A056674 nonn,easy %O A056674 1,12 %A A056674 _Labos Elemer_, Aug 10 2000