OFFSET
1,3
COMMENTS
EXAMPLE
Numbers written in ternary:
0
1
2
10
11
12
20
21
22
100
101
102
.....
The NW-SE diagonals are:
0
1
12
10
11
22
20
121
102
......
giving 0, 1, 3, 1, 2, 4, 2, 4, 3, 1, 2, 4, ...
PROG
(PARI) lista(nn) = {my(v = vector(nn), nb); for (n=1, nn, v[n] = digits(n-1, 3); nb = #v[n]; ); for (n=1, nn, if (#v[n] < nb, v[n] = concat(vector(nb-#v[n]), v[n])); ); my(list = List()); for (n=nb, nn, my(s=0, pos=1); forstep(k=n, n-nb+1, -1, s += (v[k])[pos]; pos++; ); listput(list, s); ); Vec(list); } \\ Michel Marcus, Mar 16 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ctibor O. Zizka, Dec 22 2007
EXTENSIONS
New name using formula and more terms from Michel Marcus, Mar 16 2022
STATUS
approved