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.

A047980 a(n) is smallest difference d of an arithmetic progression dk+1 whose first prime occurs at the n-th position.

Original entry on oeis.org

1, 3, 24, 7, 38, 17, 184, 71, 368, 19, 668, 59, 634, 167, 512, 757, 1028, 197, 1468, 159, 3382, 799, 4106, 227, 10012, 317, 7628, 415, 11282, 361, 38032, 521, 53630, 3289, 37274, 2633, 63334, 1637, 34108, 1861, 102296, 1691, 119074, 1997, 109474, 2053
Offset: 1

Views

Author

Keywords

Comments

Definition involves two minimal conditions: (1) the first prime (as in A034693) and (2) dk+1 sequences were searched with minimal d. Present terms are the first ones in sequences analogous to A034780, A034782-A034784, A006093 (called there K(n,m)).
Index of the first occurrence of n in A034693. - Amarnath Murthy, May 08 2003

Examples

			For n=2, the sequence with d=1 is 2,3,4,5,... with the prime 2 for k=1.  The sequence with d=2 is 3,5,7,9,... with the prime 3 for k=1.  The sequence with d=3 is 4,7,10,13,... with the prime 7 for k=2.  So a(n)=3. - _Michael B. Porter_, Mar 18 2019
		

Crossrefs

Programs

  • MATLAB
    function [ A ] = A047980( P, N )
    %   Get values a(i) for i <= N with a(i) <= P/i
    %   using primes <= P.
    %   Returned entries A(n) = 0 correspond to unknown a(n) > P/n
    Primes = primes(P);
    A = zeros(1,N);
    Ds = zeros(1,P);
    for p = Primes
       ns = [1:N];
       ns = ns(mod((p-1) * ones(1,N), ns) == 0);
       newds = (p-1) ./ns;
       ns = ns(A(ns) == 0);
       ds = (p-1) ./ ns;
       q = (Ds(ds) == 0);
       A(ns(q)) = ds(q);
       Ds(newds) = 1;
    end
    end % Robert Israel, Jan 25 2016
  • Maple
    N:= 40: # to get a(n) for n <= N
    count:= 0:
    p:= 0:
    Ds:= {1}:
    while count < N do
        p:= nextprime(p);
        ds:= select(d -> (p-1)/d <= N, numtheory:-divisors(p-1) minus Ds);
        for d in ds do
          n:= (p-1)/d;
          if not assigned(A[n]) then
            A[n]:= d;
            count:= count+1;
          fi
        od:
        Ds:= Ds union ds;
    od:
    seq(A[i],i=1..N); # Robert Israel, Jan 25 2016
  • Mathematica
    With[{s = Table[k = 1; While[! PrimeQ[k n + 1], k++]; k, {n, 10^6}]}, TakeWhile[#, # > 0 &] &@ Flatten@ Array[FirstPosition[s, #] /. k_ /; MissingQ@ k -> {0} &, Max@ s]] (* Michael De Vlieger, Aug 01 2017 *)

Formula

a(n) = min{k | A034693(k) = n}.

A047982 a(n) = A047980(2n+1).

Original entry on oeis.org

1, 24, 38, 184, 368, 668, 634, 512, 1028, 1468, 3382, 4106, 10012, 7628, 11282, 38032, 53630, 37274, 63334, 34108, 102296, 119074, 109474, 117206, 60664, 410942, 204614, 127942, 125618, 595358, 517882, 304702, 352022, 1549498, 651034, 506732, 5573116, 1379216, 1763144
Offset: 0

Views

Author

Keywords

Examples

			a(2)=38 because A034693(38) = 2*2+1 = 5 is the first 5; 5*38+1 = 191 is the first prime. The successive progressions in which the first prime appears at position 5 are as follows: 38k+1, 62k+1, 164k+1. 2nd example: a(20)=102296 because. The first 41 appears in A034693 at this index. Also 102296*(2*20+1)+1 = 102296*41+1 = 4194137 is the first prime in {102296k+1}. The next progression with this position of prime emergence is 109946k+1 (the corresponding prime is 4507787).
		

Crossrefs

Formula

a(n) = min {d}: A034693(a(n)) is an odd number k such that in a(n)*k+1 progression the first prime occurs at k=2n+1 position.

Extensions

More terms from Michel Marcus, Sep 01 2019
Showing 1-2 of 2 results.