login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A178670 Number of ways to express prime(n) as (prime(n+k) + prime(n-k))/2. 6

%I #23 Dec 06 2015 23:14:03

%S 0,0,1,0,2,1,1,0,0,2,1,1,2,0,0,2,1,1,1,3,0,0,1,1,2,1,1,1,0,0,2,2,2,1,

%T 0,1,3,0,1,3,2,1,4,2,1,0,4,0,0,0,2,0,0,2,1,1,0,0,1,0,0,0,3,4,0,0,1,1,

%U 1,2,3,3,2,4,2,2,1,3,4,4,1,1,1,3,2,2,2,1,1,0,0,1,2,1,0,0,0,3,0,2

%N Number of ways to express prime(n) as (prime(n+k) + prime(n-k))/2.

%H T. D. Noe, <a href="/A178670/b178670.txt">Table of n, a(n) for n = 1..10000</a>

%e a(5) = 2 because the 5th prime (11) is half the sum of the 7th and 3rd prime (17+5) or half the sum of the 8th and 2nd prime (19+3).

%e a(8) = 0 because the 8th prime (19) cannot be expressed as (1/2)*(prime(8+k) + prime(8-k)) for any k.

%t nn=1000; p=Prime[Range[2*nn]]; Table[s=Take[p,n-1] + Reverse[Take[p, {n+1,2n-1}]]; Count[s,2*p[[n]]], {n,nn}]

%o (PARI) a(n)={s=2*prime(n);a=0;for(i=1,n-1,if(prime(n+i)+prime(n-i)==s,a=a+1));a}

%Y Cf. A000040, A129363, A178609, A178954.

%K nonn

%O 1,5

%A _Juri-Stepan Gerasimov_, Jan 04 2011

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 23 11:35 EDT 2024. Contains 371912 sequences. (Running on oeis4.)