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.
%I A309945 #58 Aug 04 2022 15:04:59 %S A309945 0,0,0,1,2,2,3,4,4,5,6,7,8,8,9,10,11,12,12,13,14,15,16,17,18,18,19,20, %T A309945 21,22,23,24,24,25,26,27,28,29,30,31,32,32,33,34,35,36,37,38,39,40,40, %U A309945 41,42,43,44,45,46,47,48,49,50,50,51,52,53,54,55,56,57,58,59,60,60 %N A309945 a(n) = floor(n - sqrt(2*n-1)). %C A309945 The subsequence consisting of numbers that appear twice is A007590. %C A309945 Sequence as triangle: %C A309945 0; %C A309945 0; %C A309945 0; 1, 2; %C A309945 2, 3, 4; %C A309945 4, 5, 6, 7, 8; %C A309945 8, 9, 10, 11, 12; %C A309945 12, 13, 14, 15, 16, 17, 18; %C A309945 18, 19, 20, 21, 22, 23, 24; %C A309945 ... %C A309945 a(1) = 0; for n > 1, a(n) is the number of squares strictly between 2*n - 2 and n^2. %H A309945 <a href="/A309945/b309945.txt">Table of n, a(n) for n = 1..999</a> %F A309945 a(n) = n-1-floor(sqrt(2*n-2)). - _Wesley Ivan Hurt_, Dec 03 2020 %e A309945 For n = 3, 2*n - 2 = 4, n^2 = 9, no square numbers strictly between 4 and 9, a(3) = 0. %e A309945 For n=5, 2*n - 2 = 8, n^2 = 25, two square numbers (9, 16) strictly between 8 and 25, a(5) = 2. %t A309945 Table[Floor[n-(2*n-1)^(1/2)],{n,73}] (* _Stefano Spezia_, Aug 24 2019 *) %o A309945 (PARI) a(n) = floor(n - sqrt(2*n-1)); \\ _Jinyuan Wang_, Aug 26 2019 %o A309945 (Python) %o A309945 from math import isqrt %o A309945 def A309945(n): return (m:=n-1)-isqrt(m<<1) # _Chai Wah Wu_, Aug 04 2022 %Y A309945 Cf. A007590, A080476, A016813. %K A309945 nonn %O A309945 1,5 %A A309945 _Zhandos Mambetaliyev_, Aug 24 2019