|
|
A074829
|
|
Triangle formed by Pascal's rule, except that the n-th row begins and ends with the n-th Fibonacci number.
|
|
18
|
|
|
1, 1, 1, 2, 2, 2, 3, 4, 4, 3, 5, 7, 8, 7, 5, 8, 12, 15, 15, 12, 8, 13, 20, 27, 30, 27, 20, 13, 21, 33, 47, 57, 57, 47, 33, 21, 34, 54, 80, 104, 114, 104, 80, 54, 34, 55, 88, 134, 184, 218, 218, 184, 134, 88, 55, 89, 143, 222, 318, 402, 436, 402, 318, 222
(list;
table;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,4
|
|
LINKS
|
|
|
EXAMPLE
|
The first and second Fibonacci numbers are 1, 1, so the first and second rows of the triangle are 1; 1 1; respectively. The third row of the triangle begins and ends with the third Fibonacci number, 2 and the middle term is the sum of the contiguous two terms in the second row, i.e., 1 + 1 = 2, so the third row is 2 2 2.
Triangle begins:
1;
1, 1;
2, 2, 2;
3, 4, 4, 3;
5, 7, 8, 7, 5;
8, 12, 15, 15, 12, 8;
13, 20, 27, 30, 27, 20, 13;
21, 33, 47, 57, 57, 47, 33, 21;
34, 54, 80, 104, 114, 104, 80, 54, 34;
...
Formatted as a symmetric triangle:
1;
1, 1;
2, 2, 2;
3, 4, 4, 3;
5, 7, 8, 7, 5;
8, 12, 15, 15, 12, 8;
13, 20, 27, 30, 27, 20, 13;
21, 33, 47, 57, 57, 47, 33, 21;
34, 54, 80, 104, 114, 104, 80, 54, 34;
|
|
MATHEMATICA
|
T[n_, 1]:= Fibonacci[n]; T[n_, n_]:= Fibonacci[n]; T[n_, k_]:= T[n-1, k-1] + T[n-1, k]; Table[T[n, k], {n, 1, 12}, {k, 1, n}]//Flatten (* G. C. Greubel, Jul 12 2019 *)
|
|
PROG
|
(Haskell)
a074829 n k = a074829_tabl !! (n-1) !! (k-1)
a074829_row n = a074829_tabl !! (n-1)
a074829_tabl = map fst $ iterate
(\(u:_, vs) -> (vs, zipWith (+) ([u] ++ vs) (vs ++ [u]))) ([1], [1, 1])
(PARI) T(n, k) = if(k==1 || k==n, fibonacci(n), T(n-1, k-1) + T(n-1, k));
for(n=1, 12, for(k=1, n, print1(T(n, k), ", "))) \\ G. C. Greubel, Jul 12 2019
(Sage)
def T(n, k):
if (k==1 or k==n): return fibonacci(n)
else: return T(n-1, k-1) + T(n-1, k)
[[T(n, k) for k in (1..n)] for n in (1..12)] # G. C. Greubel, Jul 12 2019
(GAP)
T:= function(n, k)
if k=1 then return Fibonacci(n);
elif k=n then return Fibonacci(n);
else return T(n-1, k-1) + T(n-1, k);
fi;
end;
Flat(List([1..15], n-> List([1..n], k-> T(n, k) ))); # G. C. Greubel, Jul 12 2019
|
|
CROSSREFS
|
|
|
KEYWORD
|
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|