OFFSET
1,2
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
LINKS
Jon E. Schoenfield, Table of n, a(n) for n = 1..150 (terms 1..72 from Robert Israel)
Jon E. Schoenfield, Terms <= 5*10^8: Table of n, a(n) for n = 1..406, with -1 for each term > 5*10^8
FORMULA
a(n) = min{k | A034693(k) = n}.
EXAMPLE
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
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 *)
PROG
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved