%I #30 May 18 2017 12:42:23
%S 45,5,313,1,356067536821,36721681
%N Least number to start a run of exactly n nondecreasing values of sigma (sum of divisors, A000203).
%C a(6) = 36721681, see also A028965.
%C The analogous sequence based on tau = A000005 instead of sigma is A284597.
%e We have the following values of sigma for n = 1..10:
%e n 1 2 3 4 5 6 7 8 9 10 ...
%e sigma(n) 0 1 1 2 1 2 1 3 2 2 ...
%e We see a run of 4 nondecreasing values starting at 1, ending at 4, therefore a(4) = 1. There is a run of 2 nondecreasing values starting at 5, ending at 6, therefore a(2) = 5.
%e Correspondingly, a run of length 1 corresponds to a number n such that sigma(n-1) > sigma(n) > sigma(n+1). This happens first at a(1) = 45.
%t Function[s, {45}~Join~Map[Function[r, Select[s, Last@ # == r &][[1, 1]]], Range[2, Max[s[[All, -1]] ] ]]]@ Map[{#[[1, 1]], Length@ # + 1} &, DeleteCases[SplitBy[#, #[[-1]] >= 0 &], k_ /; k[[1, -1]] < 0]] &@ MapIndexed[{First@ #2, #1} &, Differences@ Array[DivisorSigma[1, #] &, 10^6]] (* _Michael De Vlieger_, May 06 2017 *)
%o (PARI) alias(A,A285893);A=vector(19);apply(scan(N,s=1,t=sigma(s))=for(k=s+1,N,t>(t=sigma(k))||next;k-s>#A||A[k-s]||printf("a(%d)=%d,",k-s,s)||A[k-s]=s;s=k);done,[10^8]) \\ Search may be extended using scan(END,START).
%Y Cf. A000005, A000203, A028965, A284597 (analog for sigma_0), A286287 (analog for omega = A001221), A286288 (analog for bigomega = A001222).
%K nonn,more,hard
%O 1,1
%A _M. F. Hasler_, May 06 2017
%E a(5)-a(6) from _Giovanni Resta_, May 07 2017