OFFSET
1,2
COMMENTS
max(a(n)/n) approaches sqrt(3), and the indices of the maxima are apparently in A041017.
FORMULA
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
KEYWORD
nonn
AUTHOR
Ralf Stephan, Sep 23 2013
STATUS
approved