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.

A361085 Least prime p > prime(n) such that at least one of p * prime(n)# +- 1 is not squarefree, where prime(n)# is the n-th primorial A002110(n).

Original entry on oeis.org

3, 5, 29, 31, 139, 167, 43, 127, 211, 41, 607, 1223, 71, 769, 1549, 947, 269, 1129, 163, 577, 673, 107, 4057, 1979, 433, 3833, 4177, 383, 1723, 409, 2399, 4517, 3803, 3061, 3299, 457, 3779, 971, 5749, 2843, 13709
Offset: 0

Views

Author

M. F. Hasler, Mar 28 2023

Keywords

Comments

It appears that a product P of distinct primes rarely has the property that P +- 1 has a square factor, and this is even more rare when P has all of the first n primes as factor. This sequence is one possible way to quantify this observation. (One could also display the gap between a(n) and prime(n), or consider b(n) the least product of distinct primes > prime(n) that yields a product with the desired property.)
See also Zumkeller's contested comment in A007018 and the discussion in the linked MathOverflow page.

Examples

			a(0) = 3 because for P = (product of the first 0 primes) = 1, p = 3 is the least prime such that p*P + 1 = 4 = 2^2 is a square; for p = 2 neither p*P - 1 = 1 nor p*P + 1 = 3 has a nontrivial square factor.
a(1) = 5 because for P = (product of the first prime) = 2, p = 5 is the least prime such that p*P - 1 = 9 = 3^2 is a square; for p = 3 none of p*P - 1 = 5 nor p*P + 1 = 7 has a nontrivial square factor.
a(2) = 29 because for P = (product of the first two primes) = 6, p = 29 is the least prime such that p*P + 1 = 5^2*7 has a square factor; for all primes 3 < p < 29 both of p*P +- 1 are squarefree.
		

Crossrefs

Cf. A002110 (factorials), A013929 (numbers that are not squarefree), A007018, A228649 (both related).

Programs

  • Mathematica
    Map[(k = 1; While[AllTrue[Prime[k] # + {-1, 1}, SquareFreeQ], k++]; Prime[k]) &, FoldList[Times, 1, Prime@ Range[24] ] ] (* Michael De Vlieger, Mar 28 2023 *)
  • PARI
    A361085(n, P=vecprod(primes(n)))=forprime(p=prime(n)+1,,(issquarefree(p*P-1)&&issquarefree(p*P+1))||return(p))

Extensions

a(30) from Michael S. Branicky, Mar 29 2023
a(31)-a(40) from Jinyuan Wang, Mar 30 2023