login
A393422
Irregular table T(n, k), n > 0, k = 1..2^(n-1), read by rows; row 1 contains a single 0; for n >= 1, row n+1 contains the terms of row n plus n^2 followed by the terms of row n minus n^2.
3
0, 1, -1, 5, 3, -3, -5, 14, 12, 6, 4, -4, -6, -12, -14, 30, 28, 22, 20, 12, 10, 4, 2, -2, -4, -10, -12, -20, -22, -28, -30, 55, 53, 47, 45, 37, 35, 29, 27, 23, 21, 15, 13, 5, 3, -3, -5, 5, 3, -3, -5, -13, -15, -21, -23, -27, -29, -35, -37, -45, -47, -53, -55
OFFSET
1,4
COMMENTS
Erdős and Surányi proved that each integer appears infinitely many times in the table.
Row n contains A208531(n-1) distinct values for n > 1.
For any k > 0, the value k first appears in row A231015(k) + 1.
As a flat sequence, the n-th term can be computed from the binary expansion of n, say (1, b_w, ..., b_1): a(n) = Sum_{k = 1, w} k^2 * (-1)^b_k.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..8191 (rows for n = 1..13 flattened)
FORMULA
T(n, 1) = A000330(n-1).
T(n, k) = - T(n, 2^(n-1) + 1 - k).
EXAMPLE
Table T(n, k) begins:
0;
1, -1;
5, 3, -3, -5;
14, 12, 6, 4, -4, -6, -12, -14;
30, 28, 22, 20, 12, 10, 4, 2, -2, -4, -10, -12, -20, -22, -28, -30;
...
MATHEMATICA
s = {0}; s~Join~Flatten@ Reap[Do[s = Join[s + n^2, s - n^2]; Sow[s], {n, 5}] ][[-1, 1]] (* Michael De Vlieger, Feb 16 2026 *)
PROG
(PARI) row(n) = { my (r = [0]); for (k = 1, n-1, r = concat([v + k^2 | v <- r], [v - k^2 | v <- r]); ); return (r); }
(PARI) a(n) = { my (v = 0); for (e = 0, exponent(n)-1, v += (e+1)^2 * (-1)^bittest(n, e); ); return (v); }
CROSSREFS
Cf. A000330, A208531, A231015, A393423, A393461 (positions of 0's).
Sequence in context: A232109 A270753 A388666 * A198923 A056597 A329973
KEYWORD
sign,tabf,base
AUTHOR
Rémy Sigrist, Feb 14 2026
STATUS
approved