A126638 a(n) is larger than a(n-1), not prime and coprime to a(n-1) and a(n-2).
4, 9, 25, 26, 27, 35, 38, 39, 49, 50, 51, 77, 80, 81, 91, 92, 93, 95, 98, 99, 115, 116, 117, 119, 121, 122, 123, 125, 128, 129, 133, 134, 135, 143, 146, 147, 155, 158, 159, 161, 164, 165, 169, 172, 175, 177, 178, 185, 187, 188, 189, 205, 206, 207, 209, 212, 213
Offset: 1
Keywords
Examples
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)).
Links
- Harvey P. Dale, Table of n, a(n) for n = 1..1000
Crossrefs
Cf. A051884.
Programs
-
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 *)
Extensions
Extended by Ray Chandler, Feb 14 2007