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.

A372708 a(n) is the smallest number k that is the concatenation of the elements of a 3 X 3 matrix whose determinant is n and whose elements are a permutation of the numbers 1 through 9; a(n) = -1 if no such number k exists.

This page as a plain text file.
%I A372708 #32 Jun 03 2024 18:13:03
%S A372708 123456789,123469857,123467589,123467895,123458769,123469578,
%T A372708 123589476,123457689,123748569,123456798,123469587,123469875,
%U A372708 123458967,123457986,123469785,123457698,123548769,123689574,123546789,123457896,123569487,123458697,123547689,123649758,123567498
%N A372708 a(n) is the smallest number k that is the concatenation of the elements of a 3 X 3 matrix whose determinant is n and whose elements are a permutation of the numbers 1 through 9; a(n) = -1 if no such number k exists.
%C A372708 The determinant of a 3 X 3 matrix whose elements are a permutation of the numbers 1..9 cannot exceed 412, so this sequence is finite.
%e A372708 a(0) = 123456789 because it is the smallest number that can be formed by concatenating the elements of a 3 X 3 matrix whose determinant is 0 and whose elements are a permutation of the numbers 1..9. The matrix is [1 2 3] [4 5 6] [7 8 9].
%t A372708 a[n_] := a[n] = Module[{mat}, mat = Select[Partition[#, 3] & /@ Permutations[Range[1, 9]], Det[#] == n &]; If[Length[mat] > 0, First[Sort[ToExpression[StringJoin[Riffle[ToString /@ Flatten[#], ""]]] & /@ mat]], 0]];
%t A372708 Monitor[(* Do not use Monitor[] if using Wolfram Cloud, otherwise memory issues may occur *)Table[a[n], {n, 0, 24}], {n, Table[a[m], {m, 0, n - 1}]}] (* _Robert P. P. McKone_, May 11 2024 *)
%o A372708 (Python)
%o A372708 from sympy import Matrix
%o A372708 from itertools import permutations
%o A372708 adict = dict()
%o A372708 for p in permutations(range(1, 10)):
%o A372708     v = Matrix(3, 3, p).det()
%o A372708     if v not in adict:
%o A372708         adict[v] = int("".join(map(str, p)))
%o A372708 afull = [adict[v] if v in adict else -1 for v in range(max(adict)+1)]
%o A372708 print(afull) # _Michael S. Branicky_, May 11 2024
%Y A372708 Cf. A085000, A088214, A088215, A221976.
%K A372708 base,fini,nonn,less
%O A372708 0,1
%A A372708 _Jean-Marc Rebert_, May 11 2024