%I #36 Sep 07 2024 08:54:58
%S 14,2,1,3,6,9,5,7,62
%N a(n)=x is the smallest solution to abs(sigma(x+1)-sigma(x))=n, or 0 if no solution exists.
%C The known values plus conjectured zero values are: 14, 2, 1, 3, 6, 9, 5, 7, 62, 0, 13, 25, 22, 16, 12, 32, 11, 0, 104, 18, 837, 17, 19, 63, 46, 0, 28, 0, 116, 24, 58, 31, 2222, 0, 39, 242, 23, 0, 147, 0, 30, 675, 29, 35, 52, 0, 777, 0, 40, 0, 435, 0, 42, 36, 41, 0, 91, 0, 67, 0, 65, 99, 0, 195, 110, 80, 53, 48, 124, 0, 243, 0, 70, 97.
%C The first unknown value is a(9).
%C The zero values are based on a search up to 10000000.
%C While it is known that not all m values satisfy sigma(x) = m (see A007369), it is more difficult to determine those numbers which cannot be a difference of sigma(u)-sigma(w) for some u and w.
%C No solutions to abs(sigma(x+1)-sigma(x)) = n with x < 2*10^8 for n = 9, 17, 25, 27, 33, 37, 39, 45, 47, 49, 51, 55, 57, 59, 62, 69, 71. - _Robert Israel_, May 24 2016
%C Except for a(62) = 1159742042, all the terms a(n)>0 with n <= 100 are either smaller than 10^6 or greater than 2*10^12. - _Giovanni Resta_, Oct 29 2019
%e n=5: least solution is 9 because sigma for 9 and 9+1=10 are 13 and 13+5=18.
%t f[x_] :=Abs[DivisorSigma[1, n+1] - DivisorSigma[1, n]]; t=Table[0, {258}]; Do[s=f[n]; If[s<258 && t[[s+1]]==0, t[[s+1]]=n], {n, 10^7}]; t (* edited by _Giovanni Resta_, Oct 29 2019 *)
%o (MATLAB)
%o N = 2*10^8; % to search sigma(n) for n <= N
%o M = 100; % to get a(1) to a(M)
%o Sigma = ones(1,N);
%o for n=2:N
%o inds = [n:n:N];
%o Sigma(inds) = Sigma(inds) + n;
%o end
%o DSigma = abs(Sigma(2:end) - Sigma(1:end-1));
%o A = zeros(1,M);
%o for v = 1:M
%o r = find(DSigma == v,1,'first');
%o if numel(r) > 0
%o A(v) = r;
%o end
%o end
%o A % _Robert Israel_, May 24 2016
%Y Cf. A000203, A007369, A112645, A112646.
%K nonn,more,hard
%O 0,1
%A _Labos Elemer_, Sep 28 2005
%E Entry revised by _N. J. A. Sloane_, May 25 2016
%E a(0) prepended by _Giovanni Resta_, Oct 29 2019