OFFSET
1,2
MATHEMATICA
pairwiseQ[a_, b_, c_]:=Sort[{CoprimeQ[a, b], CoprimeQ[b, c], CoprimeQ[a, c]}]=={False, True, True}; a[1]=1; a[2]=2; a[3]=4;
a[n_]:=a[n]=Module[{k=1, digits, tab=Table[a[i], {i, 1, n-1}]},
While[digits=Join[Take[Flatten[IntegerDigits[Take[tab, -3]]], -3], IntegerDigits[k]];
MemberQ[tab, k]||Union[pairwiseQ@@@
Table[{digits[[i]], digits[[i+1]], digits[[i+2]]},
{i, 1, Length[digits]-2}]]!={True}, k++]; k]; a/@Range[70]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Ivan N. Ianakiev, Mar 14 2024
STATUS
approved