%I #29 Oct 18 2021 18:28:42
%S 1,2,3,4,5,6,7,8,9,261,370,407,52036,724212,223123410
%N Positive integers equal to the permanent of the circulant matrix formed by their decimal digits.
%C 1, 2, 3, 4, 5, 6, 7, 8, 9, 370 and 407 are also equal to the determinant of the circulant matrix formed by their decimal digits.
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/Permanent.html">Permanent</a>
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/CirculantMatrix.html">Circulant Matrix</a>
%e | 2 6 1 |
%e perm | 1 2 6 | = 2*2*2 + 6*6*6 + 1*1*1 + 1*2*6 + 6*1*2 + 2*6*1 = 261.
%e | 6 1 2 |
%e .
%e | 2 2 3 1 2 3 4 1 0 |
%e | 0 2 2 3 1 2 3 4 1 |
%e | 1 0 2 2 3 1 2 3 4 |
%e | 4 1 0 2 2 3 1 2 3 |
%e perm | 3 4 1 0 2 2 3 1 2 | = 223123410
%e | 2 3 4 1 0 2 2 3 1 |
%e | 1 2 3 4 1 0 2 2 3 |
%e | 3 1 2 3 4 1 0 2 2 |
%e | 2 3 1 2 3 4 1 0 2 |
%p with(linalg): P:=proc(q) local a, b, c, d, i, j, k, n, t;
%p for n from 1 to q do d:=ilog10(n)+1; a:=convert(n, base, 10); c:=[];
%p for k from 1 to nops(a) do c:=[op(c), a[-k]]; od; t:=[op([]), c];
%p for k from 2 to d do b:=[op([]), c[nops(c)]];
%p for j from 1 to nops(c)-1 do b:=[op(b), c[j]]; od;
%p c:=b; t:=[op(t), c]; od; if n=permanent(t)
%p then print(n); fi; od; end: P(10^7);
%o (PARI) mpd(n) = {my(d = digits(n)); matpermanent(matrix(#d, #d, i, j, d[1+lift(Mod(j-i, #d))]));}
%o isok(n) = mpd(n) == n; \\ _Michel Marcus_, Mar 14 2019
%o (Python)
%o from sympy import Matrix
%o A306853_list = []
%o for n in range(1,10**6):
%o s = [int(d) for d in str(n)]
%o m = len(s)
%o if n == Matrix(m, m, lambda i, j: s[(i-j) % m]).per():
%o A306853_list.append(n) # _Chai Wah Wu_, Oct 18 2021
%Y Cf. A219324, A219327, A306662, A306593, A306714.
%Y Up to n=110 the permanent of the circulant matrix of the digits of n is equal to A101337 but from n=111 on it can differ.
%K nonn,base,more
%O 1,2
%A _Paolo P. Lava_, Mar 13 2019
%E a(15) from _Vaclav Kotesovec_, Aug 19 2021