A161840 Number of noncentral divisors of n.
0, 0, 0, 2, 0, 2, 0, 2, 2, 2, 0, 4, 0, 2, 2, 4, 0, 4, 0, 4, 2, 2, 0, 6, 2, 2, 2, 4, 0, 6, 0, 4, 2, 2, 2, 8, 0, 2, 2, 6, 0, 6, 0, 4, 4, 2, 0, 8, 2, 4, 2, 4, 0, 6, 2, 6, 2, 2, 0, 10, 0, 2, 4, 6, 2, 6, 0, 4, 2, 6, 0, 10, 0, 2, 4, 4, 2, 6, 0, 8, 4, 2, 0, 10, 2, 2, 2, 6, 0, 10, 2, 4, 2, 2, 2, 10, 0, 4, 4, 8
Offset: 1
Examples
The divisors of 4 are 1, 2, 4 so the noncentral divisors of 4 are 1, 4 because its central divisor is 2. The divisors of 12 are 1, 2, 3, 4, 6, 12 so the noncentral divisors of 12 are 1, 2, 6, 12 because its central divisors are 3, 4.
Links
Crossrefs
Programs
-
Maple
A000005 := proc(n) numtheory[tau](n) ; end: A010052 := proc(n) if issqr(n) then 1; else 0 ; fi; end: A161840 := proc(n) A000005(n)+A010052(n)-2 ; end: seq(A161840(n),n=1..100) ; # R. J. Mathar, Jul 04 2009
-
Mathematica
If[EvenQ[#],#-2,#-1]&/@DivisorSigma[0,Range[100]] (* Harvey P. Dale, Sep 22 2024 *)
-
PARI
A161840(n) = numdiv(n)+issquare(n)-2; \\ Antti Karttunen, Jul 07 2017
-
Scheme
(define (A161840 n) (+ (A000005 n) (A010052 n) -2)) ;; Antti Karttunen, Jul 07 2017
Formula
a(n) = tau(n)-2 + (tau(n) mod 2), tau = A000005.
a(n) = 2*A072670(n-1). - Omar E. Pol, Jul 08 2017
Sum_{k=1..n} a(k) ~ n * (log(n) + 2*gamma - 3), where gamma is Euler's constant (A001620). - Amiram Eldar, Jan 14 2024
Extensions
More terms from R. J. Mathar, Jul 04 2009
Comments