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.

A194943 Greatest d such that d*n+b is the least prime in the arithmetic progression k*n+b for some 0 < b < n with gcd(b, n) = 1.

Original entry on oeis.org

1, 2, 1, 3, 1, 4, 2, 4, 1, 6, 1, 7, 3, 2, 2, 6, 2, 10, 2, 4, 3, 10, 3, 10, 3, 6, 2, 10, 2, 18, 4, 6, 5, 6, 4, 11, 5, 5, 3, 14, 2, 10, 5, 8, 6, 20, 3, 12, 5, 8, 11, 12, 3, 6, 4, 7, 5, 12, 2, 24, 9, 6, 5, 6, 3, 15, 5, 8, 3, 18, 4, 24, 8, 8, 6, 10
Offset: 2

Views

Author

Keywords

Comments

a(n) exists due to Linnik's theorem; thus a(n) < c * n^4.2 for some constant c.
Heath-Brown's conjecture on Linnik's theorem implies that a(n) < n.
On the GRH, a(n) << phi(n) * log(n)^2 * phi(n)/n.
Pomerance shows that a(n) > (e^gamma + o(1)) log(n) * phi(n)/n, and Granville & Pomerance conjecture that a(n) >> log(n)^2 * phi(n)/n.

Crossrefs

Cf. A085420. Records are in A362850, A362851.

Programs

  • Mathematica
    p[b_, d_] := Module[{k = b+d}, While[ !PrimeQ[k], k += d]; (k-b)/d]; a[n_] := Module[{r = p[1, n]}, For[b = 2, b <= n-1, b++, If[GCD[b, n] > 1, Null,  r = Max[r, p[b, n]]]]; r]; Table[a[n], {n, 2, 100}] (* Jean-François Alcover, Oct 02 2013, translated from Pari *)
  • PARI
    p(b,d)=my(k=d+b);while(!isprime(k),k+=d);(k-b)/d
    a(n)=my(r=p(1,n));for(b=2,n-1,if(gcd(b,n)>1,next);r=max(r,p(b,n)));r
    
  • Python
    from math import gcd
    from gmpy2 import is_prime
    def p(b, d):
        k = d + b
        while not is_prime(k):
            k += d
        return (k-b)//d
    def A194943(n):
        return max(p(b, n) for b in range(1, n) if gcd(b, n) == 1)
    print([A194943(n) for n in range(2, 82)]) # Michael S. Branicky, May 18 2023 after Charles R Greathouse IV

Formula

a(n) = floor(A085420(n)/n).

A362851 Records in A194943.

Original entry on oeis.org

1, 2, 3, 4, 6, 7, 10, 18, 20, 24, 29, 34, 36, 40, 46, 51, 58, 81, 87, 89, 103, 107, 120, 121, 135, 136, 150, 174, 181, 189, 193, 196, 203, 204, 208, 210, 225, 230, 233, 240, 244, 268
Offset: 1

Views

Author

R. J. Mathar, May 05 2023

Keywords

Crossrefs

Cf. A194943, A362850 (positions).

Programs

  • Python
    # uses imports, functions in A194943
    from itertools import count, islice
    def agen(r=-1): # generator of terms
        yield from (v for k in count(2) if (v:=A194943(k)) > r and (r:=v))
    print(list(islice(agen(), 20))) # Michael S. Branicky, May 18 2023

Formula

a(n) = A194943(A362850(n)).

Extensions

a(28)-a(42) from Michael S. Branicky, May 18 2023
Showing 1-2 of 2 results.