login
A358871
Square array A(n, k), n, k >= 0, read by antidiagonals: A(0, 0) = 0, A(0, 1) = A(1, 0) = 1, A(1, 1) = 2, for n, k >= 0, A(2*n, 2*k) = A(n, k), A(2*n, 2*k+1) = A(n, k) + A(n, k+1), A(2*n+1, 2*k) = A(n, k) + A(n+1, k), A(2*n+1, 2*k+1) = A(n+1, k+(1+(-1)^(n+k))/2) + A(n, k+(1-(-1)^(n+k))/2).
2
0, 1, 1, 1, 2, 1, 2, 3, 3, 2, 1, 3, 2, 3, 1, 3, 4, 5, 5, 4, 3, 2, 4, 3, 4, 3, 4, 2, 3, 5, 6, 5, 5, 6, 5, 3, 1, 4, 3, 5, 2, 5, 3, 4, 1, 4, 5, 7, 8, 7, 7, 8, 7, 5, 4, 3, 5, 4, 6, 5, 6, 5, 6, 4, 5, 3, 5, 7, 8, 7, 8, 9, 9, 8, 7, 8, 7, 5, 2, 6, 4, 7, 3, 7, 4, 7, 3, 7, 4, 6, 2
OFFSET
0,5
COMMENTS
This sequence is a variant of A357743: we can build this sequence:
- by starting from an isosceles right triangle with values 0, 1, 1:
0 <- right angle
/ \
/ \
1-----1
- and repeatedly applying the following substitution to each isosceles right triangle:
t t
/ \ --> /|\
/ \ / | \
u-----v u-u+v-v
^
| right angles
The sequence presents rich patterns (see Links section).
LINKS
Rémy Sigrist, Colored representation of the first 512 antidiagonals (where the color is function of A(n, k) mod 2)
Rémy Sigrist, Colored representation of the first 512 antidiagonals (where the color is function of A(n, k) mod 3)
Rémy Sigrist, Colored representation of the first 512 antidiagonals (where the color is function of A(n, k) mod 5)
FORMULA
A(n, k) = A(k, n).
A(n, 0) = A002487(n).
A(n, n) = 2*A002487(n).
EXAMPLE
Array A(n, k) begins:
n\k | 0 1 2 3 4 5 6 7 8 9 10
----+---------------------------------------
0 | 0 1 1 2 1 3 2 3 1 4 3
1 | 1 2 3 3 4 4 5 4 5 5 7
2 | 1 3 2 5 3 6 3 7 4 8 4
3 | 2 3 5 4 5 5 8 6 7 7 10
4 | 1 4 3 5 2 7 5 8 3 9 6
5 | 3 4 6 5 7 6 9 7 8 8 11
6 | 2 5 3 8 5 9 4 9 5 10 5
7 | 3 4 7 6 8 7 9 6 7 7 12
8 | 1 5 4 7 3 8 5 7 2 9 7
9 | 4 5 8 7 9 8 10 7 9 8 13
10 | 3 7 4 10 6 11 5 12 7 13 6
.
The first antidiagonals are:
0
1 1
1 2 1
2 3 3 2
1 3 2 3 1
3 4 5 5 4 3
2 4 3 4 3 4 2
3 5 6 5 5 6 5 3
1 4 3 5 2 5 3 4 1
4 5 7 8 7 7 8 7 5 4
PROG
(PARI) A(n, k) = { my (nn = n\2, kk=k\2); if (n<=1 && k<=1, n+k, n%2==0 && k%2==0, A(n/2, k/2), n%2==0, A(n/2, k\2)+A(n/2, k\2+1), k%2==0, A(n\2, k\2)+A(n\2+1, k\2), A(n\2+1, k\2+(1+(-1)^(n\2+k\2))/2) + A(n\2, k\2+(1-(-1)^(n\2+k\2))/2)); }
CROSSREFS
Sequence in context: A378261 A305715 A165014 * A357743 A058063 A232094
KEYWORD
nonn,tabl
AUTHOR
Rémy Sigrist, Dec 04 2022
STATUS
approved