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.
%I A292523 #42 Feb 16 2025 08:33:51 %S A292523 0,1,12,21,132,213,231,312,1324,1342,2143,2413,2431,3124,3142,3412, %T A292523 4213,4231,15324,15342,21453,24153,24315,24351,24513,31254,31524, %U A292523 31542,35124,35142,35412,42153,42315,42351,42513,45213,51324,51342,153264,153426,153462 %N A292523 Decimal encoding T(n,k) of the k-th non-averaging permutation of [n]; triangle T(n,k), n >= 0, k = 1..A003407(n), read by rows. %C A292523 A non-averaging permutation avoids any 3-term arithmetic progression. %C A292523 The encoding of the empty permutation () is 0. For positive n each element in the permutation is encoded using 1+floor(log_10(n)) = A055642(n) digits with leading 0's if necessary. Then all elements are concatenated. %C A292523 All terms are in increasing order. %H A292523 Alois P. Heinz, <a href="/A292523/b292523.txt">Rows n = 0..14, flattened</a> %H A292523 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/NonaveragingSequence.html">Nonaveraging Sequence</a> %H A292523 Wikipedia, <a href="https://en.wikipedia.org/wiki/Arithmetic_progression">Arithmetic progression</a> %H A292523 <a href="/index/No#non_averaging">Index entries related to non-averaging sequences</a> %e A292523 Triangle T(n,k) begins: %e A292523 : 0; %e A292523 : 1; %e A292523 : 12, 21; %e A292523 : 132, 213, 231, 312; %e A292523 : 1324, 1342, 2143, 2413, 2431, 3124, 3142, 3412, 4213, 4231; %e A292523 : 15324, 15342, 21453, 24153, ..., 42513, 45213, 51324, 51342; %e A292523 : 153264, 153426, 153462, 153624, ..., 624153, 624315, 624351, 624513; %e A292523 : 1532764, 1537264, 1537426, ..., 7351462, 7351624, 7356124; %e A292523 : 15327648, 15327684, 15372648, ..., 84627351, 84672315, 84672351; %e A292523 : 195327648, 195327684, 195372648, ..., 915738462, 915783426, 915783462; %e A292523 : 1090503020710060408, ..., 10020608090401050703; %e A292523 : 109050302110710060408, ..., 1103070910010502060804; %e A292523 : 10905031107021006041208, ..., 120408100206110307090105; %p A292523 T:= proc(n) option remember; local b, l, c; b, l, c:= %p A292523 proc(s, p) local ok, i, j, k; %p A292523 if nops(s) = 0 then l:= [l[], parse(p)] %p A292523 else for j in s do ok, i, k:= true, j-1, j+1; %p A292523 while ok and i>0 and k<=n do ok, i, k:= %p A292523 not i in s xor k in s, i-1, k+1 od; %p A292523 `if`(ok, b(s minus {j}, cat(p, 0$(c-length(j)), j)), 0) %p A292523 od %p A292523 fi %p A292523 end, [], length(n); b({$1..n}, "0"): sort(l)[] %p A292523 end: %p A292523 seq(T(n), n=0..6); %Y A292523 Cf. A003407, A030299, A055642, A088370. %K A292523 nonn,tabf,base %O A292523 0,3 %A A292523 _Alois P. Heinz_, Dec 08 2017