login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A172999
a(1)=1, a(2)=4; for n>=3, a(n) is the smallest number larger than a(n-1) such that, for every k<n, a(n) is relatively prime to a(k) iff n is relatively prime to k.
4
1, 4, 5, 6, 7, 10, 11, 12, 25, 28, 29, 30, 31, 44, 175, 178, 179, 180, 181, 182, 275, 348, 349, 360, 371, 372, 395, 396, 397, 420, 421, 422, 725, 1074, 1309, 1310, 1319, 1448, 2945, 2954, 2957, 2970, 2971, 3016, 3325, 4188, 4189, 4190, 4213, 4214, 4475, 4526
OFFSET
1,2
LINKS
MAPLE
a:= proc(n) option remember;
local ok, m, k;
if n<3 then 3*n-2
else for m from a(n-1)+1 do
ok:= true;
for k from 1 to n-1 do
if igcd(n, k)=1 xor igcd(m, a(k))=1
then ok:= false; break fi
od;
if ok then break fi
od; m
fi
end:
seq (a(n), n=1..50); # Alois P. Heinz, Nov 21 2010
MATHEMATICA
t={1, 4}; Do[nxt=t[[-1]]+1; While[CoprimeQ[n, Range[n-1]] != CoprimeQ[nxt, t], nxt++]; AppendTo[t, nxt], {n, 3, 50}]; t
KEYWORD
nonn
AUTHOR
Vladimir Shevelev, Nov 21 2010
EXTENSIONS
More terms from Alois P. Heinz, Nov 21 2010
STATUS
approved