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.

A038703 Primes p such that p^2 mod q is odd, where q is the previous prime.

Original entry on oeis.org

3, 5, 17, 29, 37, 127
Offset: 1

Views

Author

Neil Fernandez, May 01 2000

Keywords

Comments

The next term if it exists is > 32452843 = 2000000th prime. Can someone prove this sequence is complete? - Olivier Gérard, Jun 26 2001
To prove that 127 is the last prime, we need to show that prime gaps satisfy prime(k)-prime(k-1)31. Although it is easy to verify this inequality for all known prime gaps, there is no proof for all gaps. - T. D. Noe, Jul 25 2006

Examples

			The first prime with a prime lower than itself is 3. This squared is 9, which when divided by the previous prime 2 leaves remainder 1, which is odd. So 3 is in the sequence. 11 is not in the sequence because 11^2, when divided by the previous prime 7, leaves a remainder of 121 (mod 7) = 2, which is even.
		

Crossrefs

Cf. A038702.
Cf. A058188 (number of primes between prime(n) and prime(n)+sqrt(prime(n))).

Programs

  • Mathematica
    Prime /@ Select[ Range[ 2, 100 ], OddQ[ Mod[ Prime[ # ]^2, Prime[ # - 1 ] ] ] & ]
    Transpose[Select[Partition[Prime[Range[50]],2,1],OddQ[PowerMod[Last[#],2, First[#]]]&]] [[2]]  (* Harvey P. Dale, May 31 2012 *)
  • PARI
    isok(p) = isprime(p) && (p>2) && (lift(Mod(p, precprime(p-1))^2) % 2); \\ Michel Marcus, Mar 05 2023

Formula

Prime(k) is in the sequence if prime(k)^2 (mod prime(k-1)) is odd.

Extensions

More terms from Olivier Gérard, Jun 26 2001

A192361 Primes p such that number of primes in the range (p-sqrt(p), p] is equal to number of primes in the range (p, p+sqrt(p)].

Original entry on oeis.org

2, 11, 29, 37, 41, 71, 97, 103, 131, 191, 229, 257, 263, 311, 331, 347, 373, 379, 443, 491, 541, 593, 643, 727, 733, 739, 797, 821, 929, 967, 991, 1013, 1019, 1097, 1163, 1171, 1201, 1213, 1217, 1259, 1291, 1297, 1373, 1451, 1481, 1531, 1553, 1571, 1583, 1657, 1709, 1777, 1831, 1873, 1949, 1999, 2053
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Jun 28 2011

Keywords

Examples

			a(1)=2 because 2 in range (2-sqrt(2), 2] and 3 in range (2, 2+sqrt(2)],
a(2)=11 because 7 in range (11-sqrt(11), 11] and 13 in range (11, 11+sqrt(11)].
		

Crossrefs

Cf. A058188.

Programs

  • Mathematica
    npeQ[p_]:=Module[{p1=PrimePi[p],p2=PrimePi[p-Sqrt[p]],p3=PrimePi[p+Sqrt[p]]},p3-p1 == p1-p2]; Select[Prime[Range[400]],npeQ] (* Harvey P. Dale, Jan 31 2024 *)
  • PARI
    is(p)=2*primepi(p)==primepi(p+sqrt(p))+primepi(p-sqrt(p))
    select(isA192361,primes(1000)) \\ Charles R Greathouse IV, Jun 29 2011

Extensions

Missing terms a(3) and a(7) inserted, a(19)-a(57) added by Charles R Greathouse IV, Jun 29 2011
Showing 1-2 of 2 results.