OFFSET
1,2
COMMENTS
To get the next row, start with the first element to the right of the diagonal term, then take the first to the left of the diagonal, then the second to the right, then the second to the left, the third to the right, etc.
It is conjectured since 1992 that the main diagonal elements (A007063) are a permutation of the positive integers.
REFERENCES
R. K. Guy, Unsolved Problems Number Theory, Sect E35.
LINKS
Enrique Pérez Herrero, Table of n, a(n) for n = 1..10000
D. Gale, Tracking the Automatic Ant: And Other Mathematical Explorations, ch. 5, p. 27. Springer, 1998.
Enrique Pérez Herrero, Formulas and programs for Kimberling's expulsion array
Clark Kimberling, Problem 1615, Crux Mathematicorum, Vol. 17 (2) 44 1991 and Vol. 18, March 1992, p. 82-83.
Eric Weisstein's World of Mathematics, Kimberling Sequence
EXAMPLE
The array starts (with elements of A007063 in brackets):
[1] 2 3 4 5 6 7 8 9 10 11 12 ...
2 [3] 4 5 6 7 8 9 10 11 12 13 ...
4 2 [5] 6 7 8 9 10 11 12 13 14 ...
6 2 7 [4] 8 9 10 11 12 13 14 15 ...
8 7 9 2 [10] 6 11 12 13 14 15 16 ...
6 2 11 9 12 [7] 13 8 14 15 16 17 ...
13 12 8 9 14 11 [15] 2 16 6 17 18 ...
2 occurs as diagonal element in row 25, 27 in row 7598, and 19 in row 49595 (cf. A006852).
MATHEMATICA
K[i_, j_] := i + j - 1 /; (j >= 2 i - 3);
K[i_, j_] := K[i - 1, i - (j + 2)/2] /; (EvenQ[j] && (j < 2 i - 3));
K[i_, j_] := K[i - 1, i + (j - 1)/2] /; (OddQ[j] && (j < 2 i - 3));
K[i_] := K[i] = K[i, i]; SetAttributes[K, Listable];
T[n_] := n*(n + 1)/2;
S[n_] := Floor[1/2 (1 + Sqrt[1 + 8 (n - 1)])];
AJ[n_] := 1 + T[S[n]] - n;
AI[n_] := 1 + S[n] - AJ[n];
A035486[n_] := K[AI[n], AJ[n]];
(* Enrique Pérez Herrero, Mar 30 2010 *)
PROG
(Python)
def A035486(n, k):
if k >= 2*n-3: return n+k-1
q, r = divmod(k+1, 2)
return A035486(n-1, n-1+(1-2*r)*q) # Pontus von Brömssen, Jan 28 2023
CROSSREFS
AUTHOR
EXTENSIONS
More terms from James A. Sellers, Dec 23 1999
Edited by Georg Fischer, Jul 03 2020
STATUS
approved