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.

Original entry on oeis.org

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, 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, 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
Offset: 1

Views

Author

Reinhard Zumkeller, Oct 14 2002

Keywords

Examples

			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.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local t,p,q,s;
      p:= 2; t:= 0;
      do
        q:= p; p:= nextprime(p);
        s:= q+p;
        if s > n then return t fi;
        if igcd(s,n) > 1 then t:= t+1 fi
      od
    end proc:
    map(f, [$1..100]); # Robert Israel, Dec 08 2024
  • Mathematica
    Table[Count[Total/@Partition[Prime[Range[n]],2,1],?(#<=n&&GCD[#,n]>1&)],{n,100}] (* _Harvey P. Dale, May 06 2018 *)

Formula

a(n) = A076471(n) - A076473(n).
For n>6: a(n)=0 iff n is prime.