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.

A076472 Number of pairs (p,q) of successive primes with p+q<=n and gcd(p+q,n)>1.

This page as a plain text file.
%I A076472 #11 Dec 08 2024 17:25:25
%S A076472 0,0,0,0,1,0,0,1,0,2,0,2,0,2,2,2,0,3,0,4,2,3,0,4,1,4,3,4,0,6,0,5,4,5,
%T A076472 2,6,0,6,5,7,0,7,0,7,7,7,0,7,1,8,6,8,0,8,2,8,6,8,0,10,0,9,7,9,4,9,0,
%U A076472 10,7,11,0,10,0,10,8,10,1,11,0,12,8,11,0,12,4,12,9,12,0,14,4,13,10,13,4,13
%N A076472 Number of pairs (p,q) of successive primes with p+q<=n and gcd(p+q,n)>1.
%H A076472 Robert Israel, <a href="/A076472/b076472.txt">Table of n, a(n) for n = 1..10000</a>
%F A076472 a(n) = A076471(n) - A076473(n).
%F A076472 For n>6: a(n)=0 iff n is prime.
%e A076472 n=27: gcd(2+3,27)=1, gcd(3+5,27)=1, gcd(5+7,27)=3, gcd(7+11,27)=9, gcd(11+13,27)=3, hence a(27)=3.
%p A076472 f:= proc(n) local t,p,q,s;
%p A076472   p:= 2; t:= 0;
%p A076472   do
%p A076472     q:= p; p:= nextprime(p);
%p A076472     s:= q+p;
%p A076472     if s > n then return t fi;
%p A076472     if igcd(s,n) > 1 then t:= t+1 fi
%p A076472   od
%p A076472 end proc:
%p A076472 map(f, [$1..100]); # _Robert Israel_, Dec 08 2024
%t A076472 Table[Count[Total/@Partition[Prime[Range[n]],2,1],_?(#<=n&&GCD[#,n]>1&)],{n,100}] (* _Harvey P. Dale_, May 06 2018 *)
%Y A076472 Cf. A076471, A076473.
%K A076472 nonn,look
%O A076472 1,10
%A A076472 _Reinhard Zumkeller_, Oct 14 2002