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.

A243256 Smallest distance of the n-th Fibonacci number to the set of all square integers.

This page as a plain text file.
%I A243256 #6 Jun 02 2014 09:48:56
%S A243256 0,0,0,1,1,1,1,3,4,2,6,8,0,8,16,15,26,3,17,44,41,79,22,96,143,51,289,
%T A243256 169,285,140,296,669,267,1449,343,1979,144,592,665,4223,699,5283,2872,
%U A243256 19604,6477,21826,17999,16008,46080,31240,102696,8638,45526,95764
%N A243256 Smallest distance of the n-th Fibonacci number to the set of all square integers.
%C A243256 a(n) = 0 if and only if n = 0, 1, 2, 12.
%C A243256 The sorted unique members: 0, 1, 2, 3, 4, 6, 8, 15, 16, 17, 22, 26 ...
%F A243256 a(n) = min(A190993(n), A216223(n)).
%o A243256 (Sage)
%o A243256 def a(n):
%o A243256     f = fibonacci(n)
%o A243256     return min((floor(sqrt(f))+1)^2 - f, f - floor(sqrt(f))^2)
%o A243256 (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 */
%K A243256 nonn
%O A243256 0,8
%A A243256 _Ralf Stephan_, Jun 02 2014