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.

A122040 Numbers which are equal to the arithmetic mean of six successive primes.

Original entry on oeis.org

12, 15, 22, 26, 30, 34, 38, 42, 55, 64, 77, 82, 87, 92, 101, 105, 110, 115, 126, 139, 144, 160, 165, 170, 190, 227, 232, 274, 279, 292, 298, 304, 312, 326, 339, 346, 352, 358, 369, 375, 387, 393, 406, 413, 419, 431, 436, 442, 447, 452, 469, 481, 516, 524, 533
Offset: 1

Views

Author

Giovanni Teofilatto, Sep 14 2006

Keywords

Examples

			a(1) = 12 because (5+7+11+13+17+19)/6 = 12;
a(2) = 15 because (7+11+13+17+19+23)/6 = 15.
		

Crossrefs

Cf. A122531.

Programs

  • Mathematica
    Select[Table[Sum[Prime[k], {k, n, n + 5}]/6, {n, 100}], IntegerQ] (* Ray Chandler, Sep 25 2006 *)
    Select[Mean/@Partition[Prime[Range[200]],6,1],IntegerQ]  (* Harvey P. Dale, Apr 01 2011 *)

Extensions

Extended by Ray Chandler, Sep 25 2006

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