cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A194032 Natural interspersion of the squares (1,4,9,16,25,...), a rectangular array, by antidiagonals.

Original entry on oeis.org

1, 4, 2, 9, 5, 3, 16, 10, 6, 7, 25, 17, 11, 12, 8, 36, 26, 18, 19, 13, 14, 49, 37, 27, 28, 20, 21, 15, 64, 50, 38, 39, 29, 30, 22, 23, 81, 65, 51, 52, 40, 41, 31, 32, 24, 100, 82, 66, 67, 53, 54, 42, 43, 33, 34, 121, 101, 83, 84, 68, 69, 55, 56, 44, 45
Offset: 1

Views

Author

Clark Kimberling, Aug 12 2011

Keywords

Comments

See A194029 for definitions of natural fractal sequence and natural interspersion. Every positive integer occurs exactly once (and every pair of rows intersperse), so that as a sequence, A194032 is a permutation of the positive integers; its inverse is A194033.

Examples

			Northwest corner:
  1...4...9...16...25
  2...5...10..17...26
  3...6...11..18...27
  7...12..19..28...39
  8...13..20..29...40
		

Crossrefs

Programs

  • Mathematica
    z = 30;
    c[k_] := k^2;
    c = Table[c[k], {k, 1, z}]  (* A000290 *)
    f[n_] := If[MemberQ[c, n], 1, 1 + f[n - 1]] (* A071797 *)
    f = Table[f[n], {n, 1, 255}]
    r[n_] := Flatten[Position[f, n]]
    t[n_, k_] := r[n][[k]]
    TableForm[Table[t[n, k], {n, 1, 7}, {k, 1, 7}]]
    p = Flatten[Table[t[k, n - k + 1], {n, 1, 14}, {k, 1, n}]] (* A194032 *)
    q[n_] := Position[p, n]; Flatten[Table[q[n], {n, 1, 70}]] (* A194033 *)

Formula

T(n, k) = (k + max(floor(n/2)-1,0))^2 + n - 1. - Zhuorui He, Jul 08 2025