OFFSET
0,4
EXAMPLE
a(5) = 5: [5], [3,2], [3,1,1], [2,2,1], [1,1,1,1,1]. Partition [2,1,1,1] is not counted because 4 (the number of parts) is not a Fibonacci number.
a(6) = 7: [8], [5,3], [5,2,1], [3,3,2], [3,2,1,1,1], [2,2,2,1,1], [1,1,1,1,1,1,1,1].
a(7) = 16: [13], [8,5], [8,3,2], [8,2,1,1,1], [5,5,3], [5,5,1,1,1], [5,3,3,1,1], [5,3,2,2,1], [5,2,2,2,2], [5,2,1,1,1,1,1,1], [3,3,3,3,1], [3,3,3,2,2], [3,3,2,1,1,1,1,1], [3,2,2,2,1,1,1,1], [2,2,2,2,2,1,1,1], [1,1,1,1,1,1,1,1,1,1,1,1,1].
MAPLE
f:= n-> (t-> issqr(t+4) or issqr(t-4))(5*n^2):
h:= proc(n) option remember; `if`(f(n), n, h(n-1)) end:
b:= proc(n, i, c) option remember; `if`(n=0 or i=1, `if`(
f(c+n), 1, 0), b(n-i, h(min(n-i, i)), c+1)+b(n, h(i-1), c))
end:
a:= n-> b((<<0|1>, <1|1>>^n)[1, 2]$2, 0):
seq(a(n), n=0..17);
MATHEMATICA
$RecursionLimit = 10000;
f[n_] := With[{t = 5 n^2}, IntegerQ@Sqrt[t+4] || IntegerQ@Sqrt[t-4]];
h[n_] := h[n] = If[f[n], n, h[n - 1]] ;
b[n_, i_, c_] := b[n, i, c] = If[n == 0 || i == 1, If[f[c+n], 1, 0], b[n-i, h[Min[n-i, i]], c+1] + b[n, h[i-1], c]];
a[n_] := a[n] = With[{m = MatrixPower[{{0, 1}, {1, 1}}, n][[1, 2]]}, b[m, m, 0]];
Table[Print[n, " ", a[n]]; a[n], {n, 0, 17}] (* Jean-François Alcover, Sep 09 2022, after Alois P. Heinz *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Alois P. Heinz, May 26 2021
STATUS
approved