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.

A363996 Rectangular array by descending antidiagonals: row n consists of the numbers k such that n = 1 + maximal runlength of 1's in the ternary representation of k.

This page as a plain text file.
%I A363996 #7 Aug 02 2023 11:49:06
%S A363996 2,6,1,8,3,4,18,5,12,13,20,7,14,39,40,24,9,22,41,120,121,26,10,31,67,
%T A363996 122,363,364,54,11,36,94,202,365,1092,1093,56,15,37,117,283,607,1094,
%U A363996 3279,3280,60,16,38,118,360,850,1822,3281,9840,9841,62,17,42,119
%N A363996 Rectangular array by descending antidiagonals: row n consists of the numbers k such that n = 1 + maximal runlength of 1's in the ternary representation of k.
%C A363996 Every positive integer occurs exactly once.
%e A363996 Corner:
%e A363996     2     6     8    18    20    24     26
%e A363996     1     3     5     7     9    10     11
%e A363996     4    12    14    22    31    36     37
%e A363996    13    39    41    67    94   117    118
%e A363996    40   120   122   202   283   360    361
%e A363996   121   363   365   607   850   1089  1090
%e A363996 Let r(n) = maximal runlength of 1's in the ternary representation of n, for n >= 1, so that (r(n)) = (1,0,1,2,1,0,1,0,1,...). Thus, r(4)=2, so the first term in row 3 of the array is 4.
%t A363996 d[n_] := d[n] = First[RealDigits[n, 3]]; f[w_] := FromDigits[w, 3];
%t A363996 s = Map[Split, Table[d[n], {n, 1, 50000}]];
%t A363996 x[n_] := Select[s, MemberQ[#, Table[1, n]] &];
%t A363996 u[n_] := Map[Flatten, x[n]];
%t A363996 t0 = Select[Range[1, 4000], DigitCount[#, 3, 1] == 0 &, 20];
%t A363996 v = Table[Take[Map[f, u[n]], Min[{20, Length[u[n]]}]], {n, 1, 11}]
%t A363996 t = Join[{t0}, v]
%t A363996 TableForm[t]  (* this sequence as an array *)
%t A363996 Table[t[[n - k + 1, k]], {n, 11}, {k, n, 1, -1}] // Flatten (* this sequence *)
%Y A363996 Cf. A000244 (column 1), A032924 (row 1), A363995.
%K A363996 nonn,tabl,base
%O A363996 1,1
%A A363996 _Clark Kimberling_, Jul 01 2023