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.

Showing 1-2 of 2 results.

A336015 Irregular triangle where row n lists primes q below the n-th primorial such that the multiplicative order of q mod the n-th primorial is 2. I.e., such primes q having the least k such that q^k (mod primorial(n)) == 1 is 2.

Original entry on oeis.org

5, 11, 19, 29, 29, 41, 71, 139, 181, 419, 461, 659, 769, 881, 1231, 1429, 2309, 1429, 2729, 4159, 5279, 5851, 8009, 8581, 10009, 12011, 12739, 13441, 13859, 14741, 15289, 17291, 20021, 23869, 24179, 30029, 1429, 23869, 77351, 95369, 102101, 116689, 120121, 188189
Offset: 2

Views

Author

Keywords

Examples

			Table begins:
5;
11, 19, 29;
29, 41, 71, 139, 181;
419, 461, 659, 769, 881, 1231, 1429, 2309;
...
For row 2 we look for primes q such that q^2 == 1 (mod primorial(2)) == 1 (mod 6) where q is coprime to 6. It turns out the only prime with this property is 5 as 5^2 == 1 (mod 6). - _David A. Corneth_, Aug 15 2020
		

Crossrefs

Programs

  • Mathematica
    Table[Function[P, Select[Prime@ Range[n, PrimePi[P - 1]], MultiplicativeOrder[#, P] == 2 &]][Product[Prime@ i, {i, n}]], {n, 8}] // Flatten
  • PARI
    row(n) = my(pp = vecprod(primes(n)), res=List()); forstep(i=pp/prime(n)+1, pp-1, 2, if(gcd(i,pp) == 1 && znorder(Mod(i,pp)) == 2 && isprime(i), listput(res,i))); res \\ David A. Corneth, Jul 08 2020

Extensions

New name from David A. Corneth, Aug 15 2020

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)).

Original entry on oeis.org

0, 0, 2, 4, 2, 8, 6, 28, 36, 40, 56, 106, 192, 304, 526, 926, 1644, 2756, 4944, 8840, 15958, 28402, 51102, 92372
Offset: 1

Views

Author

Keywords

Comments

A totative of k is a number <= k and relatively prime to k.
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.

Examples

			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.
		

Crossrefs

Programs

  • Maple
    with(NumberTheory):
    P := proc (k)
    local n, v, W, H;
    n := 1; v := 0;
    W := product(ithprime(j), j = 1 .. k);
    H := PrimeCounting(W);
    for n from 1 to H do
    if mod(ithprime(n)^2, W) = 1 and isprime(W-ithprime(n)) then v := v+1 else v := v end if:
    end do:
    v;
    end proc:
    seq(P(k), k = 1 .. 8);
  • Mathematica
    {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}]
Showing 1-2 of 2 results.