OFFSET
1,4
COMMENTS
The only numbers n where a(n)=0 are 1 and 12: a(1) = 1*1 - 1 = 0 and a(12) = 12*12 - 144 = 0. Cohn (1964) proved that 1 and 144 are the only Fibonacci numbers which are perfect squares. In general, for a positive integer k, how many Fibonacci numbers exist such that k = n^2 - (largest Fibonacci number <= n^2)? The only proved answer is 2 for k=0.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..5000
J. H. E. Cohn, On square Fibonacci numbers, Journal London Math.Soc., 39 (1964), pp. 537-540.
MATHEMATICA
a[n_]:=Block[{k=1}, While[Fibonacci[k]<=n^2, k++]; Return[n^2 - Fibonacci[k - 1]]]; Table[a[n], {n, 80}] (* Vincenzo Librandi, Jan 09 2019 *)
With[{fibs=Fibonacci[Range[40]]}, Table[n^2-Select[Nearest[fibs, n^2, 2], #<= n^2&], {n, 70}]][[All, 1]] (* Harvey P. Dale, Feb 05 2019 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Ctibor O. Zizka, Oct 06 2009
EXTENSIONS
a(7) corrected and more terms appended by R. J. Mathar, Oct 08 2009
STATUS
approved