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.

A199593 Numbers n such that 3n-2, 3n-1 and 3n are all composite.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Nov 08 2011

Keywords

Comments

From Antti Karttunen, Apr 17 2015: (Start)
Other, equivalent definitions:
Numbers n such that A007310(n) is composite, from which it follows that the function c(1) = 0, c(n) = 1-A075743(n-1) is the characteristic function of this sequence.
Numbers n such that A084967(n) has at least three prime factors (when counted with bigomega, A001222).
Numbers n such that A249823(n) is composite.
(End)
There are n - pi(3n) + 1 terms in this sequence up to n; with an efficient algorithm for pi(x) this allows isolated large values to be computed. Using David Baugh and Kim Walisch's calculation that pi(10^27) = 16352460426841680446427399 one can see that a(316980872906491652886905934) = 333333333333333333333333333 (since 999999999999999999999999997 is composite). - Charles R Greathouse IV, Sep 13 2016

References

Crossrefs

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