A285893 Least number to start a run of exactly n nondecreasing values of sigma (sum of divisors, A000203).
45, 5, 313, 1, 356067536821, 36721681
Offset: 1
Examples
We have the following values of sigma for n = 1..10: n 1 2 3 4 5 6 7 8 9 10 ... sigma(n) 0 1 1 2 1 2 1 3 2 2 ... 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. 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.
Crossrefs
Programs
-
Mathematica
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 *)
-
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).
Extensions
a(5)-a(6) from Giovanni Resta, May 07 2017
Comments