Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #14 Jul 20 2023 07:21:04
%S 33,46,51,53,54,67,72,74,75,80,82,83,85,86,87,88,101,106,108,109,114,
%T 116,117,119,120,121,122,127,129,130,132,133,134,135,137,138,139,140,
%U 141,142,143,156,161,163,164,169,171,172
%N Numbers that cannot be represented as the sum of at most three Fibonacci numbers (with repetitions allowed).
%H R. J. Mathar, <a href="/A111458/b111458.txt">Table of n, a(n) for n = 1..1000</a>
%e 33 is neither a Fibonacci number nor can be written as the sum of two or three Fibonacci numbers.
%p isA111458 := proc(n) # returns true if n is in the sequence
%p local xi,yi,x,y,z ;
%p for xi from 0 do
%p x := A000045(xi) ;
%p if 3*x > n then
%p return true;
%p end if;
%p for yi from xi do
%p y := A000045(yi) ;
%p if x+2*y > n then
%p break;
%p else
%p z := n-x-y ;
%p if isA000045(z) then # see isFib in A000045
%p return false;
%p end if;
%p end if;
%p end do:
%p end do:
%p end proc:
%p A111458 := proc(n)
%p option remember;
%p local a;
%p if n = 0 then
%p -1;
%p else
%p for a from procname(n-1)+1 do
%p if isA111458(a) then
%p return a;
%p end if;
%p end do:
%p end if;
%p end proc: # _R. J. Mathar_, Sep 09 2015
%t FibQ[n_] := IntegerQ[Sqrt[5n^2+4]] || IntegerQ[Sqrt[5n^2-4]];
%t P[n_] := IntegerPartitions[n, 3, Select[Range[n], FibQ]];
%t Select[Range[1000], P[#] == {}&] (* _Jean-François Alcover_, Jul 20 2023 *)
%Y Cf. A000045, A000119, A179244, A135709.
%K nonn
%O 1,1
%A _Stefan Steinerberger_, Nov 15 2005