login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A336093 Let P(n) = primorial(n) = A002110(n); a(n) is the number of primes q < P(n) such that P(n) - q is also prime and q^2==1 (mod P(n)). 0

%I #48 Aug 18 2020 13:09:15

%S 0,0,2,4,2,8,6,28,36,40,56,106,192,304,526,926,1644,2756,4944,8840,

%T 15958,28402,51102,92372

%N Let P(n) = primorial(n) = A002110(n); a(n) is the number of primes q < P(n) such that P(n) - q is also prime and q^2==1 (mod P(n)).

%C A totative of k is a number <= k and relatively prime to k.

%C A336016(n) gives the number of prime totatives p of P(n) for which p^2==1 (mod P(n)). Whereas P(n) - p also has this property, it is not always prime. This sequence gives the number of prime totatives q of P(n) such that q^2==1 mod P(n) and P(n) - q is also prime. All terms are even; a(n) <= A336016(n) for all n. The number of distinct representations of P(n) as the sum of two primes each having multiplicative order 2 (mod P(n)) is given by a(n)/2, for which A116979(n) is an upper bound.

%e P(4)=210; all totatives 29,41,71,139,181 are prime. However 210 - 41 = 169 is not prime, whereas 210-29 = 181, 210-71 = 139. Therefore the totatives we count in this case are 29,71,139,181, so a(4) = 4.

%p with(NumberTheory):

%p P := proc (k)

%p local n, v, W, H;

%p n := 1; v := 0;

%p W := product(ithprime(j), j = 1 .. k);

%p H := PrimeCounting(W);

%p for n from 1 to H do

%p if mod(ithprime(n)^2, W) = 1 and isprime(W-ithprime(n)) then v := v+1 else v := v end if:

%p end do:

%p v;

%p end proc:

%p seq(P(k), k = 1 .. 8);

%t {0, 0}~Join~Table[Block[{P = #, k = 0}, Do[If[AllTrue[{#, P - #}, And[PrimeQ@ #, MultiplicativeOrder[#, P] == 2] &], k++] &@ Prime[i], {i, PrimePi[n + 1], PrimePi[P/2]}]; 2 k ] &@ Product[Prime@ j, {j, n}], {n, 3, 8}]

%Y Cf. A000010, A336015, A336016, A116979.

%K nonn,more

%O 1,3

%A _David James Sycamore_, _Michael De Vlieger_ Jul 09 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 03:00 EDT 2024. Contains 371917 sequences. (Running on oeis4.)