OFFSET
1,2
COMMENTS
Positions of record lows in A033885. - Robert Israel, Jan 30 2017
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..350 (terms 1..125 from Robert Israel)
EXAMPLE
240 is in the sequence because sigma(240) - 3*240 = 744 - 720 = 24, and no k < 240 has a value of sigma(k) - 3k this large.
MAPLE
m:= numtheory:-sigma(1) - 3:
count:= 1:
A[1]:= 1:
for n from 2 to 10^6 do
v:= numtheory:-sigma(n)-3*n;
if v > m then
count:= count+1;
A[count]:= n;
m:= v;
fi;
od:
seq(A[i], i=1..count); # Robert Israel, Jan 30 2017
MATHEMATICA
With[{s = Array[DivisorSigma[1, #] - 3 # &, 10^5]}, FirstPosition[s, #][[1]] & /@ Union@ FoldList[Max, s]] (* Michael De Vlieger, Dec 16 2017 *)
PROG
(PARI) isok(k) = {my(x = sigma(k) - 3*k); for (j=1, k-1, if (sigma(j) - 3*j > x, return (0)); ); 1; } \\ Michel Marcus, Jan 30 2017
(MATLAB)
N = 10^6; % to get all terms <= N
V = 1-3*[1:N];
m = V(1);
A(1) = 1;
for n=2:N
V(n*[1:N/n]) = V(n*[1:N/n]) + n;
if V(n) > m
m = V(n);
A(end+1) = n;
end
end
A % Robert Israel, Jan 30 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Jon E. Schoenfield, Jan 29 2017
EXTENSIONS
Duplicate a(2)-a(43) removed from b-file by Andrew Howroyd, Feb 27 2018
STATUS
approved