A199593 Numbers n such that 3n-2, 3n-1 and 3n are all composite.
9, 12, 17, 19, 22, 26, 29, 31, 32, 39, 40, 41, 42, 45, 48, 49, 52, 54, 57, 59, 62, 63, 68, 69, 70, 72, 73, 74, 79, 82, 83, 85, 87, 89, 92, 96, 97, 99, 100, 101, 102, 107, 108, 109, 110, 112, 114, 115, 119, 121, 122, 124, 126, 129, 131, 132, 135, 136, 138, 139, 142, 143, 146, 149, 151, 152, 157, 158, 159, 161, 162, 165, 166, 169, 171, 172, 173, 176, 177, 178
Offset: 1
References
- Ernest V. Miliauskas, letter to N. J. A. Sloane, Dec 21 1985.
Links
- Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
- Bogart B. Strauss, Formula Explanation, pp. 1, 2, 3.
Programs
-
Magma
[n: n in [1..200] | not IsPrime(3*n) and not IsPrime(3*n-1) and not IsPrime(3*n-2)]; // Vincenzo Librandi, Apr 18 2015
-
Maple
remove(t -> isprime(3*t-1 - (t mod 2)),{$2..2000}); # Robert Israel, Apr 17 2015
-
Mathematica
Select[Range[200], Union[PrimeQ[{3# - 2, 3# - 1, 3#}]] == {False} &] (* Alonso del Arte, Jul 06 2013 *)
-
PARI
is(n)=!isprime(bitor(3*n-2,1)) && n>1 \\ Charles R Greathouse IV, Oct 27 2013 (Scheme, after Greathouse's PARI-program above, requiring also Antti Karttunen's IntSeq-library) (define A199593 (MATCHING-POS 1 2 (lambda (n) (not (prime? (A003986bi (+ n n n -2) 1)))))) ;; A003986bi implements binary inclusive or (A003986). ;; Antti Karttunen, Apr 17 2015
-
Python
from sympy import isprime def ok(n): return n > 0 and not any(isprime(3*n-i) for i in [2, 1, 0]) print([k for k in range(179) if ok(k)]) # Michael S. Branicky, Apr 16 2022
Formula
((1+(-1)^k)((-1)^n)(2n+3)+2k(6n+9+(-1)^n)+((-1)^k)+(12n^2)+36n+29)/4 n,k are all natural numbers and zero. - Bogart B. Strauss, Jul 10 2013
a(n) = n + 3n/log n + o(n/log n). - Charles R Greathouse IV, Oct 27 2013, corrected Aug 07 2016
Comments