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.

This page as a plain text file.
%I A336381 #16 Dec 07 2022 12:27:15
%S A336381 7,11,13,19,23,29,31,37,43,47,53,61,71,73,79,89,97,101,107,113,131,
%T A336381 137,139,149,151,163,167,173,181,193,199,223,229,233,239,251,263,269,
%U A336381 271,281,293,311,317,337,349,359,373,379,383,397,409,421,433,443,449
%N A336381 Primes p(n) such that gcd(n, prime(n-1)+prime(n+1)) > 1.
%H A336381 Robert Israel, <a href="/A336381/b336381.txt">Table of n, a(n) for n = 1..10000</a>
%e A336381 In the following table, P(n) = A000040(n) = prime(n).
%e A336381   n    P(n)   P(n-1)+P(n+1)   gcd
%e A336381   2     3          7           1
%e A336381   3     5         10           1
%e A336381   4     7         16           4
%e A336381   5    11         20           5
%e A336381   6    13         28           2
%e A336381 2 and 3 are in A336378; 4 and 5 are in A336379; 3 and 5 are in A336380; 7 and 11 are in A336381.
%p A336381 q:= 2: r:= 3:
%p A336381 R:= NULL: count:= 0:
%p A336381 for n from 2 while count < 100 do
%p A336381   p:= q; q:= r; r:= nextprime(r);
%p A336381   if igcd(n,p+r) > 1 then count:= count+1; R:= R, q; fi
%p A336381 od:
%p A336381 R; # _Robert Israel_, Dec 08 2020
%t A336381 p[n_] := Prime[n];
%t A336381 u = Select[Range[2, 200], GCD[#, p[# - 1] + p[# + 1]] == 1 &]  (* A336378 *)
%t A336381 v = Select[Range[2, 200], GCD[#, p[# - 1] + p[# + 1]] > 1 &]   (* A336379 *)
%t A336381 Prime[u]  (* A336380 *)
%t A336381 Prime[v]  (* A336381 *)
%t A336381 Select[Partition[Prime[Range[100]],3,1],GCD[PrimePi[#[[2]]],#[[1]]+#[[3]]]>1&][[All,2]] (* _Harvey P. Dale_, Dec 07 2022 *)
%o A336381 (PARI) for(n=2,200,if(gcd(n,prime(n-1)+prime(n+1))>1,print1(prime(n),", "))) \\ _Derek Orr_, Nov 23 2020
%Y A336381 Cf. A000040, A048448, A336366, A336378, A336379, A336380.
%K A336381 nonn
%O A336381 1,1
%A A336381 _Clark Kimberling_, Oct 25 2020
%E A336381 Offset changed by _Robert Israel_, Dec 08 2020