login
A089595
Table T(n,k), n>=0 and k>=0: Stern's diatomic array read by antidiagonals (version 5).
2
1, 0, 1, -1, 1, 1, -3, 0, 2, 1, -2, -1, 1, 3, 1, -7, -1, 1, 2, 4, 1, -5, -4, 0, 3, 3, 5, 1, -8, -3, -1, 1, 5, 4, 6, 1, -3, -5, -1, 2, 2, 7, 5, 7, 1, -13, -2, -2, 1, 5, 3, 9, 6, 8, 1, -10, -9, -1, 1, 3, 8, 4, 11, 7, 9, 1, -17, -7, -5, 0, 4, 5, 11, 5, 13, 8, 10, 1, -7, -12, -4, -1, 1, 7, 7, 14, 6, 15, 9, 11, 1, -18, -5, -7, -1, 3, 2, 10, 9, 17, 7
OFFSET
0,7
FORMULA
Each row is obtained by copying the previous row but interpolating the sum of pairs of adjacent terms.
T(n, 2*k) = T(n-1, k) = T(n, k) - A002487(k).
T(n, 2*k+1) = T(n, 2*k) + T(n, 2*k+2); T(0, 0)=1, T(0, 1)=0.
The k-th column is an arithmetic progression with: T(n, k) = T(0, k) + n*A002487(k).
From William P. Orrick, May 14 2026: (Start)
Negation of row n = 0 is A156140.
Negation of row n = 1 is A321154.
T(n, 2^n - j) = -T(n, 2^n + j) = A002487(j) for n >= 0, 0 <= j <= 2^n.
T(n, k) = 1 if k = 0; T(n, k) = T(r, c) * (n - r + 2) - T(r+1, c), where r = floor(log_2(k)), c = n - 2^(r - 1), if k > 0. (End)
EXAMPLE
Table array begins
row n=0: 1, 0, -1, -3, -2, -7, -5, -8, -3, -13, -10, -17, -7, -18, -11, ...
row n=1: 1, 1, 0, -1, -1, -4, -3, -5, -2, -9, -7, -12, -5, -13, ...
row n=2: 1, 2, 1, 1, 0, -1, -1, -2, -1, -5, -4, -7, -3, ...
row n=3: 1, 3, 2, 3, 1, 2, 1, 1, 0, -1, -1, -2, -1, ...
row n=4: 1, 4, 3, 5, 2, 5, 3, 4, 1, 3, 2, 3, 1, ...
...
From William P. Orrick, May 14 2026: (Start)
Negations of rows may be read off from the denominators of region labels in horizontal transections of the topograph as presented below. In every transection the sequence of numerators is A002487.
|_____________________________________________________________________________
|
A 1/2
|_________________________________________________________________
| |
B 1/1 |
|_____________________________________ _______|_______
| | | |
C 1/0 | | 2/3 |
0/(-1) |__________________ _____|______ ___|___ ___|___
| | | | | | | |
D 1/(-1) | | 2/1 | | 3/4 | | 3/5 |
|________ _____|_____ ___|___ ___|___ __|__ __|__ | |
| | | | | | | | | | | |
E 1/(-2) | | 2/(-1) | | 3/1 | | 3/2 | | 4/5 | | 5/7 |
|___ | | | | | | | | | | |
| |
The horizontal transection at the point marked C contains denominators -1, 0, 1, 3, 2, ..., which is the negation of row 0. Similarly, horizontal transections at D and E give negations of rows 1 and 2. The table may be extended upward, that is, to negative indices n. The horizontal transections at points B and A give negations of rows n = -1 and n = -2, with terms -1, 1, 2, 5, 3, 10, ... and -1, 2, 3, 7, 4, 13, .... This extension is compatible with the recurrence on rows and with the arithmetic progression property of columns. (End)
PROG
(SageMath)
def T(rw, cl): # Works for all integer rw.
curCl = Integer(cl)
curRw = Integer(rw)
indList = []
while curCl > 0:
nextRw = curCl.nbits()
indList.append(curRw - nextRw)
curCl = curCl - 2^(nextRw-1)
curRw = nextRw
co1 = 1
co0 = 1
for i in range(len(indList)-1, -1, -1):
newCo1 = co1 * (indList[i]+2) - co0
co0 = newCo1 + co1
co1 = newCo1
return(co1) # William P. Orrick, May 14 2026
CROSSREFS
Negations of rows: A156140, A321154.
Sequence in context: A394756 A359867 A021335 * A238133 A317922 A337320
KEYWORD
sign,tabl
AUTHOR
Philippe Deléham, Dec 30 2003
STATUS
approved