%I #14 May 04 2016 19:39:46
%S 1,1,2,1,2,3,1,3,5,1,2,3,1,3,5,1,4,7,2,3,4,2,5,8,2,7,12,1,2,3,1,3,5,1,
%T 4,7,2,3,4,2,5,8,2,7,12,3,4,5,3,7,11,3,10,17,1,3,5,1,4,7,1,5,9,3,5,7,
%U 3,8,13,3,11,19,5,7,9,5,12,19,5,17,29,1,2,3,1,3,5,1,4,7,2,3,4,2,5,8,2,7
%N If n=pqr...st in ternary, a(n)=value of the continuant [p,q,r,...,s,t].
%C The continuant function is defined in A072347. The successive record values in this sequence occur at n=0,2,5,8 and, for k>=3, at n=3^k-3^(k-1)-1, 3^k-3^(k-2)-1 and 3^k-1 and are given in A073301.
%C a(3^n-1) = A000129(n+1) for n>=0. - _Alois P. Heinz_, Aug 06 2013
%H Alois P. Heinz, <a href="/A073300/b073300.txt">Table of n, a(n) for n = 0..6560</a> (6560 = 3^8-1)
%H Wikipedia, <a href="http://en.wikipedia.org/wiki/Continuant_(mathematics)">Continuant</a>
%p c:= proc() option remember;
%p if nargs=0 then 1
%p elif nargs=1 then args[1]
%p else args[-1]*c(seq(args[i], i=1..nargs-1))
%p +c(seq(args[i], i=1..nargs-2))
%p fi
%p end:
%p a:= n-> `if`(n=0, 1, c(convert(n, base, 3)[])):
%p seq(a(n), n=0..120); # _Alois P. Heinz_, Aug 06 2013
%Y Cf. A072347.
%K base,nonn,look
%O 0,3
%A _John W. Layman_, Jul 23 2002
|