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

A082077 Balanced primes of order two.

Original entry on oeis.org

79, 281, 349, 439, 643, 677, 787, 1171, 1733, 1811, 2141, 2347, 2389, 2767, 2791, 3323, 3329, 3529, 3929, 4157, 4349, 4751, 4799, 4919, 4951, 5003, 5189, 5323, 5347, 5521, 5857, 5861, 6287, 6337, 6473, 6967, 6997, 7507, 7933, 8233, 8377, 8429, 9377, 9623, 9629, 10093, 10333
Offset: 1

Views

Author

Labos Elemer, Apr 08 2003

Keywords

Comments

The arithmetic mean of 4 primes in its "neighborhood"; not to be confused with 'Doubly balanced primes' (A051795).
Balanced primes of order two are not necessarily balanced of order one (A006562) or three (A082078).
Subsequence of A219478, Peter Schorn, May 01 2025

Examples

			p = 79 = (71 + 73 + 79 + 83 + 89)/5 = 395/5 i.e. it is both the arithmetic mean and median.
		

Crossrefs

Programs

  • Mathematica
    Do[s3=Prime[n]+Prime[n+1]+Prime[n+2]; s5=Prime[n-1]+s3+Prime[n+3]; If[Equal[s5/5, Prime[n+1]], Print[Prime[n+1]]], {n, 3, 3000}]
    Select[Partition[Prime[Range[1500]],5,1],Mean[#]==#[[3]]&][[All,3]] (* Harvey P. Dale, Nov 04 2019 *)
  • PARI
    p=2;q=3;r=5;s=7;forprime(t=11,1e9,if(p+q+s+t==4*r,print1(r", ")); p=q; q=r; r=s; s=t) \\ Charles R Greathouse IV, Nov 20 2012

A219505 Numbers that are arithmetic mean of 5 successive primes.

Original entry on oeis.org

79, 281, 295, 329, 349, 355, 403, 439, 511, 643, 677, 685, 787, 805, 841, 887, 949, 963, 1171, 1179, 1195, 1241, 1327, 1339, 1397, 1435, 1463, 1503, 1547, 1641, 1685, 1717, 1733, 1779, 1811, 1917, 1957, 1991, 2033, 2061, 2141, 2147, 2347, 2389, 2395, 2433
Offset: 1

Views

Author

Zak Seidov, Nov 21 2012

Keywords

Examples

			a(1) = A219478(1) = 79 = (prime(20)+...+prime(24))/5 = (71+ 73+ 79+ 83+ 89)/5.
		

Crossrefs

A219478 is subsequence.

Programs

  • Mathematica
    Select[(Mean /@ Partition[Prime[Range[1000]], 5, 1]), IntegerQ]

A357133 a(n) is the least prime that is the arithmetic mean of n consecutive primes.

Original entry on oeis.org

5, 127, 79, 101, 17, 269, 491, 727, 53, 23, 71, 181, 29, 31, 37, 43, 563, 331, 883, 283, 173, 307, 157, 113, 353, 571, 347, 89, 263, 139, 179, 1201, 281, 1553, 137, 5167, 347, 563, 2083, 2087, 491, 1867, 353, 463, 1973, 199, 599, 4373, 149, 9929, 277, 463, 1259, 251, 397, 2897, 787, 263, 2161
Offset: 3

Views

Author

J. M. Bergot and Robert Israel, Sep 14 2022

Keywords

Examples

			a(5) = 79 because 79 is the average of the 5 consecutive primes 71, 73, 79, 83, 89, and 79 is the least prime that works.
		

Crossrefs

Programs

  • Maple
    P:= [seq(ithprime(i),i=1..10^5)]:
    S:= ListTools:-PartialSums(P):
    g:= proc(n) local k,r;
       for k from 1 to 10^5-n do
          r:= (S[k+n]-S[k])/n;
          if r::integer and isprime(r) then return r fi
       od;
       -1
    end proc:
    map(g, [$3..100]);
  • Mathematica
    a={}; n=3; For[k=1, k<=1200, k++, If[PrimeQ[p=Sum[Prime[k+i], {i,0,n-1}]/n], AppendTo[a,p]; n++; k=1]]; a (* Stefano Spezia, Sep 15 2022 *)
  • Python
    from itertools import islice
    from sympy import isprime, nextprime
    def agen():
        n, plst0 = 3, [2, 3, 5]
        while True:
            plst = plst0[:]
            while True:
                q, r = divmod(sum(plst), n)
                if r == 0 and isprime(q): yield q; break
                plst = plst[1:] + [nextprime(plst[-1])]
            plst0.append(nextprime(plst0[-1]))
            n += 1
    print(list(islice(agen(), 60))) # Michael S. Branicky, Sep 14 2022
Showing 1-3 of 3 results.