OFFSET
0,3
COMMENTS
Let R(i,j) be the rectangle with antidiagonals 1; 2,3; 4,5,6; ...; n^2 is in antidiagonal number a(n). Proof: n^2 is in antidiagonal m iff A000217(m-1)< n^2 <=A000217(m), where A000217(m)=m*(m+1)/2. So m = A002024(n^2) = round(n*sqrt(2)) = a(n). - Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Mar 07 2003
In the rectangle R(i,j), n^2 is the number in row i=A057049(n) and column j=A057050(n), so that for n >= 1, a(n) = -1 + A057049(n) + A057050(n). - Clark Kimberling, Jan 31 2011
Number of triangular numbers less than n^2. - Philippe Deléham, Mar 08 2013
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..10000
Clark Kimberling, Beatty sequences and trigonometric functions, Integers 16 (2016), #A15.
FORMULA
a(n) = A002024(n^2).
a(n+1) - a(n) = 1 or 2. - Philippe Deléham, Mar 08 2013
EXAMPLE
n = 4, n^2 = 16; 0, 1, 3, 6, 10, 15 are triangular numbers in interval [0, 16); a(4) = 6. - Philippe Deléham, Mar 08 2013
MATHEMATICA
Round[Sqrt[2]Range[0, 70]] (* Harvey P. Dale, Jun 18 2013 *)
PROG
(PARI) a(n)=round(n*sqrt(2))
(Magma) [Round(n*Sqrt(2)): n in [0..60]]; // Vincenzo Librandi, Oct 22 2011
(Haskell)
a022846 = round . (* sqrt 2) . fromIntegral
-- Reinhard Zumkeller, Mar 03 2014
(Python)
from math import isqrt
def A022846(n): return isqrt(n**2<<3)+1>>1 # Chai Wah Wu, Feb 10 2023
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
STATUS
approved