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.

A331623 Number of sequences with n copies each of 1,2,...,n avoiding absolute differences between adjacent elements larger than one.

This page as a plain text file.
%I A331623 #22 Jan 04 2021 06:19:09
%S A331623 1,1,6,92,11482,8956752,54331653686,2535604038015218,
%T A331623 951645881858020642746,2911820015993491302722966990,
%U A331623 73784388170659542104264761249115686,15642058800086197220958447712819197014917632,27980772370697320617389378491983217784996780441605354
%N A331623 Number of sequences with n copies each of 1,2,...,n avoiding absolute differences between adjacent elements larger than one.
%H A331623 Alois P. Heinz, <a href="/A331623/b331623.txt">Table of n, a(n) for n = 0..25</a>
%F A331623 a(n) = A331562(n,n).
%e A331623 a(0) = 1: the empty sequence.
%e A331623 a(1) = 1: 1.
%e A331623 a(2) = 6: 1122, 1212, 1221, 2112, 2121, 2211.
%e A331623 a(3) = 92: 111222333, 111223233, 111223323, 111223332, ..., 333221112, 333221121, 333221211, 333222111.
%p A331623 b:= proc(l, q) option remember; (n-> `if`(n<2, 1, add(
%p A331623      `if`(l[j]=1, `if`(j in [1, n], b(subsop(j=[][], l),
%p A331623      `if`(j=1, 0, n)), 0), b(subsop(j=l[j]-1, l), j)), j=
%p A331623      `if`(q<0, 1..n, max(1, q-1)..min(n, q+1)))))(nops(l))
%p A331623     end:
%p A331623 a:= n-> b([n$n], -1):
%p A331623 seq(a(n), n=0..6);
%t A331623 b[l_, q_] := b[l, q] = With[{n = Length[l]}, If[n < 2, 1, Sum[
%t A331623       If[l[[j]] == 1, If[j == 1 || j == n, b[ReplacePart[l, j -> Nothing],
%t A331623       If[j == 1, 0, n]], 0], b[ReplacePart[l, j -> l[[j]] - 1], j]], {j,
%t A331623       If[q < 0, Range[n], Range[Max[1, q - 1], Min[n, q + 1]]]}]]];
%t A331623 a[n_] := b[Table[n, {n}], -1];
%t A331623 Table[Print[n, " ", a[n]]; a[n], {n, 0, 8}] (* _Jean-François Alcover_, Jan 04 2021, after _Alois P. Heinz_ *)
%Y A331623 Main diagonal of A331562.
%Y A331623 Cf. A034841.
%K A331623 nonn
%O A331623 0,3
%A A331623 _Alois P. Heinz_, Jan 22 2020
%E A331623 a(9)-a(12) (using new data provided by _Andrew Howroyd_ in A331562) from _Alois P. Heinz_, Sep 01 2020