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-4 of 4 results.

A307965 a(n) is the least prime p = prime(k) > prime(n) such that A306530(k) = prime(n).

Original entry on oeis.org

7, 11, 19, 53, 43, 173, 67, 2477, 8803, 9173, 32323, 37123, 163, 74093, 170957, 360293, 679733, 2404147, 2004917, 69009533, 51599563, 155757067, 96295483, 146161723, 1408126003, 3519879677, 2050312613, 3341091163, 78864114883, 65315700413, 1728061733, 9447241877
Offset: 1

Views

Author

Amiram Eldar and Thomas Ordowski, May 08 2019

Keywords

Comments

This sequence is analogous to A000229, but for least prime quadratic residue modulo p.
Note that a(n) is the least odd number m > prime(n) such that prime(n)^((m-1)/2) == 1 (mod m) and q^((m-1)/2) == -1 (mod m) for every prime q < prime(n). Such m is always an odd prime.

Crossrefs

Programs

  • Mathematica
    f[n_] := Module[{p = Prime[n], q = 2}, While[JacobiSymbol[q, p] != 1, q = NextPrime[q]]; q]; a[n_] := Module[{p = Prime[n], k = n + 1}, While[f[k] != p, k++]; Prime[k]]; Array[a, 20]
  • PARI
    f(n) = my(i=1, p = prime(n)); while(kronecker(prime(i), p)! = 1, i++); prime(i); \\ A306530
    a(n) = my(p=prime(n), iq = p+1, q=nextprime(iq)); while(f(iq)!= p, iq++); prime(iq); \\ Michel Marcus, May 12 2019

A307798 The "residue" pseudoprimes: odd composite numbers n such that q(n)^((n-1)/2) == 1 (mod n), where base q(n) is the smallest prime quadratic residue modulo n.

Original entry on oeis.org

121, 561, 1105, 1541, 1729, 1905, 2465, 4033, 5611, 8321, 8481, 10585, 15709, 15841, 16297, 18705, 18721, 19345, 25761, 28009, 29341, 30121, 31697, 33153, 34945, 42799, 44173, 46657, 49141, 52633, 55969, 62745, 63973, 65077, 69781, 75361, 76627, 79381, 82513, 85489, 88573, 90241, 102311
Offset: 1

Views

Author

Thomas Ordowski, Apr 29 2019

Keywords

Comments

As is well known, for an odd prime p, a prime q is a quadratic residue modulo p if and only if q^((p-1)/2) == 1 (mod p). Hence the above definition of these pseudoprimes.
Such pseudoprimes n which are both "residue" and "non-residue", obviously to different bases q(n) and b(n), are particularly interesting: 29341, 49141, 1251949, 1373653, 2284453, ... These five numbers are in A244626.
Note that the absolute Euler pseudoprimes are odd composite numbers n such that b^((n-1)/2) == 1 (mod n) for every base b that is a quadratic residue modulo n and coprime to n. There are no odd composite numbers n such that b^((n-1)/2) == -1 (mod n) for every base b that is a quadratic non-residue modulo n and coprime to n. The absolute Euler-Jacobi pseudoprimes do not exist.

Examples

			3^((121-1)/2) == 1 (mod 121), 2^((561-1)/2) == 1 (mod 561), ...
		

Crossrefs

Cf. A002997, A033181, A306530, A307767 (the "non-residue" pseudoprimes).

Programs

  • Mathematica
    q[n_] := Module[{p = 2, pn = Prime[n]}, While[JacobiSymbol[p, pn] != 1, p = NextPrime[p]]; p]; aQ[n_] := CompositeQ[n] && PowerMod[q[n], (n - 1)/2, n] == 1; Select[Range[3, 110000, 2], aQ] (* Amiram Eldar, Apr 29 2019 *)

Extensions

More terms from Amiram Eldar, Apr 29 2019

A307864 a(n) is the number of natural bases b < 2n+1 such that b^n == 1 (mod 2n+1).

Original entry on oeis.org

0, 1, 2, 3, 2, 5, 6, 1, 8, 9, 4, 11, 4, 1, 14, 15, 4, 1, 18, 1, 20, 21, 4, 23, 6, 1, 26, 1, 4, 29, 30, 1, 16, 33, 4, 35, 36, 1, 4, 39, 2, 41, 4, 1, 44, 9, 4, 1, 48, 1, 50, 51, 16, 53, 54, 1, 56, 1, 4, 1, 10, 1, 2, 63, 4, 65, 36, 1, 68, 69, 4, 1, 16, 1, 74, 75, 8, 1, 78, 1, 4, 81, 8, 83, 12, 1, 86
Offset: 0

Views

Author

Thomas Ordowski, May 02 2019

Keywords

Comments

For n > 0, a(n) = n if and only if 2n+1 is prime.
If a(n) < n, then 2n+1 is composite.
Theorem: a(n) > n if and only if 2n+1 is an absolute Euler pseudoprime.
Conjecture: if 2n+1 is an absolute Euler pseudoprime, then a(n) = phi(2n+1).

Crossrefs

Programs

  • Mathematica
    a[n_] := Length[Select[Range[2n], PowerMod[#, n, 2n+1] == 1 &]]; Array[a, 100] (* Amiram Eldar, May 02 2019 *)
  • PARI
    a(n) = sum(b=1, 2*n, Mod(b, 2*n+1)^n == 1); \\ Michel Marcus, May 02 2019

Extensions

More terms from Amiram Eldar, May 02 2019

A374155 a(n) is the least prime that is a quadratic residue modulo prime(n). First column of A373751.

Original entry on oeis.org

2, 3, 5, 2, 3, 3, 2, 5, 2, 5, 2, 3, 2, 11, 2, 7, 3, 3, 17, 2, 2, 2, 3, 2, 2, 5, 2, 3, 3, 2, 2, 3, 2, 5, 5, 2, 3, 41, 2, 13, 3, 3, 2, 2, 7, 2, 5, 2, 3, 3, 2, 2, 2, 3, 2, 2, 5, 2, 3, 2, 7, 17, 7, 2, 2, 7, 5, 2, 3, 3, 2, 2, 2, 3, 5, 2, 5, 3, 2, 2, 3, 3, 2, 2, 2
Offset: 1

Views

Author

Peter Luschny, Jun 29 2024

Keywords

Examples

			a(38) = 41 because row 38 of A373751 starts 41, 43, 47, ..., which are the primes that are quadratic residues modulo 163.
		

Crossrefs

Variant: A306530 (differs in the first 3 values).
Cf. A373751.

Programs

  • Maple
    a := proc(n) local a, p; a := 1; p := ithprime(n); while true do a := a + 1;
    if NumberTheory:-QuadraticResidue(a, p) = 1 and isprime(a) then return a fi od end: seq(a(n), n = 1..85);
  • PARI
    a(n) = my(p=prime(n), q=2); while (!issquare(Mod(q, p)), q=nextprime(q+1)); q; \\ Michel Marcus, Jun 29 2024
Showing 1-4 of 4 results.