%I #40 Oct 12 2015 21:25:27
%S 2,2,1,1,1,1,3,0,0,1,1,3,1,0,1,1,1,2,1,0,0,1,4,1,0,0,1,2,0,2,1,1,1,0,
%T 2,2,0,0,2,2,0,1,1,0,1,1,3,1,2,0,0,2,0,1,1,0,0,3,2,1,1,1,2,0,0,2,0,0,
%U 0,2,4,1,1,1,0,0,1,1,2,0,1,2,1,1,1,0,1,2,0,1,1,2,1,1,1,1,2,1,0,1,0,1,3,0,1,1
%N Number of solutions to x - d(x) = n, where d(n) is the number of divisors of n (A000005).
%C If x-d(x) is never equal to n, then n is in A045765 and a(n) = 0.
%C Number of solutions to A049820(x) = n. - _Jaroslav Krizek_, Feb 09 2014
%H Antti Karttunen, <a href="/A060990/b060990.txt">Table of n, a(n) for n = 0..110880</a>
%F a(0) = 2; for n >= 1, a(n) = Sum_{k = n .. n+A002183(2+A261100(n))} [A049820(k) = n]. (Here [...] denotes the Iverson bracket, resulting 1 when A049820(k) is n and 0 otherwise.) - _Antti Karttunen_, Sep 25 2015, corrected Oct 12 2015.
%F a(n) = Sum_{k = A082284(n) .. A262686(n)} [A049820(k) = n] (when tacitly assuming that A049820(0) = 0.) - _Antti Karttunen_, Oct 12 2015
%F Other identities and observations. For all n >= 0:
%F a(A045765(n)) = 0. a(A236562(n)) > 0. - _Jaroslav Krizek_, Feb 09 2014
%e a(11) = 3 because three numbers satisfy equation x-d(x)=11, namely {13,15,16} with {2,4,5} divisors respectively.
%t lim = 105; s = Table[n - DivisorSigma[0, n], {n, 2 lim + 3}]; Length@ Position[s, #] & /@ Range[0, lim] (* _Michael De Vlieger_, Sep 29 2015, after _Wesley Ivan Hurt_ at A049820 *)
%o (PARI)
%o allocatemem(123456789);
%o uplim = 2162160; \\ = A002182(41).
%o v060990 = vector(uplim);
%o for(n=3, uplim, v060990[n-numdiv(n)]++);
%o A060990 = n -> if(!n,2,v060990[n]);
%o uplim2 = 110880; \\ = A002182(30).
%o for(n=0, uplim2, write("b060990.txt", n, " ", A060990(n)));
%o \\ _Antti Karttunen_, Sep 25 2015
%o (Scheme)
%o (define (A060990 n) (if (zero? n) 2 (add (lambda (k) (if (= (A049820 k) n) 1 0)) n (+ n (A002183 (+ 2 (A261100 n)))))))
%o ;; Auxiliary function add implements sum_{i=lowlim..uplim} intfun(i)
%o (define (add intfun lowlim uplim) (let sumloop ((i lowlim) (res 0)) (cond ((> i uplim) res) (else (sumloop (1+ i) (+ res (intfun i)))))))
%o ;; Proof-of-concept code for the given formula, by _Antti Karttunen_, Sep 25 2015
%Y Cf. A000005, A002183, A049820, A049816, A082284, A155043, A236561, A236565, A259934, A261100, A262507, A262513, A262686.
%Y Cf. A045765 (positions of zeros), A236562 (positions of nonzeros), A262511 (positions of ones).
%Y Cf. A263087 (computed for squares).
%K nonn
%O 0,1
%A _Labos Elemer_, May 11 2001
%E Offset corrected by _Jaroslav Krizek_, Feb 09 2014