A351319 a(n) = floor(n/k), where k is the nearest square to n.
1, 2, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1
Offset: 1
Examples
a(5) = floor(5/4) = 1.
Crossrefs
Programs
-
Mathematica
Table[Floor[n/Round[Sqrt[n]]^2], {n, 100}] (* Wesley Ivan Hurt, Mar 18 2022 *)
-
PARI
a(n) = if(n==2,2, my(r,s=sqrtint(n,&r)); r<=s); \\ Kevin Ryde, Mar 23 2022
-
Python
import math def a(n): k = math.isqrt(n) if n - k**2 > k: k += 1 return n // k**2; for n in range(1, 101): print("{}, ".format(a(n)), end="")
-
Python
from math import isqrt def A351319(n): return n if n <= 2 else int((k:=isqrt(n))**2+k-n+1 > 0) # Chai Wah Wu, Mar 26 2022
Comments