OFFSET
1,1
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..2206
FORMULA
T(n, k) = 10 - (b(n) + k^2 + k + 1) mod 10, where b(n) = A056486(n-1) - (1/2)*[n=1], for n >= 1 and 1 <= k <= b(n) - 1. - G. C. Greubel, Mar 24 2024
EXAMPLE
The irregular triangle begins as:
5;
3, 9, 3;
7, 3, 7, 9, 9, 7, 3, 7, 9;
1, 7, 1, 3, 3, 1, 7, 1, 3, 3, 1, 7, 1, 3, 3;
MATHEMATICA
b[n_]:= 2^(n-3)*(9-(-1)^n) -Boole[n==1]/2;
T[n_, k_]:= 10 -Mod[k^2+k+1+b[n], 10];
Table[T[n, k], {n, 8}, {k, b[n]-1}]//Flatten (* G. C. Greubel, Mar 24 2024 *)
PROG
(Magma)
b:= func< n | n eq 1 select 2 else 2^(n-3)*(9-(-1)^n) >;
A107448:= func< n, k | 10 - ((b(n) +k^2 +k +1) mod 10) >;
[5, 3, 9, 3] cat [A107448(n, k): k in [1..b(n)-1], n in [3..8]]; // G. C. Greubel, Mar 24 2024
(SageMath)
def b(n): return 2^(n-3)*(9-(-1)^n) - int(n==1)/2
def A107449(n, k): return 10 - ((b(n) + k^2+k+1)%10);
flatten([[A107449(n, k) for k in range(1, b(n))] for n in range(1, 8)]) # G. C. Greubel, Mar 24 2024
CROSSREFS
KEYWORD
nonn,less
AUTHOR
Roger L. Bagula, May 26 2005
EXTENSIONS
Edited by G. C. Greubel, Mar 24 2024
STATUS
approved