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.

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

This page as a plain text file.
%I A214362 #16 Jan 17 2017 22:28:01
%S A214362 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,
%T A214362 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,
%U A214362 7,17,7,9,11,13,27,5,7,5,11,9,3,9,7,5,3,1,23,1
%N A214362 Arithmetic mean of next a(n) successive positive integers is prime.
%C A214362 Corresponding primes: A062044(n).
%C A214362 All terms are odd. - _Robert Israel_, Jan 17 2017
%H A214362 Robert Israel, <a href="/A214362/b214362.txt">Table of n, a(n) for n = 1..10000</a>
%F A214362 a(n) = 2*(A062042(n)-A062042(n-1))+(-1)^n for n >= 2. - _Robert Israel_, Jan 17 2017
%e A214362 (1+2+3)/3 = 2 is prime, so a(1)=3,
%e A214362 then (4+5+6)/3 = 5 is prime, so a(2)=3,
%e A214362 then 7/1 = 7 is prime, so a(3)=1,
%e A214362 then (8+9+10+11+12+13+14)/7 = 11 is prime, so a(4)=7.
%p A214362 t:= 1:
%p A214362 for n from 1 to 100 do
%p A214362   for s from 1 by 2 do
%p A214362     if isprime((2*t + s - 1)/2) then
%p A214362       A[n]:= s; t:= t+s; break
%p A214362     fi
%p A214362 od od:
%p A214362 seq(A[n],n=1..100); # _Robert Israel_, Jan 17 2017
%o A214362 (PARI) firstTerms(n)={
%o A214362 my(k=1,j=1,x,y,a=vector(n));
%o A214362 while(j<=n,x=0;while(!isprime(k+x),x++);y=2*x+1;k+=y;a[j]=y;j++);
%o A214362 return(a)} \\ _R. J. Cano_, Jan 17 2017
%Y A214362 Cf. A000040, A062042, A062044, A213815.
%K A214362 nonn,easy
%O A214362 1,1
%A A214362 _Alex Ratushnyak_, Jul 18 2012