cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A022846 Nearest integer to n*sqrt(2).

This page as a plain text file.
%I A022846 #41 Feb 10 2023 14:47:26
%S A022846 0,1,3,4,6,7,8,10,11,13,14,16,17,18,20,21,23,24,25,27,28,30,31,33,34,
%T A022846 35,37,38,40,41,42,44,45,47,48,49,51,52,54,55,57,58,59,61,62,64,65,66,
%U A022846 68,69,71,72,74,75,76,78,79,81,82,83,85,86,88,89,91,92,93,95,96
%N A022846 Nearest integer to n*sqrt(2).
%C A022846 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
%C A022846 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
%C A022846 Number of triangular numbers less than n^2. - _Philippe Deléham_, Mar 08 2013
%H A022846 Vincenzo Librandi, <a href="/A022846/b022846.txt">Table of n, a(n) for n = 0..10000</a>
%H A022846 Clark Kimberling, <a href="https://www.emis.de/journals/INTEGERS/papers/q15/q15.Abstract.html">Beatty sequences and trigonometric functions</a>, Integers 16 (2016), #A15.
%F A022846 a(n) = A002024(n^2).
%F A022846 a(n+1) - a(n) = 1 or 2. - _Philippe Deléham_, Mar 08 2013
%e A022846 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
%t A022846 Round[Sqrt[2]Range[0,70]] (* _Harvey P. Dale_, Jun 18 2013 *)
%o A022846 (PARI) a(n)=round(n*sqrt(2))
%o A022846 (Magma) [Round(n*Sqrt(2)): n in [0..60]]; // _Vincenzo Librandi_, Oct 22 2011
%o A022846 (Haskell)
%o A022846 a022846 = round . (* sqrt 2) . fromIntegral
%o A022846 -- _Reinhard Zumkeller_, Mar 03 2014
%o A022846 (Python)
%o A022846 from math import isqrt
%o A022846 def A022846(n): return isqrt(n**2<<3)+1>>1 # _Chai Wah Wu_, Feb 10 2023
%Y A022846 Cf. A063957 (complement of this set).
%Y A022846 Cf. A214848 (first differences), also A006338.
%K A022846 nonn,easy
%O A022846 0,3
%A A022846 _Clark Kimberling_