login
Sums of three distinct nonzero Fibonacci numbers.
3

%I #17 Dec 12 2023 05:37:50

%S 6,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,

%T 31,32,34,35,36,37,38,39,40,41,42,43,44,45,47,48,49,50,52,55,56,57,58,

%U 59,60,61,62,63,64,65,66,68,69,70,71,73,76,77,78,79,81,84,89,90,91,92,93,94,95

%N Sums of three distinct nonzero Fibonacci numbers.

%C These numbers may have more than one such representation.

%H R. J. Mathar, <a href="/A135558/b135558.txt">Table of n, a(n) for n = 1..1000</a>

%H Colm Mulcahy, <a href="http://www.maa.org/community/maa-columns/past-columns-card-colm/additional-certainties">Additional Certainties</a>, February 2008.

%p isA135558 := proc(n) # returns true if n is in the sequence

%p local xi,yi,x,y,z ;

%p for xi from 2 do

%p x := A000045(xi) ;

%p if 3*x > n then

%p return false;

%p end if;

%p for yi from xi+1 do

%p y := A000045(yi) ;

%p if x+2*y > n then

%p break;

%p else

%p z := n-x-y ;

%p if z >y and isA000045(z) then # see isFib in A000045

%p return true;

%p end if;

%p end if;

%p end do:

%p end do:

%p end proc:

%p A135558 := proc(n)

%p option remember;

%p local a;

%p if n = 1 then

%p 6;

%p else

%p for a from procname(n-1)+1 do

%p if isA135558(a) then

%p return a;

%p end if;

%p end do:

%p end if;

%p end proc: # _R. J. Mathar_, Sep 09 2015

%t fibs[n_ /; n >= 6] := Reap[Module[{k = 1}, While[Fibonacci[k] < n, Sow[Fibonacci[k++]]]]][[2, 1]];

%t okQ[n_] := AnyTrue[IntegerPartitions[n, {3}, fibs[n]], Length[Union[#]] == 3&];

%t Select[Range[6, 100], okQ] (* _Jean-François Alcover_, Dec 12 2023 *)

%Y Cf. A000045, A135709 (Complement).

%K nonn

%O 1,1

%A _Colm Mulcahy_, Feb 23 2008, Mar 02 2008

%E More terms from _N. J. A. Sloane_, Mar 01 2008, corrected Mar 05 2008