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.

A064632 Smallest prime p such that n = (p-1)/(q-1) for some prime q.

Original entry on oeis.org

3, 7, 5, 11, 7, 29, 17, 19, 11, 23, 13, 53, 29, 31, 17, 103, 19, 191, 41, 43, 23, 47, 97, 101, 53, 109, 29, 59, 31, 311, 193, 67, 137, 71, 37, 149, 229, 79, 41, 83, 43, 173, 89, 181, 47, 283, 97, 197, 101, 103, 53, 107, 109, 331, 113, 229, 59, 709, 61, 367, 373
Offset: 2

Views

Author

Robert G. Wilson v, Oct 16 2001

Keywords

Examples

			a(7) = 29 because (29-1)/(5-1).
		

Crossrefs

Similar to but not the same as A034694. Cf. A064652 (q-values), A064673.

Programs

  • Mathematica
    NextPrim[n_] := (k = n + 1; While[ !PrimeQ[k], k++ ]; k); Do[p = 2; While[q = (p - 1)/n + 1; !PrimeQ[q] || q >= p, p = NextPrim[p]]; Print[p], {n, 2, 100} ]
    spp[n_]:=Module[{p=2},While[!PrimeQ[(p-1)/n+1],p=NextPrime[p]];p]; Array[ spp,70,2] (* Harvey P. Dale, Aug 22 2019 *)
  • PARI
    a(n) = {forprime(p=2, , forprime(q=2, p-1, if ((p-1)/(q-1) == n, return (p));););} \\ Michel Marcus, Apr 16 2016
  • Sage
    def A064632(n):
        p, q = 0, 0
        while not (q.is_prime() and q < p):
            p = next_prime(p)
            if p % n != 1: continue
            q = (p - 1) // n + 1
        return p # Daria Micovic, Apr 13 2016
    

Extensions

Definition corrected by Stephanie Anderson, Apr 16 2016

A064673 Where the least prime p such that n = (p-1)/(q-1) and p > q is not the least prime == 1 (mod n) (A034694).

Original entry on oeis.org

24, 32, 34, 38, 62, 64, 71, 76, 80, 92, 94, 104, 110, 117, 122, 124, 129, 132, 144, 149, 152, 154, 159, 164, 167, 182, 184, 185, 188, 201, 202, 206, 212, 214, 218, 220, 225, 227, 236, 242, 244, 246, 252, 264, 269, 272, 274, 286, 290, 294
Offset: 1

Views

Author

Robert G. Wilson v, Oct 16 2001

Keywords

Examples

			24 is in the sequence because (97-1)/(5-1) whereas the first prime ==1 (Mod 24) is 73. See the comment in A034694 about the multiplier k and it must differ from q-1 or k+1 is not prime.
		

Crossrefs

Cf. A034694, A064632, A064652. Disjoint from A005097 and A006093.

Programs

  • Maple
    f:= proc(n) local k;
      for k from n+1 by n do
        if isprime(k) then return k fi
      od
    end proc:
    filter:= proc(n) local p;
        p:= f(n);
        not isprime(1+(p-1)/n)
    end proc:
    select(filter, [$1..1000]); # Robert Israel, May 09 2024
  • Mathematica
    NextPrim[n_] := (k = n + 1; While[ !PrimeQ[k], k++ ]; k); Do[p = 2; While[q = (p - 1)/n + 1; !PrimeQ[q] || q >= p, p = NextPrim[p]]; k = 1; While[ !PrimeQ[k*n + 1], k++ ]; If[p != k*n + 1, Print[n]], {n, 2, 300} ]
Showing 1-2 of 2 results.