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 A228250 #24 Sep 21 2018 22:30:05 %S A228250 0,0,0,0,1,0,0,2,2,0,0,3,6,3,0,0,4,16,12,4,0,0,5,38,45,20,5,0,0,6,86, %T A228250 156,96,30,6,0,0,7,188,519,436,175,42,7,0,0,8,404,1680,1916,980,288, %U A228250 56,8,0,0,9,856,5349,8232,5345,1914,441,72,9,0 %N A228250 Total sum A(n,k) of lengths of longest contiguous subsequences with the same value over all s in {1,...,n}^k; square array A(n,k), n>=0, k>=0, read by antidiagonals. %H A228250 Alois P. Heinz, <a href="/A228250/b228250.txt">Antidiagonals n = 0..140, flattened</a> %H A228250 Project Euler, <a href="https://projecteuler.net/problem=427">Problem 427: n-sequences</a> %e A228250 A(4,1) = 4 = 1+1+1+1: [1], [2], [3], [4]. %e A228250 A(1,4) = 4: [1,1,1,1]. %e A228250 A(3,2) = 12 = 2+1+1+1+2+1+1+1+2: [1,1], [1,2], [1,3], [2,1], [2,2], [2,3], [3,1], [3,2], [3,3]. %e A228250 A(2,3) = 16 = 3+2+1+2+2+1+2+3: [1,1,1], [1,1,2], [1,2,1], [1,2,2], [2,1,1], [2,1,2], [2,2,1], [2,2,2]. %e A228250 Square array A(n,k) begins: %e A228250 0, 0, 0, 0, 0, 0, 0, 0, ... %e A228250 0, 1, 2, 3, 4, 5, 6, 7, ... %e A228250 0, 2, 6, 16, 38, 86, 188, 404, ... %e A228250 0, 3, 12, 45, 156, 519, 1680, 5349, ... %e A228250 0, 4, 20, 96, 436, 1916, 8232, 34840, ... %e A228250 0, 5, 30, 175, 980, 5345, 28610, 151115, ... %e A228250 0, 6, 42, 288, 1914, 12450, 79716, 504492, ... %e A228250 0, 7, 56, 441, 3388, 25571, 190428, 1403689, ... %p A228250 b:= proc(n, m, s, i) option remember; `if`(m>i or s>m, 0, %p A228250 `if`(i=0, 1, `if`(i=1, n, `if`(s=1, (n-1)*add( %p A228250 b(n, m, h, i-1), h=1..m), b(n, m, s-1, i-1)+ %p A228250 `if`(s=m, b(n, m-1, s-1, i-1), 0))))) %p A228250 end: %p A228250 A:= (n, k)-> add(m*add(b(n, m, s, k), s=1..m), m=1..k): %p A228250 seq(seq(A(n, d-n), n=0..d), d=0..12); %t A228250 b[n_, m_, s_, i_] := b[n, m, s, i] = If[m>i || s>m, 0, If[i == 0, 1, If[i == 1, n, If[s == 1, (n-1)*Sum[b[n, m, h, i-1], {h, 1, m}], b[n, m, s-1, i-1] + If[s == m, b[n, m-1, s-1, i-1], 0]]]]]; A[n_, k_] := Sum[m*Sum[b[n, m, s, k], {s, 1, m}], {m, 1, k}]; Table[Table[A[n, d-n], {n, 0, d}], {d, 0, 12}] // Flatten (* _Jean-François Alcover_, Jan 19 2015, after _Alois P. Heinz_ *) %Y A228250 Columns k=0-3 give: A000004, A001477, A002378, A152618(n+1). %Y A228250 Rows n=0-2 give: A000004, A001477, 2*A102712. %Y A228250 Main diagonal gives: A228194. %Y A228250 Cf. A228275. %K A228250 nonn,tabl %O A228250 0,8 %A A228250 _Alois P. Heinz_, Aug 18 2013