login
A261865
a(n) is the least integer k such that some multiple of sqrt(k) falls strictly between n and n+1.
7
2, 2, 3, 2, 2, 3, 2, 2, 2, 3, 2, 2, 3, 2, 2, 2, 3, 2, 2, 3, 2, 2, 7, 2, 2, 2, 3, 2, 2, 15, 2, 2, 2, 3, 2, 2, 7, 2, 2, 5, 2, 2, 2, 5, 2, 2, 7, 2, 2, 2, 3, 2, 2, 13, 2, 2, 2, 3, 2, 2, 6, 2, 2, 3, 2, 2, 2, 6, 2, 2, 3, 2, 2, 2, 6, 2, 2, 5, 2, 2, 3, 2, 2, 2, 6, 2
OFFSET
1,1
COMMENTS
a(n) is squarefree for all n.
Record values occur at a(1)=2, a(3)=3, a(23)=7, a(30)=15, a(184)=38, a(8091)=43, a(16060)=46, a(16907)=58, a(20993)=61, a(26286)=97, a(130375)=118, a(169819)=127, a(2135662)=130, a(2345213)=187, a(222125822)=210, a(257240414)=227, ... - Jon E. Schoenfield, Sep 07 2015
a(n) > 2 iff n is in A001952. - Robert Israel, Aug 18 2016
EXAMPLE
a(40) = 5 because:
40 * sqrt(1) = 40 and 41 * sqrt(1) = 41
28 * sqrt(2) < 40 and 29 * sqrt(2) > 41
23 * sqrt(3) < 40 and 24 * sqrt(3) > 41
20 * sqrt(4) = 40 and 21 * sqrt(4) > 41
40 < 18 * sqrt(5) < 41
Thus sqrt(5) is the least integer root with integer multiple between 40 and 41.
MAPLE
f:= proc(n) local k;
for k from 2 do
if ceil(sqrt((n+1)^2/k)) - floor(sqrt(n^2/k)) >= 2 then return k fi
od
end proc:
map(f, [$1..100]); # Robert Israel, Aug 18 2016
MATHEMATICA
Table[k = 2; While[Ceiling[Sqrt[(n + 1)^2/k]] - Floor[Sqrt[n^2/k]] < 2, k++]; k, {n, 120}] (* Michael De Vlieger, Aug 18 2016, after Maple *)
PROG
(Ruby) def a(n); (1..n**2+1).find { |k| (n/k**0.5+1).to_i*k**0.5 < n+1 } end
(PARI) ok(n, k)=h = floor((n+1)/sqrt(k)); (n < h*sqrt(k)) && (h*sqrt(k)< (n+1));
a(n) = my(k=1); while (!ok(n, k), k++); k; \\ Michel Marcus, Sep 04 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Kagey, Sep 03 2015
STATUS
approved