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.

A212769 p*q modulo (p+q) with p, q consecutive primes.

Original entry on oeis.org

1, 7, 11, 5, 23, 11, 35, 17, 43, 59, 59, 35, 83, 41, 91, 103, 119, 119, 65, 143, 143, 77, 163, 77, 95, 203, 101, 215, 107, 191, 125, 259, 275, 263, 299, 299, 311, 161, 331, 343, 359, 347, 383, 191, 395, 169, 181, 221, 455, 227, 463, 479, 467, 499, 511, 523
Offset: 1

Views

Author

Zak Seidov, May 26 2012

Keywords

Comments

Graph consists of two branches, the upper one corresponds to cases (q-p) = 2 (mod 4), and the lower one to cases (q-p) = 0 (mod 4).
If prime(n+k) = prime(n)+4*k^2 for k=1..m, then a(n)=...=a(n+m-1)=2*prime(n)+1. - Robert Israel, Jan 20 2022

Programs

  • Maple
    f:= proc(n) local p,q;
      p:= ithprime(n); q:= nextprime(p);
      (p*q) mod (p+q)
    end proc:
    map(f, [$1..100]); # Robert Israel, Jan 20 2022
  • Mathematica
    Mod[Times@@#,Total[#]]&/@Partition[Prime[Range[60]],2,1] (* Harvey P. Dale, Feb 21 2022 *)
  • PARI
    a(n) = (prime(n)*prime(n+1)) % (prime(n)+prime(n+1)); \\ Michel Marcus, Oct 19 2013
    
  • PARI
    a(n)=my(p=prime(n),q=nextprime(p+1)); (p*q)%(p+q) \\ Charles R Greathouse IV, Oct 19 2013

Formula

From Robert Israel, Jan 20 2022: (Start)
If prime(n+1)-prime(n) = 4*k+2 with k^2 <= prime(n)/2, then a(n) = 2*prime(n)-4*k^2+1.
If prime(n+1)-prime(n) = 4*k with 4*k^2+2*k