OFFSET
1,4
COMMENTS
FORMULA
Empirical observations: (Start)
For all odd numbers x >= 3,
a(x) = (1/2)*x - 1/2,
a(2x) = (3/4)*(2x) - 3/2,
a(4x) = (7/8)*(4x) - 5/2,
a(8x) = (15/16)*(8x) - 7/2,
etc.
For all c, a(2^c) = A000325(c) = 2^c-c.
Summarized by:
(End)
From Luc Rousseau, Apr 01 2019: (Start)
It appears that for all k > 0,
a(4k + 0) = 3k - 2 + a(k),
a(4k + 1) = 2k,
a(4k + 2) = 3k,
a(4k + 3) = 2k + 1.
(End)
EXAMPLE
In A323607 in triangular form,
- row 5 is: 3 5 4 2 1
- row 6 is: 3 5 6 4 2 1
Row 6 is row 5 in which 6 has been inserted in position 3, so a(6) = 3.
MATHEMATICA
lt[x_, y_] := Module[
{c, d, xx, yy, u, v},
{c, d} = IntegerExponent[#, 2] & /@ {x, y};
xx = x/2^c;
yy = y/2^d;
u = If[xx == 1, \[Infinity], c];
v = If[yy == 1, \[Infinity], d];
If[u != v, u < v, If[u == \[Infinity], c > d, xx < yy]]]
row[n_] := Sort[Range[n], lt]
a[n_] := First[FirstPosition[row[n], n]]
Table[a[n], {n, 1, 80}]
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Luc Rousseau, Jan 19 2019
STATUS
approved