A109132 Numbers n such that n! + 1 is a Chen prime. n! + 1 is then called a factorial Chen prime.
0, 1, 2, 3, 11, 77
Offset: 1
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.
(* After loading the NumberTheory package *) SemiPrimeQ[n_] := (f = FactorIntegerECM[n]; PrimeQ[f] && PrimeQ[n/f]); ShenPrimeQ[n_] := (PrimeQ[n] && (PrimeQ[n + 2] || SemiPrimeQ[n + 2])); Do[k = 1; While[ !ShenPrimeQ[n^n + k], k++ ]; Print[k], {n, 100}] (* Ryan Propper, Sep 27 2006 *)
2*2-1 = 3, (2*2-1)^2-2 = 7, 3 and 7 are primes, so a(1) = 2. 11*2*3*5*7-1 = 2309, (11*2*3*5*7-1)^2-2 = 5331479, 2309 and 5331479 are primes, so a(4) = 11.
chenQ[n_] := PrimeQ[n] && PrimeOmega[n+2] <= 2; a[n_] := Module[{p = Product[Prime[i], {i, 1, n}], k = 0}, While[!PrimeQ[k*p - 1] || !chenQ[(k*p-1)^2-2], k++]; k]; Array[a, 60] (* Amiram Eldar, Sep 11 2021 *)
isok(k, q) = if (isprime(k*q-1), my(c=(k*q-1)^2-2); (isprime(c) && (bigomega(c+2)<=2))); a(n) = my(k=1, q=prod(i=1, n, prime(i))); while (!isok(k, q), k++); k; \\ Michel Marcus, Sep 11 2021
a(5) = 43 + 61 + 73 + 79 + 97 = 353, which happens to be the Chen prime A109611(52).
a(1) = 1849 = A102540(1)*A102540(1) = 43*43. a(2) = 2623 = A102540(1)*A102540(2) = 43*61. a(36) = 14701 = A102540(2)*A102540(13) = 61 * 241.
(3, 5) are twin numbers and also Chen numbers.
ischenprime:=proc(n); if (isprime(n) = 'true') then if (isprime(n+2) = 'true' or numtheory[bigomega](n+2) = 2) then RETURN('true') else RETURN('false') fi fi end: ts_chen_twin_primes:=proc(n) local i, ans; ans:=[ ]: for i from 1 to n do if (ischenprime(i) = 'true') and (isprime(i+2) = 'true' or isprime(i-2) = 'true') then ans:=[op(ans), i]: fi od; RETURN(ans) end: ts_chen_twin_primes(1230);
Select[Prime[Range[250]],PrimeOmega[#+2]<3&&AnyTrue[#+{2,-2},PrimeQ]&] (* Harvey P. Dale, Jul 28 2023 *)
ischenprime:=proc(n); if (isprime(n) = 'true') then if (isprime(n+2) = 'true' or numtheory[bigomega](n+2) = 2) then RETURN('true') else RETURN('false') fi fi end: ts_prime_fibonacci_chen:=proc(n) local i, tren, ans; ans:= [ ]: for i from 0 to n do tren := combinat[fibonacci](i): if (isprime( tren ) = 'true' and ischenprime(tren) = 'true') then ans:=[op(ans), tren]: fi od; RETURN(ans) end: ts_prime_fibonacci_chen(300); # Jani Melik, May 05 2006
Comments