A284570 a(n) = A000005((n+1)^2) - A000005(n^2).
2, 0, 2, -2, 6, -6, 4, -2, 4, -6, 12, -12, 6, 0, 0, -6, 12, -12, 12, -6, 0, -6, 18, -16, 4, -2, 8, -12, 24, -24, 8, -2, 0, 0, 16, -22, 6, 0, 12, -18, 24, -24, 12, 0, -6, -6, 24, -22, 10, -6, 6, -12, 18, -12, 12, -12, 0, -6, 42, -42, 6, 6, -2, -4, 18, -24, 12, -6, 18, -24, 32, -32, 6, 6, 0, -6, 18, -24, 24, -18, 0, -6, 42, -36, 0, 0, 12, -18, 42, -36, 6, -6
Offset: 1
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
Programs
-
Mathematica
Table[DivisorSigma[0, (n + 1)^2] - DivisorSigma[0, n^2], {n, 100}] (* Indranil Ghosh, Apr 15 2017 *) Differences[DivisorSigma[0,Range[100]^2]] (* Harvey P. Dale, Jul 21 2023 *)
-
PARI
A284570(n) = numdiv((n+1)^2)-numdiv(n^2);
-
Python
from sympy import divisor_count as D print([D((n + 1)**2) - D(n**2) for n in range(1, 101)]) # Indranil Ghosh, Apr 15 2017
-
Scheme
(define (A284570 n) (- (A000005 (A000290 (+ 1 n))) (A000005 (* n n))))