OFFSET
1,3
COMMENTS
A divisor m of n is a twin divisor if m-2 (for m >= 3) and m+2 (for m <= n-2) also divide n.
LINKS
Jens Kruse Andersen, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
The positive divisors of 20 are 1, 2, 4, 5, 10, 20. Of these, 2 and 4 are twin divisors: (2)+2 = 4, which divides n, and (4)-2 = 2 also divides n. So a(20) = the number of these divisors, which is 2.
PROG
(PARI) a(n) = sumdiv(n, d, ((d>2) && !(n % (d-2))) || !(n % (d+2))); \\ Michel Marcus, Jun 25 2014
CROSSREFS
KEYWORD
nonn
AUTHOR
Juri-Stepan Gerasimov, Jun 13 2014
STATUS
approved