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-8 of 8 results.

A075540 Integers that are the average of three successive primes.

Original entry on oeis.org

5, 53, 157, 173, 211, 257, 263, 373, 511, 537, 563, 593, 607, 653, 733, 947, 977, 999, 1073, 1103, 1123, 1187, 1223, 1239, 1367, 1461, 1501, 1511, 1541, 1747, 1753, 1763, 1773, 1899, 1907, 1917, 2071, 2181, 2287, 2401, 2409, 2417, 2449, 2677, 2903, 2963
Offset: 1

Views

Author

Zak Seidov, Sep 21 2002

Keywords

Comments

Not every three successive primes have an integer average. The integer averages are in the sequence.
Not all of these 3-averages are prime: the prime 3-averages are in A006562 (balanced primes). There are surprisingly many prime 3-averages: among the first 10000 terms of the sequence there are 2417 primes. Indices i(n) of first prime in sequence of three primes with integer average are in A075541, for prime 3-averages i(n) are in A064113. Interprimes (s-averages with s=2) are all composite, see A024675. (Edited by Zak Seidov, Sep 01 2015 )

Examples

			a(1) = 5 = (1/3)(3+5+7), first integer average of three successive primes; next is: a(2) = 53 = (1/3)(47 + 53 + 59); up to n=8 all terms are prime; while a(9) = 511 = (1/3)( 503 + 509 + 521) is the first nonprime 3-average: 511=7*73.
		

Crossrefs

Programs

  • Haskell
    a075540 n = a075540_list !! (n-1)
    a075540_list = map fst $ filter ((== 0) . snd) $
       zipWith3 (\x y z -> divMod (x + y + z) 3)
                a000040_list (tail a000040_list) (drop 2 a000040_list)
    -- Reinhard Zumkeller, Jan 20 2012
  • Maple
    N:= 10^4: # to get all terms using primes <= N
    Primes:= select(isprime,[2,seq(2*i+1, i=1..(N-1)/2)]):
    select(type,(Primes[1..-3] + Primes[2..-2] + Primes[3..-1])/3,integer); # Robert Israel, Sep 01 2015
  • Mathematica
    Select[MovingAverage[Prime[Range[500]],3],IntegerQ] (* Harvey P. Dale, Aug 10 2012 *)

Formula

a(n) = (1/3) (p(i)+p(i+1)+p(i+2)), for some i(n).

Extensions

Comment and example edited, inefficient Mma removed by Zak Seidov, Sep 01 2015

A123086 Numbers which are the arithmetic mean of 1000000 consecutive primes.

Original entry on oeis.org

11860710, 19524458, 30466003, 57980974, 63924288, 90876871, 98124660, 100711080, 107813124, 130902871, 130920140, 133345096, 137765645, 149928192, 187600902, 214934436, 223349020, 235566127, 238768532, 239934902, 264189816, 270196572, 278851320, 285021997
Offset: 1

Views

Author

Zak Seidov, Sep 27 2006

Keywords

Comments

Corresponding indices of the first primes are: 275775, 740092, 1383476, 2948575, 3280201, 4764532, 5159226, 5299723, 5684491, 6926061, 6926985, 7056669, 7292768, 7940227, 9929283, 11358606, 11796712, 12431386, 12597486, 12657959, 13911879, 14221421, 14666768, 14983910, 15100050.

Examples

			11860710 is in the sequence since (p(275775) + p(275776) + ... + p(275775+999998) + p(275775+999999)) / 1000000 = 11860710 where p(n) is the n-th prime.
		

Crossrefs

Cf. A102655 (arithmetic mean of four successive primes).
Cf. A122040 (arithmetic mean of six successive primes).
Cf. A122480 (arithmetic mean of k consecutive primes).
Cf. A122808 (arithmetic mean of n, but no fewer, consecutive primes).

Programs

  • Mathematica
    Timing[s = 7472966967499 ; a = 2; b = 15485863; Do[s = s - a + (b = NextPrime[b]); a = NextPrime[a]; If[Mod[s, 10^6] < 1, Print[s/10^6]], {10^8}]]
  • PARI
    {s = 7472966967499 ; a = 2; b = 15485863; for (k = 1, 10^9,
    if(s%10^6 < 1, print( s/10^6)); b = nextprime (b + 2);
    s = s - a + b; a = nextprime (a + 1))}

A226153 Numbers n such that triangular(n) is an average of 4 consecutive primes.

Original entry on oeis.org

5, 10, 14, 15, 22, 34, 49, 54, 64, 66, 81, 93, 104, 116, 121, 122, 146, 154, 156, 180, 194, 221, 222, 236, 270, 299, 320, 332, 334, 337, 346, 360, 369, 371, 374, 387, 416, 417, 429, 435, 444, 472, 492, 498, 511, 520, 551, 556, 617, 622, 637, 654, 657, 670, 674, 677, 680
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, ", r);
          }
          p3 = p2, p2 = p1, p1 = i;
        }
      return 0;
    }
  • Maple
    A034963 := proc(n)
        add(ithprime(i), i=n..n+3) ;
    end proc:
    istriangular:=proc(n) local t1; t1:=floor(sqrt(2*n)); if n = t1*(t1+1)/2 then return t1 ; else return -1; end if; end;
    for n from 1 to 90000 do
        s := A034963(n)/4 ;
        if type(s,'integer') then
        tr := istriangular(s) ;
        if tr >= 0  then
            printf("%d, ", tr) ;
        end if;
        end if;
    end do: # R. J. Mathar, Jun 06 2013
  • Mathematica
    Module[{nn=30000,ntrs,m},ntrs=Table[{n,(n(n+1))/2},{n,nn}];m=Mean/@Partition[Prime[ Range[ nn]],4,1];Select[ntrs,MemberQ[m,#[[2]]]&]][[;;,1]] (* Harvey P. Dale, Jun 08 2023 *)
    (Sqrt[8#+1]-1)/2&/@Select[Mean/@Partition[Prime[Range[25000]],4,1],OddQ[Sqrt[8#+1]]&] (* Harvey P. Dale, Sep 17 2024 *)

A123078 Integers that are the arithmetic mean of 1000 consecutive primes.

Original entry on oeis.org

10820, 15682, 19672, 23340, 25067, 33873, 37387, 39377, 47782, 59635, 75249, 82619, 86378, 87303, 89198, 92217, 97495, 111989, 131987, 133441, 162286, 164644, 178666, 181532, 182196, 200088, 203450, 215280, 215612, 218527, 221526, 229733
Offset: 1

Views

Author

Zak Seidov, Sep 27 2006

Keywords

Comments

Corresponding indices of the first primes are: 812, 1323, 1731, 2097, 2268, 3121, 3456, 3645, 4428, 5518, 6914, 7569, 7899, 7980, 8146, 8412, 8875, ... .

Examples

			(p(812)+p(813)+...+p(812+998)+p(812+999))/1000=10820, p(n)=n-th prime.
		

Crossrefs

Programs

  • Mathematica
    Select[Table[Sum[Prime[k], {k, n, n + 999}]/1000, {n, 50000}], IntegerQ] (* Elizabeth A. Blickley (Elizabeth.Blickley(AT)gmail.com), Oct 10 2006 *)
    Select[Mean/@Partition[Prime[Range[25000]],1000,1],IntegerQ] (* Harvey P. Dale, Jul 27 2022 *)

Formula

Conjecture: a(n) ~ 1000 n log n. - Charles R Greathouse IV, Oct 23 2012

Extensions

More terms from Elizabeth A. Blickley (Elizabeth.Blickley(AT)gmail.com), Oct 10 2006

A126096 Primes that are the arithmetic mean of four successive primes.

Original entry on oeis.org

127, 139, 149, 181, 241, 431, 967, 1021, 1031, 1061, 1597, 1759, 1913, 2113, 2437, 2593, 2833, 2953, 3769, 3793, 3947, 4219, 4261, 4463, 4603, 5011, 5869, 5923, 6449, 6701, 6959, 7103, 7489, 7549, 7727, 8273, 8803, 8839, 9137, 9241, 9421, 9931, 10069
Offset: 1

Views

Author

Zak Seidov, Mar 03 2007

Keywords

Examples

			181 is in the sequence because it is prime and is the arithmetic mean of the consecutive primes 173, 179, 181 and 191.
		

Crossrefs

Cf. A102655 (numbers that are the arithmetic mean of four successive primes).

Programs

  • Maple
    a:=proc(n) local nn: nn:=(ithprime(n)+ithprime(n+1)+ithprime(n+2)+ithprime(n+3))/4: if type(nn,integer)=true and isprime(nn)=true then nn else fi end: seq(a(n),n=1..1300); # Emeric Deutsch, Mar 07 2007
  • Mathematica
    lst={};Do[If[PrimeQ[p=(Prime[n]+Prime[n+1]+Prime[n+2]+Prime[n+3])/4],AppendTo[lst,p]],{n,8!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 28 2009 *)
    pr=Prime[Range[114000(* for first 3015 terms *)]];
    Select[Mean/@Partition[pr,4,1],PrimeQ] (* Zak Seidov, Apr 22 2011 *)

Extensions

More terms from Emeric Deutsch, Mar 07 2007

A122037 Largest prime factor of number equal to the arithmetic mean of four successive primes.

Original entry on oeis.org

3, 3, 5, 3, 11, 5, 19, 7, 23, 11, 5, 17, 3, 29, 17, 7, 3, 19, 5, 127, 139, 3, 149, 31, 11, 7, 181, 31, 13, 5, 43, 19, 29, 241, 19, 23, 13, 53, 5, 139, 97, 17, 13, 53, 37, 31, 11, 17, 11, 127, 43, 19, 7, 71, 431, 7, 149, 11, 79, 37, 163, 11, 127, 257, 41, 271, 23, 43, 113, 19, 3
Offset: 1

Views

Author

Giovanni Teofilatto, Sep 14 2006

Keywords

Crossrefs

Programs

  • Mathematica
    FactorInteger[ # ][[ -1, 1]] & /@ Select[Table[Sum[Prime[k], {k, n, n + 3}]/4, {n, 120}], IntegerQ] (* Ray Chandler, Sep 25 2006 *)
    FactorInteger[#][[-1,1]]&/@Select[Mean/@Partition[Prime[Range[ 200]], 4,1], IntegerQ] (* Harvey P. Dale, May 21 2014 *)

Formula

a(n) = A006530(A102655(n)).

Extensions

Extended by Ray Chandler, Sep 25 2006

A226152 Numbers n such that n^2 is an average of 4 consecutive primes.

Original entry on oeis.org

3, 9, 12, 21, 24, 35, 72, 126, 129, 179, 189, 194, 198, 214, 243, 253, 255, 279, 304, 322, 432, 443, 480, 487, 511, 523, 663, 681, 696, 699, 711, 717, 721, 734, 738, 796, 802, 838, 910, 975, 1008, 1034, 1070, 1144, 1215, 1230, 1237, 1265, 1276, 1370, 1375, 1386, 1469
Offset: 1

Views

Author

Alex Ratushnyak, May 28 2013

Keywords

Comments

Integers of the form sqrt(A102655(k)) for any k. - R. J. Mathar, Jun 06 2013

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);
            if (r*r==s) printf("%llu, ", r);
          }
          p3 = p2, p2 = p1, p1 = i;
        }
      return 0;
    }
  • Maple
    A034963 := proc(n)
        add(ithprime(i), i=n..n+3) ;
    end proc:
    for n from 1 to 90000 do
        s := A034963(n)/4 ;
        if type(s,'integer') then
        if issqr(s) then
            printf("%d, ", sqrt(s)) ;
        end if;
        end if;
    end do: # R. J. Mathar, Jun 06 2013

Formula

a(n) = A051395(n)/2.

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-8 of 8 results.