A136175 Tribonacci array, T(n,k).
1, 2, 3, 4, 6, 5, 7, 11, 9, 8, 13, 20, 17, 15, 10, 24, 37, 31, 28, 19, 12, 44, 68, 57, 51, 35, 22, 14, 81, 125, 105, 94, 64, 41, 26, 16, 149, 230, 193, 173, 118, 75, 48, 30, 18, 274, 423, 355, 318, 217, 138, 88, 55, 33, 21, 504, 778, 653, 585, 399, 254, 162, 101, 61, 39, 23
Offset: 1
Examples
Northwest corner: 1 2 4 7 13 24 44 81 149 274 504 3 6 11 20 37 68 125 230 423 778 5 9 17 31 57 105 193 355 653 8 15 28 51 94 173 318 585 10 19 35 64 118 217 399 12 22 41 75 138 254 14 26 48 88 162 16 30 55 101 18 33 61 21 39 23
Programs
-
Maple
# maximum index in A73 such that A73 <= n. A73floorIdx := proc(n) local k ; for k from 3 do if A000073(k) = n then return k ; elif A000073(k) > n then return k -1 ; end if ; end do: end proc: # tribonacci expansion coeffs of n A278038 := proc(n) local k,L,nres ; k := A73floorIdx(n) ; L := [1] ; nres := n-A000073(k) ; while k >= 4 do k := k-1 ; if nres >= A000073(k) then L := [1,op(L)] ; nres := nres-A000073(k) ; else L := [0,op(L)] ; end if ; end do: return L ; end proc: A278038inv := proc(L) add( A000073(i+2)*op(i,L),i=1..nops(L)) ; end proc: A135175 := proc(n,k) option remember ; local a,known,prev,nprev,kprev,freb ; if n =1 then A000073(k+2) ; elif k>3 then procname(n,k-1)+procname(n,k-2)+procname(n,k-3) ; else if k = 1 then for a from 1 do known := false ; for nprev from 1 to n-1 do for kprev from 1 do if procname(nprev,kprev) > a then break ; elif procname(nprev,kprev) = a then known := true ; end if; end do: end do: if not known then return a ; end if; end do: else prev := procname(n,k-1) ; freb := A278038(prev) ; return A278038inv([0,op(freb)]) ; end if; end if; end proc: seq(seq(A135175(n,d-n),n=1..d-1),d=2..12) ; # R. J. Mathar, Jun 07 2022
Formula
T(1,1)=1, T(1,2)=2, T(1,3)=4, T(1,k)=T(1,k-1)+T(1,k-2)+T(1,k-3) for k>3. Row 1 is the tribonacci basis; write B(k)=T(1,k). Each row satisfies the recurrence T(n,k)=T(n,k-1)+T(n,k-2)+T(n,k-3). T(n,1) is least number not in an earlier row. If T(n,1) has tribonacci representation B(k(1))+B(k(2))+...+B(k(m)), then T(n,2) = B(k(2))+B(k(3))+...+B(k(m+1)) and T(n,3) = B(k(3))+B(k(4))+...+B(k(m+2)). (Continued shifting of indices gives the other terms in row n, also.)
Extensions
T(3, 4) corrected and more terms by John Keith, May 09 2022
Comments