2026

Got a new sequence in the On‑Line Encyclopedia of Integer Sequences: A392249, numbers k such that k-1 is a perfect square and k+1 is prime. It’s a subset of A163492, numbers for which the two adjacent integers are a perfect square and a prime, which doesn’t constrain the order.

Here are the first terms: 1, 2, 10, 82, 226, 442, 1090, 1522, 2026, 3250, 6562, 9802, 11026, 12322, 13690, 15130, 21610, 29242, 47962, 50626, 56170, 59050, 62002, 65026, 74530, 88210, 91810, 95482, 103042, 119026, 123202, 131770, 136162, 140626, 149770, 173890, 178930, 184042, 194482, …

Enumerating r x c contingency tables with fixed grand total

One way: recursion over the flattened length of the table, i.e., to produce sequences of length rc.

  • Base case: e(1,n), the contingency sequence with 1 element, contains just the grand total, n.
  • Step case: to compute e(l,n) for l > 1, you need
    • 0 conjoined with each sequence produced by e(l-1,n), i.e., all tables one size smaller with the originally desired grand total
    • 1 conjoined with each e(l-1,n-1)
    • 2 conjoined with each e(l-1,n-2)
    • n-1 conjoined with each e(l-1,1)
    • n conjoined with each e(l-1,0)

The number of 2×2 contingency tables seems to be given by the triangular pyramidal numbers, 1, 4, 10, 20, 35, 56, 84, 120, 165, 220, 286, 364, 455, 560, 680, 816, 969, … which is a sum of triangular numbers.

There’s a bunch of work on the geometry of contingency tables.  Fun stuff!  (Ended up playing with this to generate stimuli for an experiment.)