A321805 Number of permutations f of {1,...,n} such that k!*f(k) + 1 is prime for every k from 1 to n.
1, 2, 4, 6, 10, 10, 13, 40, 212, 702, 3531, 19008, 34858, 39764, 102312, 47927, 94860, 232006, 658766, 829583, 1547703, 2040211, 32073218, 51347260, 496226762, 1504307318, 16663026685, 125080784519, 241032642271, 1216752358950, 2147004248698, 9320087810948, 19383919945950, 16259146126113, 81023699301023, 124167501991213
Offset: 1
Examples
a(2) = 2 since (1,2) and (2,1) are permutations of {1,2} with 1!*1 + 1 = 2, 2!*2 + 1 = 5, 1!*2 + 1 = 3 and 2!*1 + 1 = 3 all prime.
Programs
-
Mathematica
a[n_]:=a[n]=Permanent[Table[Boole[PrimeQ[i!*j+1]],{i,1,n},{j,1,n}]]; Do[Print[n," ",a[n]],{n,1,27}]
-
PARI
a(n)={matpermanent(matrix(n, n, i, j, isprime(i!*j+1)))} \\ Andrew Howroyd, Nov 19 2018
Extensions
a(28)-a(31) from Jinyuan Wang, Jun 13 2020
a(32)-a(36) from Vaclav Kotesovec, Aug 19 2021
Comments