A257213 Least d>0 such that floor(n/d) = floor(n/(d+1)).
1, 2, 3, 2, 3, 3, 4, 4, 3, 5, 4, 4, 5, 5, 5, 4, 6, 6, 5, 5, 7, 6, 6, 6, 5, 7, 7, 7, 6, 6, 8, 8, 7, 7, 7, 6, 8, 8, 8, 8, 7, 7, 9, 9, 9, 8, 8, 8, 7, 10, 9, 9, 9, 9, 8, 8, 10, 10, 10, 10, 9, 9, 9, 8, 11, 11, 10, 10, 10, 10, 9, 9, 11, 11, 11, 11, 11, 10, 10, 10
Offset: 0
Examples
a(0)=1 because 0/1 = 0/2. a(1)=2 because [1/1] = 1 > [1/2] = 0 = [1/3], where [x] := floor(x). a(2)=3 because [2/1] = 2 > [2/2] = 1 > [2/3] = 0 = [2/4].
Links
- Michael De Vlieger, Table of n, a(n) for n = 0..10000
Programs
-
Haskell
a257213 n = head [d | d <- [1..], div n d == div n (d + 1)] -- Reinhard Zumkeller, Apr 19 2015
-
Mathematica
f[n_] := Block[{d, k}, Reap@ For[k = 0, k <= n, k++, d = 1; While[Floor[k/d] != Floor[k/(d + 1)], d++]; Sow@ d] // Flatten // Rest]; f@ 79 (* Michael De Vlieger, Apr 18 2015 *) Table[Module[{d=1},While[Floor[n/d]!=Floor[n/(d+1)],d++];d],{n,0,80}] (* Harvey P. Dale, Aug 16 2025 *)
-
PARI
A257213(n)=for(d=sqrtint(n)+1,n+1,n\d==n\(d+1)&&return(d))
Formula
a(n) >= A003059(n+1) = floor(sqrt(n))+1 >= A003059(n) = ceiling(sqrt(n)) >= A257212(n), with strict inequality (in the middle relation) when n is a square.
a(k^2-1) = k for k > 1. Proof: For n=k^2-1=(k-1)*(k+1), floor(n/k) = k-1 = n/(k+1), but n/(k-1)=k+1 and when denominators decrease further, this keeps increasing.
a(k^2) >= k+d when k > d*(d-1). Proof: This follows from k^2/(k+d) = k-d+d^2/(k+d), which shows that a(k) >= d when k > d*(d-1).
a(n) = A259361(n) + 1 + floor(sqrt((A232091(n+1) - 1 - n) + A079813(n+1)) + A079813(n+1)/2) = floor((sqrt(4*n+1)+1)/2) + floor(sqrt(ceiling((n+1) / ceiling(sqrt(n+1)) + 1) * ceiling(sqrt(n+1)) - round(sqrt(n+1)) - n - 1) + (ceiling(sqrt(n+1)) - round(sqrt(n+1)))/2). - Haofen Liang, Aug 25 2021
a(n) = floor(sqrt(p*q - n) + (p + q)/2), where p = floor(sqrt(n)) and q = floor(sqrt(n+1) + 3/2). - Ridouane Oudra, Jan 24 2023
Comments