OFFSET
0,8
COMMENTS
a(n) = 0 if and only if n = 0, 1, 2, 12.
The sorted unique members: 0, 1, 2, 3, 4, 6, 8, 15, 16, 17, 22, 26 ...
PROG
(Sage)
def a(n):
f = fibonacci(n)
return min((floor(sqrt(f))+1)^2 - f, f - floor(sqrt(f))^2)
(PARI) {a(n) = my(f, i); if( n<0, 0, i = sqrtint( f = fibonacci(n))); min(f - i^2, (i+1)^2 - f)}; /* Michael Somos, Jun 02 2014 */
CROSSREFS
KEYWORD
nonn
AUTHOR
Ralf Stephan, Jun 02 2014
STATUS
approved