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.

This page as a plain text file.
%I A356026 #23 Jun 29 2025 18:15:12
%S A356026 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,
%T A356026 20,14,32,58,78,76,52,38,68,74,59,67,101,27,47,88,75,61,109,50,124,54,
%U A356026 113,41,102,119,84,34,40,136,105,71,92,131,108,28,171,169
%N A356026 Main diagonal of right-and-left variant of Kimberling expulsion array, A007063.
%C A356026 This array appears in Guy, p. 360.
%C A356026 Conjectures involving a = A007063 and b = A356026:
%C A356026 (1)  Every positive integer is eventually expelled in a and in b.
%C A356026 (2)  a(n) < b(n) for infinitely many n.
%C A356026 (3)  a(n) > b(n) for infinitely many n.
%C A356026 (4)  a(n) = b(n) for infinitely many n; see A355323.
%D A356026 R. K. Guy, Unsolved Problems in Number Theory, 3rd ed., Springer, 2004; Section E35.
%H A356026 Enrique Pérez Herrero, <a href="/A356026/b356026.txt">Table of n, a(n) for n = 1..10000</a>
%e A356026 Corner of the array (with terms of A356026 bracketed):
%e A356026   [1]  2    3    4    5     6
%e A356026    2  [3]   4    5    6     7
%e A356026    2   4   [5]   6    7     8
%e A356026    4   6    2   [7]   8     9
%e A356026    2   8    6    9   [4]   10
%e A356026    9  10    6   11    8   [12]
%t A356026 a = Join[{{1}},
%t A356026    NestList[
%t A356026     Flatten[{#, Range[Last[#] + 1, Last[#] + 3]} &[
%t A356026        Flatten[Transpose[{Reverse[#[[1]]], #[[2]]} &[
%t A356026           Partition[#, Length[#]/2] &[
%t A356026            Drop[#, {(Length[#] + 1)/2}] &[#]]]]]]] &, {2, 3, 4}, 200]];
%t A356026 Take[a, 9] // TableForm;  (* the array, right-abbreviated *)
%t A356026 Flatten[Map[Take[#, {(Length[#] + 1)/2}] &, a]] (* A356026 *)
%t A356026 (* _Peter J. C. Moses_, Jul 23 2022 *)
%t A356026 (* Alternate recursive code *)
%t A356026 KL[i_, j_] := i + j - 1 /; (j >= 2 i - 3);
%t A356026 KL[i_, j_] := KL[i - 1, i + (j - 2)/2] /; (EvenQ[j] && (j < 2 i - 3));
%t A356026 KL[i_, j_] := KL[i - 1, i - (j + 3)/2] /; (OddQ[j] && (j < 2 i - 3));
%t A356026 KL[i_] := KL[i] = KL[i, i]; SetAttributes[KL, Listable];
%t A356026 A356026[n_] := KL[n];
%t A356026 Array[A356026, 30]
%t A356026 (* _Enrique Pérez Herrero_, Jan 12 2023 *)
%o A356026 (PARI)
%o A356026 KL(i,j) =
%o A356026 {
%o A356026 my(i1,j1);
%o A356026 i1=i;
%o A356026 j1=j;
%o A356026 while(j1<(2*i1-3),
%o A356026       if(j1%2,
%o A356026          j1=i1-((j1+3)/2),
%o A356026          j1=i1+((j1-2)/2)
%o A356026        );
%o A356026        i1--;
%o A356026 );
%o A356026 return(i1+j1-1);
%o A356026 }
%o A356026 A356026(i)=KL(i,i);
%o A356026 \\ _Enrique Pérez Herrero_, Jan 12 2023
%Y A356026 Cf. A007063, A355323.
%K A356026 nonn
%O A356026 1,2
%A A356026 _Clark Kimberling_, Jul 23 2022