login
Product of all parts in Zeckendorf representation of n.
4

%I #23 May 18 2016 00:45:04

%S 0,1,2,3,3,5,5,10,8,8,16,24,24,13,13,26,39,39,65,65,130,21,21,42,63,

%T 63,105,105,210,168,168,336,504,504,34,34,68,102,102,170,170,340,272,

%U 272,544,816,816,442,442,884,1326,1326,2210,2210,4420,55,55,110,165

%N Product of all parts in Zeckendorf representation of n.

%H Peter Kagey, <a href="/A273156/b273156.txt">Table of n, a(n) for n = 0..10000</a>

%H StackExchange user "orlp", <a href="http://codegolf.stackexchange.com/questions/79854">Fibonacci products</a>.

%e a(33) = 21*8*3*1 because 33 = 21+8+3+1.

%p A273156 := proc(n)

%p local nred,a,f ;

%p if n = 0 then

%p 0;

%p else

%p nred := n ;

%p a := 1 ;

%p while nred > 1 do

%p f := A087172(nred) ;

%p a := a*f ;

%p nred := nred-f ;

%p end do:

%p a ;

%p end if;

%p end proc: # _R. J. Mathar_, May 17 2016

%t t = Fibonacci /@ Range@ 21; {0}~Join~Table[Times @@ If[MemberQ[t, n], {n}, Most@ MapAt[# + 1 &, Abs@ Differences@ FixedPointList[# - First@ Reverse@ TakeWhile[t, Function[k, # >= k]] &, n], -1]], {n, 58}] (* _Michael De Vlieger_, May 17 2016 *)

%t a[0]=0; a[n_]:=Block[{m=n, p=1, f, k=0}, While[Fibonacci@ ++k <= n]; While[ m>1, f= Fibonacci@ --k; If[ f<=m, m-=f; p*=f]]; p]; Array[a, 80, 0] (* _Giovanni Resta_, May 17 2016 *)

%o (Haskell)

%o a273156 = product . a035516_row

%Y Cf. A035516, A106530.

%K nonn,look

%O 0,3

%A _Peter Kagey_, May 16 2016