08-12-2015, 02:34 PM
The total number of partitions of
7
is
15
of which
10
are composed purely of Fibonacci numbers &
1
is composed of distinct Fibonacci numbers.
{ [ 7 ] [ 6 1 ] [ 5 2 ] [ 5 1 1 ] [ 4 3 ] [ 4 2 1 ] [ 4 1 1 1 ] [ 3 3 1 ] [ 3 2 2 ] [ 3 2 1 1 ] [ 3 1 1 1 1 ] [ 2 2 2 1 ] [ 2 2 1 1 1 ] [ 2 1 1 1 1 1 ] [ 1 1 1 1 1 1 1 ] }
The programme PINFIBS returns for integer input the number of partitions in Fibonacci numbers.
The programme PINDFIBS returns for integer input the number of partitions in distinct Fibonacci numbers.
7
is
15
of which
10
are composed purely of Fibonacci numbers &
1
is composed of distinct Fibonacci numbers.
{ [ 7 ] [ 6 1 ] [ 5 2 ] [ 5 1 1 ] [ 4 3 ] [ 4 2 1 ] [ 4 1 1 1 ] [ 3 3 1 ] [ 3 2 2 ] [ 3 2 1 1 ] [ 3 1 1 1 1 ] [ 2 2 2 1 ] [ 2 2 1 1 1 ] [ 2 1 1 1 1 1 ] [ 1 1 1 1 1 1 1 ] }
The programme PINFIBS returns for integer input the number of partitions in Fibonacci numbers.
Code:
PINFIBS
::
CK1&Dispatch
BINT1
::
" # PARTITIONS IN FIBOS"
DispCoord1
SetDA3Temp
%ABSCOERCE
ONEONE
'
::
3PICK3PICK
#<
case2drop
::
#0=case
BINT1
BINT0
;
3PICK3PICK
#-
3PICK3PICK
1GETLAM
EVAL
4UNROLL
OVER
#+SWAP
1GETLAM
EVAL
#+
;
DUP1LAMBIND
EVAL
ABND
FPTR2 ^#>Z
;
;
The programme PINDFIBS returns for integer input the number of partitions in distinct Fibonacci numbers.
Code:
PINDFIBS
::
CK1&Dispatch
BINT1
::
" # PARTITIONS IN DISTINCT FIBOS"
DispCoord1
SetDA3Temp
%ABSCOERCE
ONEONE
'
::
3PICK3PICK
#<
case2drop
::
#0=case
BINT1
BINT0
;
3PICK3PICK
#-
3PICK3PICK
OVER
#+SWAP
1GETLAM
EVAL
4UNROLL
OVER
#+SWAP
1GETLAM
EVAL
#+
;
DUP1LAMBIND
EVAL
ABND
FPTR2 ^#>Z
;
;