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.

A227790 Difference between 3n^2 and the nearest square number.

This page as a plain text file.
%I A227790 #11 Sep 24 2013 12:58:49
%S A227790 1,3,2,1,6,8,3,4,13,11,2,9,22,12,1,16,26,11,6,25,27,8,13,36,26,3,22,
%T A227790 48,23,4,33,47,18,13,46,44,11,24,61,39,2,37,71,32,9,52,66,23,22,69,59,
%U A227790 12,37,88,50,1,54,92,39,16,73,83,26,33,94,72,11,52,117,59,6,73,111,44,25,96,98,27,46,121
%N A227790 Difference between 3n^2 and the nearest square number.
%C A227790 max(a(n)/n) approaches sqrt(3), and the indices of the maxima are apparently in A041017.
%F A227790 a(n) = min (A033428(n)-A022838(n)^2, (1+A022838(n))^2-A033428(n)) = min [3*n^2 - (floor[n*sqrt(3)])^2, (1 + floor[n*sqrt(3)])^2 - 3*n^2].
%e A227790 a(9) = 13 because the difference between 3*9^2 = 243 and the nearest square number (256) is 13.
%o A227790 (PARI) a(n)=min(3*n^2-(floor(n*sqrt(3)))^2,(1+floor(n*sqrt(3)))^2-3*n^2)
%Y A227790 Cf. A001951, A087060.
%K A227790 nonn
%O A227790 1,2
%A A227790 _Ralf Stephan_, Sep 23 2013