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.

Previous Showing 11-12 of 12 results.

A226147 Numbers n such that triangular(n) is an average of three successive primes.

Original entry on oeis.org

193, 233, 265, 301, 526, 709, 753, 922, 961, 962, 986, 1126, 1178, 1285, 1373, 1485, 1525, 1537, 1558, 1601, 1710, 1737, 1962, 1965, 2202, 2437, 2466, 2578, 2685, 2693, 2862, 3206, 3346, 3462, 3622, 3682, 3937, 3938, 3965, 4005, 4017, 4018, 4058, 4393, 4489, 4498, 4717
Offset: 1

Views

Author

Alex Ratushnyak, May 28 2013

Keywords

Crossrefs

Programs

  • C
    #include 
    #include 
    #include 
    #define TOP (1ULL<<30)
    int main() {
      unsigned long long i, j, p1, p2, r, s;
      unsigned char *c = (unsigned char *)malloc(TOP/8);
      memset(c, 0, TOP/8);
      for (i=3; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0 /*&& i<(1ULL<<32)*/)
            for (j=i*i>>1; j>3] |= 1 << (j&7);
      for (p2=2, p1=3, i=5; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          s = p2 + p1 + i;
          if ((s%3)==0) {
            s/=3;
            r = sqrt(s*2);
            if (r*(r+1)==s*2) printf("%llu, ", r);
          }
          p2 = p1, p1 = i;
        }
      return 0;
    }

A309594 Smallest members of prime triples, the sum of which results in a perfect square.

Original entry on oeis.org

13, 37, 277, 613, 12157, 14557, 23053, 55213, 81013, 203317, 331333, 393853, 824773, 867253, 1008037, 2038573, 3026053, 3322213, 5198197, 5497237, 5793517, 5984053, 9107173, 17246413, 20850757, 20871853, 21327997, 25363573, 25678573, 27258613, 29134597, 30153037, 33313333
Offset: 1

Views

Author

Philip Mizzi, Aug 09 2019

Keywords

Comments

A prime triple is a set of three prime numbers of the form (p, p+2, p+6) or (p, p+4, p+6).
The smallest prime of the first form of these triples is not part of this sequence because p + (p+2) + (p+6) = 3p +8 and a number of this form is never a square.
PROOF:
From Bernard Schott, Aug 09 2019: (Start)
If a == 0 (mod 3) ==> a^2 == 0 (mod 3),
If a == 1 (mod 3) ==> a^2 == 1 (mod 3),
If a == 2 (mod 3) ==> a^2 == 4 == 1 (mod 3).
Hence, a square is always == 0 or == 1 (mod 3)
As p + (p+2) + (p+6) = 3*p+8, and 3*p+8 == 2 (mod 3), there is no prime triple of the form (p, p+2, p+6) whose sum 3*p + 8 can be a square. (End)

Examples

			Let p = 277 (prime), q = p+4 = 281 (prime), r = p+6 = 283 (prime). We now have a prime triple. p+q+r = 841 = 29^2, a perfect square.
		

Crossrefs

Cf. A130621.
Intersection of A022005 and A206279.

Programs

  • Maple
    Res:= NULL: count:= 0:
    for k from 0 while count < 100 do
      for x in [6*k+1,6*k+5] do
        p:= (x^2-10)/3;
        if isprime(p) and isprime(p+4) and isprime(p+6) then
          count:= count+1;
          Res:= Res, p
        fi
    od od:
    Res; # Robert Israel, Aug 13 2019
  • Mathematica
    ok[p_] := If[AllTrue[{p, p+4, p+6}, PrimeQ], Sow@p]; Reap[Do[ok[3 y^2 + 2 y - 3]; ok[3 y^2 + 4 y - 2], {y, 4000}]][[2, 1]] (* Giovanni Resta, Aug 09 2019 *)
  • PARI
    issq(p) = issquare(3*p+10);
    istriple(p) = isprime(p+4) && isprime(p+6);
    isok(p) = isprime(p) && istriple(p) && issq(p); \\ Michel Marcus, Aug 10 2019

Extensions

More terms from Michel Marcus, Aug 09 2019
Previous Showing 11-12 of 12 results.