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-3 of 3 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

A321855 Number of permutations f of {1,...,n} such that prime(k)*prime(f(k)) - 2 is prime for every k = 1,...,n.

Original entry on oeis.org

1, 1, 2, 3, 5, 12, 2, 3, 65, 248, 448, 1792, 4288, 6468, 27068, 29752, 106066, 447982, 1250762, 6304196, 46613084, 126391780, 504582496, 2270372946, 3028652541, 8941959118, 36442298864, 175008626450, 318369805106, 1974700703920, 6654020288821, 48819526290634, 150577775767875, 574885284627624, 3058310882340228, 15949743649457780
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 19 2018

Keywords

Comments

Conjecture: a(n) > 0 for all n > 0. Moreover, for each n > 0, there is an even permutation f of {1,...,n} with prime(k)*prime(f(k)) - 2 prime for all k = 1,...,n. Also, for any integer n > 2, there is an odd permutation f of {1,...,n} with prime(k)*prime(f(k)) - 2 prime for all k = 1,...,n.
If we let b(n) denote the number of even permutations f of {1,...,n} with prime(k)*prime(f(k)) - 2 prime for all k = 1,...,n, then (b(1),...,b(11)) = (1,1,1,1,3,6,1,1,33,125,226).
In 1973 J.-R. Chen proved that there are infinitely many primes p with p + 2 a product of at most two primes, such primes p are now called Chen primes.

Examples

			a(7) = 2. The only even permutation of {1,...,7} meeting the requirement is (1,5,7,4,2,6,3) with prime(1)*prime(1) - 2 = 2, prime(2)*prime(5) - 2 = 31, prime(3)*prime(7) - 2 = 83, prime(4)*prime(4) - 2 = 47, prime(5)*prime(2) - 2 = 31, prime(6)*prime(6) - 2 = 167 and prime(7)*prime(3) - 2 = 83 all prime. Also, the only odd permutation of {1,...,7} meeting the requirement is (1,5,7,6,2,4,3) with prime(1)*prime(1) - 2 = 2, prime(2)*prime(5) - 2 = 31, prime(3)*prime(7) - 2 = 83, prime(4)*prime(6) - 2 = 89, prime(5)*prime(2) - 2 = 31, prime(6)*prime(4) - 2 = 89 and prime(7)*prime(3) - 2 = 83 all prime.
		

Crossrefs

Programs

  • Mathematica
    Permanent[m_List]:=With[{v = Array[x, Length[m]]},Coefficient[Times @@ (m.v), Times @@ v]];
    a[n_]:=a[n]=Permanent[Table[Boole[PrimeQ[Prime[i]*Prime[j]-2]],{i,1,n},{j,1,n}]];
    Do[Print[n," ",a[n]],{n,1,27}]
  • PARI
    a(n) = matpermanent(matrix(n, n, i, j, ispseudoprime(prime(i)*prime(j) - 2))); \\ Jinyuan Wang, Jun 13 2020

Extensions

a(28)-a(29) from Jinyuan Wang, Jun 13 2020
a(30)-a(36) from Vaclav Kotesovec, Aug 20 2021

A321766 Number of permutations f of {1,...,n} such that 3^k + 3^(f(k)) - 1 is prime for every k = 1,...,n.

Original entry on oeis.org

1, 2, 3, 11, 14, 33, 59, 290, 843, 690, 231, 978, 2896, 2966, 38252, 384917, 22351, 68546, 28245, 147459, 84578, 17647, 17647, 232213, 17647, 792, 93640, 785178, 5635699, 11658279, 67706584, 351837312, 233636388, 26967286, 35027435, 242576452
Offset: 1

Views

Author

Zhi-Wei Sun, Nov 18 2018

Keywords

Comments

Clearly, a(n) is the permanent of the matrix of order n whose (i,j)-entry is 1 or 0 according as 3^i + 3^j - 1 is prime or not.
Although the first 30 terms are positive, we have a(154) = 0 since it is easy to verify that 3^154 + 3^k - 1 is composite for every k = 1..154.
From Robert Israel, Dec 08 2019: (Start)
In fact 3^154 + 3^k - 1 is composite for k = 1..383, so a(n)=0 for 154 <= n <= 383.
Conjecture: for each n >= 154 there is m <= n such that 3^m + 3^k - 1 is composite for k = 1..n. This implies that a(n) = 0 for such n.
Conjecture verified for 154 <= n <= 2635. (End)
If we let b(n) denote the number of even permutations g of {1,...,n} with 3^k + 3^(g(k)) - 1 prime for all k = 1,...,n, then the values of b(1),b(2),...,b(11) are 1, 1, 1, 6, 8, 17, 30, 144, 422, 353, 111 respectively.
In the linked 2017 paper (see Conjecture 3.26), the author conjectured that for any integer a > 1 there are infinitely many primes of the form a^(2k) + a^m - 1 with k and m positive integers.

Examples

			a(2) = 2 since both (1,2) and (2,1) are permutations of {1,2}, and 3^1 + 3^1 - 1 = 5, 3^2 + 3^2 - 1 = 17, 3^1 + 3^2 - 1 = 11 and 3^2 + 3^1 - 1 = 11 are all prime.
		

Crossrefs

Programs

  • Maple
    N:= 25: # to get a(1)..a(N)
    q:= proc(i,j)  if isprime(3^i+3^j-1) then 1 else 0 fi end proc:
    M:= Matrix(N,N, q, shape=symmetric):
    seq(LinearAlgebra:-Permanent(M[1..n,1..n]), n=1..N); # Robert Israel, Dec 08 2019
  • Mathematica
    a[n_]:=a[n]=Permanent[Table[Boole[PrimeQ[3^i+3^j-1]],{i,1,n},{j,1,n}]];
    Do[Print[n," ",a[n]],{n,1,30}]
  • PARI
    a(n) = matpermanent(matrix(n, n, i, j, ispseudoprime(3^i + 3^j - 1))); \\ Jinyuan Wang, Jun 13 2020

Extensions

a(31) from Jinyuan Wang, Jun 13 2020
a(32)-a(36) from Vaclav Kotesovec, Aug 18 2021
Showing 1-3 of 3 results.