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.

A051845 Triangle T(n,k) read by rows, in which row n gives all permutations of digits 1..n interpreted in base n+1.

This page as a plain text file.
%I A051845 #85 Jan 05 2023 10:17:31
%S A051845 1,5,7,27,30,39,45,54,57,194,198,214,222,238,242,294,298,334,346,358,
%T A051845 366,414,422,434,446,482,486,538,542,558,566,582,586,1865,1870,1895,
%U A051845 1905,1930,1935,2045,2050,2105,2120,2140,2150,2255,2265,2285,2300,2355,2360
%N A051845 Triangle T(n,k) read by rows, in which row n gives all permutations of digits 1..n interpreted in base n+1.
%C A051845 All terms in any odd row 2m+1 are divisible by 2m+1
%C A051845 The n-th row has n! elements.
%C A051845 Variant of permutational numbers with shifted digits 0->1->2->...->p+1 in p+1 positional system -- see A134750. - _Artur Jasinski_, Nov 08 2007
%C A051845 From _Alexander R. Povolotsky_, Oct 22 2022: (Start)
%C A051845 All terms in any even-indexed row n=2m are divisible by m, where m>0.
%C A051845 Row n starts with T(n,1) = ((n+1)^(n+1)-n^2-n-1)/n^2 = A023811(n+1).
%C A051845 Row n ends with T(n,n!) = ((n+1)^(n+1)*(n-1)+1)/n^2 = A051846(n).
%C A051845 (End)
%H A051845 Samuel Harkness, <a href="/A051845/b051845.txt">Table of n, a(n) for n = 1..10000</a>
%e A051845 Triangle begins:
%e A051845          k=1   k=2   k=3  ...
%e A051845   n=1:     1;
%e A051845   n=2      5,    7;
%e A051845   n=3:    27,   30,  ...,   57;
%e A051845   n=4:   194,  198,  214,  ..., 586;
%e A051845   n=5:  1865, 1870, 1905, 1930, ..., 7465;
%e A051845 E.g., the permutations of digits 1, 2 and 3 in lexicographic order are 123, 132, 213, 231, 312, 321, which interpreted in base 4 give the third row of the table: 27, 30, 39, 45, 54, 57.
%p A051845 with(combinat,permute); compute_u_rows := proc(u) local a,n; a := []; for n from 1 to u do a := [op(a),op(map(list_in_base_b,permute(n),(n+1)))]; od; RETURN(a); end; list_in_base_b := proc(l,b) local k; add(l[nops(l)-k]*(b^k), k=0..(nops(l)-1)); end;
%t A051845 a = {}; b = {}; Do[AppendTo[b, n]; w = Permutations[b]; Do[j = FromDigits[1 + w[[m]], n + 2]; AppendTo[a, j], {m, 1, Length[w]}], {n, 0, 5}]; a (* _Artur Jasinski_, Nov 08 2007 *)
%o A051845 (Python)
%o A051845 from itertools import permutations
%o A051845 def fd(d, b): return sum(di*b**i for i, di in enumerate(d[::-1]))
%o A051845 def row(n): return [fd(d, n+1) for d in permutations(range(1, n+1))]
%o A051845 print([an for r in range(1, 6) for an in row(r)]) # _Michael S. Branicky_, Oct 21 2022
%Y A051845 Left edge = A023811, right edge = A051846.
%Y A051845 Cf. A134640, A134750.
%K A051845 easy,nonn,tabf,base
%O A051845 1,2
%A A051845 _Antti Karttunen_, Dec 13 1999