OFFSET
0,4
LINKS
G. C. Greubel, Rows n = 0..8 of the irregular triangle, flattened
FORMULA
From G. C. Greubel, Nov 24 2023: (Start)
T(n, 3^(n-1) - k) = T(n, k).
Sum_{k=0..3^(n-1)} T(n, k) = A199923(n).
Sum_{k=0..3^(n-1)} (-1)^k * T(n, k) = A000007(n). (End)
EXAMPLE
1
1, 1
3, 1, 1, 3
9, 1, 1, 3, 1, 1, 3, 1, 1, 9
MAPLE
seq(print(seq(gcd(k, 3^(n-1)), k=0..3^(n-1))), n=0..4);
MATHEMATICA
T[n_, k_]:= If[n==0, 1, GCD[k, 3^(n-1)]];
Table[T[n, k], {n, 0, 6}, {k, 0, 3^(n-1)}]//Flatten (* G. C. Greubel, Nov 24 2023 *)
PROG
(Magma) [1] cat [Gcd(k, 3^(n-1)): k in [0..3^(n-1)], n in [1..6]]; // G. C. Greubel, Nov 24 2023
(SageMath)
def A199922(n, k): return gcd(k, 3^(n-1)) + (2/3)*int(n==0)
flatten([[A199922(n, k) for k in range(int(3^(n-1))+1)] for n in range(7)]) # G. C. Greubel, Nov 24 2023
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Peter Luschny, Nov 12 2011
STATUS
approved