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.

A356026 Main diagonal of right-and-left variant of Kimberling expulsion array, A007063.

Original entry on oeis.org

1, 3, 5, 7, 4, 12, 10, 17, 6, 22, 15, 19, 24, 33, 31, 18, 8, 44, 35, 9, 39, 55, 26, 42, 29, 20, 14, 32, 58, 78, 76, 52, 38, 68, 74, 59, 67, 101, 27, 47, 88, 75, 61, 109, 50, 124, 54, 113, 41, 102, 119, 84, 34, 40, 136, 105, 71, 92, 131, 108, 28, 171, 169
Offset: 1

Views

Author

Clark Kimberling, Jul 23 2022

Keywords

Comments

This array appears in Guy, p. 360.
Conjectures involving a = A007063 and b = A356026:
(1) Every positive integer is eventually expelled in a and in b.
(2) a(n) < b(n) for infinitely many n.
(3) a(n) > b(n) for infinitely many n.
(4) a(n) = b(n) for infinitely many n; see A355323.

Examples

			Corner of the array (with terms of A356026 bracketed):
  [1]  2    3    4    5     6
   2  [3]   4    5    6     7
   2   4   [5]   6    7     8
   4   6    2   [7]   8     9
   2   8    6    9   [4]   10
   9  10    6   11    8   [12]
		

References

  • R. K. Guy, Unsolved Problems in Number Theory, 3rd ed., Springer, 2004; Section E35.

Crossrefs

Programs

  • Mathematica
    a = Join[{{1}},
       NestList[
        Flatten[{#, Range[Last[#] + 1, Last[#] + 3]} &[
           Flatten[Transpose[{Reverse[#[[1]]], #[[2]]} &[
              Partition[#, Length[#]/2] &[
               Drop[#, {(Length[#] + 1)/2}] &[#]]]]]]] &, {2, 3, 4}, 200]];
    Take[a, 9] // TableForm;  (* the array, right-abbreviated *)
    Flatten[Map[Take[#, {(Length[#] + 1)/2}] &, a]] (* A356026 *)
    (* Peter J. C. Moses, Jul 23 2022 *)
    (* Alternate recursive code *)
    KL[i_, j_] := i + j - 1 /; (j >= 2 i - 3);
    KL[i_, j_] := KL[i - 1, i + (j - 2)/2] /; (EvenQ[j] && (j < 2 i - 3));
    KL[i_, j_] := KL[i - 1, i - (j + 3)/2] /; (OddQ[j] && (j < 2 i - 3));
    KL[i_] := KL[i] = KL[i, i]; SetAttributes[KL, Listable];
    A356026[n_] := KL[n];
    Array[A356026, 30]
    (* Enrique Pérez Herrero, Jan 12 2023 *)
  • PARI
    KL(i,j) =
    {
    my(i1,j1);
    i1=i;
    j1=j;
    while(j1<(2*i1-3),
          if(j1%2,
             j1=i1-((j1+3)/2),
             j1=i1+((j1-2)/2)
           );
           i1--;
    );
    return(i1+j1-1);
    }
    A356026(i)=KL(i,i);
    \\ Enrique Pérez Herrero, Jan 12 2023