login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A227790 Difference between 3n^2 and the nearest square number. 1
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, 48, 23, 4, 33, 47, 18, 13, 46, 44, 11, 24, 61, 39, 2, 37, 71, 32, 9, 52, 66, 23, 22, 69, 59, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

max(a(n)/n) approaches sqrt(3), and the indices of the maxima are apparently in A041017.

LINKS

Table of n, a(n) for n=1..80.

FORMULA

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].

EXAMPLE

a(9) = 13 because the difference between 3*9^2 = 243 and the nearest square number (256) is 13.

PROG

(PARI) a(n)=min(3*n^2-(floor(n*sqrt(3)))^2, (1+floor(n*sqrt(3)))^2-3*n^2)

CROSSREFS

Cf. A001951, A087060.

Sequence in context: A210858 A114586 A052174 * A181897 A212207 A111049

Adjacent sequences:  A227787 A227788 A227789 * A227791 A227792 A227793

KEYWORD

nonn

AUTHOR

Ralf Stephan, Sep 23 2013

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified October 13 20:38 EDT 2019. Contains 327981 sequences. (Running on oeis4.)