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.

A256507 Triangle read by rows, giving in triangle A256946 the positions of n-th's row terms in row n+1.

This page as a plain text file.
%I A256507 #16 Sep 17 2019 09:32:43
%S A256507 1,4,7,1,2,5,7,8,11,12,14,1,2,3,6,7,9,11,12,13,16,17,19,20,22,23,1,2,
%T A256507 3,4,7,8,10,11,13,14,16,17,18,19,22,23,24,26,27,28,30,31,33,34,1,2,3,
%U A256507 4,5,8,9,10,12,13,14,16,17,19,20,22,23,24,25,26,29
%N A256507 Triangle read by rows, giving in triangle A256946 the positions of n-th's row terms in row n+1.
%C A256507 A256946(n+1,T(n,k),k) = A256946(n,k), k = 1..n*(n+2);
%C A256507 T(n,k) = k for k = 1..n;
%C A256507 T(n,n+1) = n + 3;
%C A256507 T(n,n*(n+2)) = (n+2)^2 - 2.
%H A256507 Reinhard Zumkeller, <a href="/A256507/b256507.txt">Rows n = 1..30 of triangle, flattened</a>
%e A256507 .  n | T(n,*)             | A256946(n,*)
%e A256507 . ---+--------------------+--------------------------------------
%e A256507 .  1 | 1,4,7              | [1,            2,          3]
%e A256507 .  2 | 1,2,5,7,8,11,12,14 | [1,4,     5,   2,6,      7,3,   8]
%e A256507 .  3 | 1,2,3,6,7,9,11,... | [1,4,9,10,5,11,2,6,12,13,7,3,14,8,15] .
%t A256507 row[n_] := (* row of A256946 *) row[n] = SortBy[Range[n(n+2)], If[IntegerQ[ Sqrt[#]], 0, N[FractionalPart[Sqrt[#]]]]&];
%t A256507 T[n_, k_] := FirstPosition[row[n+1], row[n][[k]]][[1]];
%t A256507 Table[T[n, k], {n, 1, 5}, {k, 1, n(n+2)}] // Flatten (* _Jean-François Alcover_, Sep 17 2019 *)
%o A256507 (Haskell)
%o A256507 import Data.List (elemIndex); import Data.Maybe (fromJust)
%o A256507 a256507 n k = a256507_tabf !! (n-1) !! (k-1)
%o A256507 a256507_row n = a256507_tabf !! (n-1)
%o A256507 a256507_tabf = zipWith (\us vs ->
%o A256507                        map ((+ 1) . fromJust . (`elemIndex` vs)) us)
%o A256507                        a256946_tabf $ tail a256946_tabf
%Y A256507 Cf. A005563 (row lengths), A256946.
%K A256507 nonn,tabf
%O A256507 1,2
%A A256507 _Reinhard Zumkeller_, Apr 22 2015