OFFSET
1,2
LINKS
MAPLE
b:= proc(n) false end:
g:= proc(n) option remember; local h, i;
if n<3 then h:= 2*n-1 else g(n-1); h:= ilcm(map(g,
numtheory[divisors](n) minus {1, n})[]) fi;
for i while b(i*h) do od;
b(i*h):= true; i*h
end:
a:= proc() local t, a; t, a:= -1, proc() -1 end;
proc(n) local h;
while a(n) = -1 do
t:= t+1; h:= g(t);
if a(h) = -1 then a(h):= t fi
od; a(n)
end
end():
seq(a(n), n=1..100);
MATHEMATICA
terms = 100; b[1] = 1; b[2] = 3; b[n_] := b[n] = Module[{d, s, c, k}, d = Divisors[n] ~Complement~ {1, n}; For[s = Sort[Array[b, n - 1]]; c = Complement[ Range[ Last[s]], s]; k = If[c == {}, Last[s] + 1, First[c]], True, k++, If[FreeQ[s, k], If[AllTrue[d, Divisible[k, b[#]] &], Return[k]]]]]; a[n_] := a[n] = For[k = 1, True, k++, If[b[k] == n, Return[k]]]; Array[a, terms] (* Jean-François Alcover, Feb 22 2018 *)
PROG
(Haskell)
import Data.List (elemIndex)
import Data.Maybe (fromJust)
a222209 = (+ 1) . fromJust . (`elemIndex` a222208_list)
-- Reinhard Zumkeller, Feb 13 2013
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Alois P. Heinz, Feb 12 2013
STATUS
approved