OFFSET
1,1
LINKS
Harvey P. Dale, Table of n, a(n) for n = 1..1000
EXAMPLE
a(7) = 38 because it is the next composite number larger than 35 (a(6)) that shares no factors in common with 35 and 27 (a(5)).
MAPLE
with(numtheory); i:=4; j:=9; k:=10; while(k < 100) do while(order(k, i) = FAIL or order(k, j) = FAIL or isprime(k)) do k:=k+1; end do; print(k); i:= j; j:=k; k:=k+1; end do;
MATHEMATICA
f[l_List] := Block[{k = l[[ -1]] + 1}, While[PrimeQ[k] || GCD[k, l[[ -1]]*l[[ -2]]] > 1, k++ ]; Append[l, k]]; Nest[f, {4, 9}, 56] (* Ray Chandler, Feb 14 2007 *)
nxt[{a_, b_}]:=Module[{k=b+1}, While[PrimeQ[k]||!CoprimeQ[a, k] || !CoprimeQ[ b, k], k++]; {b, k}]; NestList[nxt, {4, 9}, 60][[All, 1]] (* Harvey P. Dale, Aug 31 2021 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Ben Paul Thurston, Feb 08 2007
EXTENSIONS
Extended by Ray Chandler, Feb 14 2007
STATUS
approved