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.

A319506 Number of numbers of the form 2*p or 3*p between consecutive triangular numbers T(n - 1) < {2,3}*p <= T(n) with p prime.

Original entry on oeis.org

0, 0, 2, 2, 2, 1, 2, 2, 2, 2, 3, 2, 3, 2, 3, 4, 3, 3, 3, 4, 5, 2, 4, 3, 5, 5, 2, 6, 3, 5, 5, 5, 5, 6, 4, 3, 7, 5, 6, 6, 5, 6, 7, 4, 5, 6, 6, 7, 6, 7, 9, 6, 6, 7, 8, 5, 6, 7, 9, 7, 7, 8, 7, 11, 7, 8, 8, 7, 6, 11, 5, 12, 7, 7, 7, 11, 11, 7, 12, 10, 9, 10, 7, 9, 9, 8, 10, 12, 10, 7, 10, 9, 12, 9, 11, 10, 13, 14, 10, 7
Offset: 1

Views

Author

Ralf Steiner, Sep 21 2018

Keywords

Comments

1) It is conjectured that for k >= 1 each left-sided half-open interval (T(2*k - 1), T(2*k + 1)] and (T(2*k), T(2*(k + 1))] contains at least one composite c_2 = 2*p_i and c_3 = 3*p_j each, p_i, p_j prime, i != j.
2) It is conjectured that for k >= 3 each left-sided half-open interval (T(k - 1), T(k)] contains at least one composite c_2 = 2*p_i or c_3 = 3*p_j, p_i, p_j prime, i != j.
3) It is conjectured that for k >= 2 each left-sided half-open interval (T(2*k - 1), T(2*k)] contains at least one composite c_3 = 3*p_j, p_j prime.
4) It is conjectured that for k >= 1 each left-sided half-open interval (T(2*k), T(2*k + 1)] contains at least one composite c_2 = 2*p_i, p_i prime.

Examples

			a(3) = 2 since (T(3 - 1),T(3)] = {4 = 2*2,5,6 = 2*3 = 3*2}, 2,3 prime.
		

Crossrefs

Cf. A000040 (primes), A000217 (triangular numbers).

Programs

  • Mathematica
    Table[Count[
      Select[Range[(n - 1) n/2 + 1, n (n + 1)/2],
       PrimeQ[#/2] || PrimeQ[#/3] &], _Integer], {n, 1, 100}]
    p23[{a_,b_}]:=Module[{r=Range[a+1,b]},Count[Union[Join[r/2,r/3]], ?PrimeQ]]; p23/@Partition[Accumulate[Range[0,100]],2,1] (* _Harvey P. Dale, May 02 2020 *)
  • PARI
    isok1(n, k) = ((n%k) == 0) && isprime(n/k);
    isok2(n) = isok1(n,2) || isok1(n,3);
    t(n) = n*(n+1)/2;
    a(n) = sum(i=t(n-1)+1, t(n), isok2(i)); \\ Michel Marcus, Oct 12 2018