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.

Showing 1-1 of 1 results.

A321805 Number of permutations f of {1,...,n} such that k!*f(k) + 1 is prime for every k from 1 to n.

Original entry on oeis.org

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

Views

Author

Zhi-Wei Sun, Nov 19 2018

Keywords

Comments

Though the first 27 terms are positive, we have a(50) = 0 since all the numbers 50!*k + 1, with k = 1..50, are composite.

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.
		

Crossrefs

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
Showing 1-1 of 1 results.