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.

Showing 1-2 of 2 results.

A226196 Triangular numbers which are an average of four consecutive primes.

Original entry on oeis.org

15, 55, 105, 120, 253, 595, 1225, 1485, 2080, 2211, 3321, 4371, 5460, 6786, 7381, 7503, 10731, 11935, 12246, 16290, 18915, 24531, 24753, 27966, 36585, 44850, 51360, 55278, 55945, 56953, 60031, 64980, 68265, 69006, 70125, 75078, 86736, 87153, 92235, 94830, 98790, 111628
Offset: 1

Views

Author

Alex Ratushnyak, May 30 2013

Keywords

Crossrefs

Programs

  • Maple
    A000217inv:=proc(n)
        local t1;
        t1:=floor(sqrt(2*n));
        if n = t1*(t1+1)/2 then
            return t1 ;
        else
            return -1;
        end if;
    end proc:
    for n from 1 to 90000 do
        s := A034963(n)/4 ;
        if type(s, 'integer') then
            tr := A000217inv(s) ;
            if tr >= 0  then
                printf("%d, ", s) ;
            end if;
        end if;
    end do: # R. J. Mathar, Jun 06 2013
  • Mathematica
    Select[Mean/@Partition[Prime[Range[20000]],4,1],OddQ[Sqrt[8#+1]]&] (* Harvey P. Dale, Dec 18 2015 *)

Formula

a(n) = A000217(A226153(n)).

A226155 Smallest of four consecutive primes whose average is a triangular number.

Original entry on oeis.org

11, 47, 101, 109, 241, 587, 1217, 1481, 2069, 2203, 3313, 4357, 5443, 6779, 7351, 7489, 10723, 11927, 12239, 16267, 18911, 24517, 24733, 27953, 36571, 44839, 51347, 55249, 55931, 56941, 60017, 64951, 68239, 68993, 70117, 75041, 86719, 87133, 92227, 94819, 98773, 111611
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, p3, 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 (p3=2, p2=3, p1=5, i=7; i < TOP; i+=2)
        if ((c[i>>4] & (1<<((i>>1) & 7)))==0) {
          s = p3 + p2 + p1 + i;
          if (s%4==0) {
            s/=4;
            r = sqrt(s*2);
            if (r*(r+1)==s*2) printf("%llu, ", p3);
          }
          p3 = p2, p2 = p1, p1 = i;
        }
      return 0;
    }
  • Maple
    A000217inv:=proc(n) local t1; t1:=floor(sqrt(2*n)); if n = t1*(t1+1)/2 then return t1 ; else return -1; end if; end;
    isA226155 := proc(n)
        local p1,p2,p3,a102655 ;
        if isprime(n) then
            p1 := nextprime(n) ;
            p2 := nextprime(p1) ;
            p3 := nextprime(p2) ;
            a102655 := (n+p1+p2+p3)/4 ;
            if type(a102655,'integer') then
                if A000217inv(a102655) >= 0 then
                    return true;
                else
                    return false;
                end if;
            else
                return false;
            end if;
        else
            false;
        end if;
    end proc:
    for n from 1 do
        p := ithprime(n) ;
        if isA226155(p) then
            printf("%d,\n",p) ;
        end if;
    end do: # R. J. Mathar, Jun 06 2013
Showing 1-2 of 2 results.