OFFSET
1,2
COMMENTS
a(n) == n+1 (mod 2). - Robert Israel, May 04 2017
LINKS
Ivan Neretin, Table of n, a(n) for n = 1..4000 (first 2880 terms from Robert Israel)
FORMULA
a(n) = Min{x; A066752(x)=n}.
EXAMPLE
In A066752, n=5 arises first at the 24th position, so a(5)=24.
MAPLE
f:= proc(n) local x;
for x from n-1 by ilcm(n, 2) do
if igcd(x+1, ithprime(x)+1) = n then return x fi
od
end proc:
f(1):= 1:
map(f, [$1..100]); # Robert Israel, May 04 2017
MATHEMATICA
f[x_]:=GCD[Prime[x]+1, x+1]; t=Table[0, {256}]; Do[s=f[n]; If[s<257&&t[[s]] == 0, t[[s]] = n], {n, 1, 100000}]; t (* edited by Harvey P. Dale, Jan 28 2023 *)
Module[{nn=20000, t}, t=Table[{x, GCD[Prime[x]+1, x+1]}, {x, nn}]; Table[SelectFirst[t, #[[2]]==n&], {n, 60}]][[All, 1]] (* Harvey P. Dale, Jan 28 2023 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jun 13 2003
STATUS
approved