A056169 Number of unitary prime divisors of n.
0, 1, 1, 0, 1, 2, 1, 0, 0, 2, 1, 1, 1, 2, 2, 0, 1, 1, 1, 1, 2, 2, 1, 1, 0, 2, 0, 1, 1, 3, 1, 0, 2, 2, 2, 0, 1, 2, 2, 1, 1, 3, 1, 1, 1, 2, 1, 1, 0, 1, 2, 1, 1, 1, 2, 1, 2, 2, 1, 2, 1, 2, 1, 0, 2, 3, 1, 1, 2, 3, 1, 0, 1, 2, 1, 1, 2, 3, 1, 1, 0, 2, 1, 2, 2, 2, 2, 1, 1, 2, 2, 1, 2, 2, 2, 1, 1, 1, 1, 0, 1, 3, 1, 1, 3
Offset: 1
Examples
9 = 3^2 so a(9) = 0; 10 = 2 * 5 so a(10) = 2; 11 = 11^1 so a(11) = 1.
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Catalan's Conjecture.
- Index entries for sequences computed from exponents in factorization of n.
Crossrefs
Programs
-
Haskell
a056169 = length . filter (== 1) . a124010_row -- Reinhard Zumkeller, Sep 10 2013
-
Maple
a:= n-> nops(select(i-> i[2]=1, ifactors(n)[2])): seq(a(n), n=1..120); # Alois P. Heinz, Mar 27 2017
-
Mathematica
Join[{0},Table[Count[Transpose[FactorInteger[n]][[2]],1],{n,2,110}]] (* Harvey P. Dale, Mar 15 2012 *) Table[DivisorSum[n, 1 &, And[PrimeQ@ #, CoprimeQ[#, n/#]] &], {n, 105}] (* Michael De Vlieger, Nov 28 2017 *)
-
PARI
a(n)=my(f=factor(n)[,2]); sum(i=1,#f,f[i]==1) \\ Charles R Greathouse IV, Apr 29 2015
-
Python
from sympy import factorint def a(n): f=factorint(n) return 0 if n==1 else sum(1 for i in f if f[i]==1) print([a(n) for n in range(1, 101)]) # Indranil Ghosh, Jun 19 2017
-
Scheme
;; With memoization-macro definec. (definec (A056169 n) (if (= 1 n) 0 (+ (if (= 1 (A067029 n)) 1 0) (A056169 (A028234 n))))) ;; Antti Karttunen, Nov 28 2017
Formula
A prime factor of n is unitary iff its exponent is 1 in prime factorization of n. In general, gcd(p, n/p) = 1 or = p.
Additive with a(p^e) = 1 if e = 1, 0 otherwise.
From Antti Karttunen, Nov 28 2017: (Start)
a(n) <= A295664(n).
(End)
Sum_{k=1..n} a(k) ~ n * (log(log(n)) + B - C), where B is Mertens's constant (A077761) and C = Sum_{p prime} (1/p^2) = 0.452247... (A085548). - Amiram Eldar, Sep 28 2023
Comments