login
A157192
Triangle T(n, k) = 2^(n+k-2)*prime(k) + (n mod 2) if k <= floor(n/2) otherwise 2^(2*n-k-2)*prime(n-k) + (n mod 2), with T(n, 0) = T(n, n) = 1, read by rows.
1
1, 1, 1, 1, 4, 1, 1, 9, 9, 1, 1, 16, 48, 16, 1, 1, 33, 97, 97, 33, 1, 1, 64, 192, 640, 192, 64, 1, 1, 129, 385, 1281, 1281, 385, 129, 1, 1, 256, 768, 2560, 7168, 2560, 768, 256, 1, 1, 513, 1537, 5121, 14337, 14337, 5121, 1537, 513, 1, 1, 1024, 3072, 10240, 28672, 90112, 28672, 10240, 3072, 1024, 1
OFFSET
0,5
FORMULA
T(n, k) = 2^(n+k-2)*prime(k) + (n mod 2) if k <= floor(n/2) otherwise 2^(2*n-k-2)*prime(n-k) + (n mod 2), with T(n, 0) = T(n, n) = 1.
T(n, n-k) = T(n, k).
EXAMPLE
Triangle begins as:
1;
1, 1;
1, 4, 1;
1, 9, 9, 1;
1, 16, 48, 16, 1;
1, 33, 97, 97, 33, 1;
1, 64, 192, 640, 192, 64, 1;
1, 129, 385, 1281, 1281, 385, 129, 1;
1, 256, 768, 2560, 7168, 2560, 768, 256, 1;
1, 513, 1537, 5121, 14337, 14337, 5121, 1537, 513, 1;
1, 1024, 3072, 10240, 28672, 90112, 28672, 10240, 3072, 1024, 1;
MATHEMATICA
f[n_, k_]:= Prime[k]*2^(n+k-2) + Mod[n, 2];
T[n_, k_]:= If[k==0 || k==n, 1, If[k<=Floor[n/2], f[n, k], f[n, n-k] ]];
Table[T[n, k], {n, 0, 10}, {k, 0, n}]//Flatten (* modified by G. C. Greubel, Jan 09 2022 *)
PROG
(Sage)
def f(n, k): return 2^(n+k-2)*nth_prime(k) + (n%2)
def T(n, k):
if (k==0 or k==n): return 1
elif (k <= n//2): return f(n, k)
else: return f(n, n-k)
flatten([[T(n, k) for k in (0..n)] for n in (0..12)]) # G. C. Greubel, Jan 09 2022
CROSSREFS
Sequence in context: A008459 A259333 A180960 * A154982 A347972 A146767
KEYWORD
nonn,tabl
AUTHOR
Roger L. Bagula, Feb 24 2009
EXTENSIONS
Edited by G. C. Greubel, Jan 09 2022
STATUS
approved