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

A214362 Arithmetic mean of next a(n) successive positive integers is prime.

Original entry on oeis.org

3, 3, 1, 7, 5, 7, 5, 11, 1, 7, 5, 7, 9, 3, 9, 11, 5, 3, 1, 7, 5, 23, 1, 19, 9, 11, 1, 3, 17, 23, 1, 7, 5, 7, 17, 7, 5, 11, 1, 19, 9, 3, 5, 23, 9, 3, 9, 7, 5, 7, 1, 11, 5, 3, 13, 7, 17, 7, 5, 11, 1, 7, 17, 7, 9, 11, 13, 27, 5, 7, 5, 11, 9, 3, 9, 7, 5, 3, 1, 23, 1
Offset: 1

Views

Author

Alex Ratushnyak, Jul 18 2012

Keywords

Comments

Corresponding primes: A062044(n).
All terms are odd. - Robert Israel, Jan 17 2017

Examples

			(1+2+3)/3 = 2 is prime, so a(1)=3,
then (4+5+6)/3 = 5 is prime, so a(2)=3,
then 7/1 = 7 is prime, so a(3)=1,
then (8+9+10+11+12+13+14)/7 = 11 is prime, so a(4)=7.
		

Crossrefs

Programs

  • Maple
    t:= 1:
    for n from 1 to 100 do
      for s from 1 by 2 do
        if isprime((2*t + s - 1)/2) then
          A[n]:= s; t:= t+s; break
        fi
    od od:
    seq(A[n],n=1..100); # Robert Israel, Jan 17 2017
  • PARI
    firstTerms(n)={
    my(k=1,j=1,x,y,a=vector(n));
    while(j<=n,x=0;while(!isprime(k+x),x++);y=2*x+1;k+=y;a[j]=y;j++);
    return(a)} \\ R. J. Cano, Jan 17 2017

Formula

a(n) = 2*(A062042(n)-A062042(n-1))+(-1)^n for n >= 2. - Robert Israel, Jan 17 2017
Showing 1-1 of 1 results.