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.

A336381 Primes p(n) such that gcd(n, prime(n-1)+prime(n+1)) > 1.

Original entry on oeis.org

7, 11, 13, 19, 23, 29, 31, 37, 43, 47, 53, 61, 71, 73, 79, 89, 97, 101, 107, 113, 131, 137, 139, 149, 151, 163, 167, 173, 181, 193, 199, 223, 229, 233, 239, 251, 263, 269, 271, 281, 293, 311, 317, 337, 349, 359, 373, 379, 383, 397, 409, 421, 433, 443, 449
Offset: 1

Views

Author

Clark Kimberling, Oct 25 2020

Keywords

Examples

			In the following table, P(n) = A000040(n) = prime(n).
  n    P(n)   P(n-1)+P(n+1)   gcd
  2     3          7           1
  3     5         10           1
  4     7         16           4
  5    11         20           5
  6    13         28           2
2 and 3 are in A336378; 4 and 5 are in A336379; 3 and 5 are in A336380; 7 and 11 are in A336381.
		

Crossrefs

Programs

  • Maple
    q:= 2: r:= 3:
    R:= NULL: count:= 0:
    for n from 2 while count < 100 do
      p:= q; q:= r; r:= nextprime(r);
      if igcd(n,p+r) > 1 then count:= count+1; R:= R, q; fi
    od:
    R; # Robert Israel, Dec 08 2020
  • Mathematica
    p[n_] := Prime[n];
    u = Select[Range[2, 200], GCD[#, p[# - 1] + p[# + 1]] == 1 &]  (* A336378 *)
    v = Select[Range[2, 200], GCD[#, p[# - 1] + p[# + 1]] > 1 &]   (* A336379 *)
    Prime[u]  (* A336380 *)
    Prime[v]  (* A336381 *)
    Select[Partition[Prime[Range[100]],3,1],GCD[PrimePi[#[[2]]],#[[1]]+#[[3]]]>1&][[All,2]] (* Harvey P. Dale, Dec 07 2022 *)
  • PARI
    for(n=2,200,if(gcd(n,prime(n-1)+prime(n+1))>1,print1(prime(n),", "))) \\ Derek Orr, Nov 23 2020

Extensions

Offset changed by Robert Israel, Dec 08 2020