A173381
a(n) = b_n(p_(n+1)) where p_n is the n-th prime, b_n(1)=1, b_n(2)=p_n, and for k>=3, b_n(k) is the smallest number larger than b_n(k-1) such that, for all i
3, 11, 31, 163, 661, 929, 2041, 21341, 15989, 47387, 125117, 263411, 123493, 10426601, 3654221, 4167127, 86622397, 4036267, 3910993, 541513877
Offset: 1
Keywords
Programs
-
Maple
b:= proc(n, k) option remember; local ok, m, i; if k=1 then 1 elif k=2 then ithprime(n) else for m from b(n, k-1)+1 do ok:= true; for i from 1 to k-1 do if igcd(k, i)=1 xor igcd(m, b(n, i))=1 then ok:= false; break fi od; if ok then break fi od; m fi end: a:= n-> b(n, ithprime(n+1)); seq(a(n), n=1..10); # Alois P. Heinz, Nov 22 2010
-
Mathematica
b[n_, k_] := b[n, k] = Module[{ok, m, i}, Which[k==1, 1, k==2, Prime[n], True, For[m = b[n, k - 1] + 1, True, m++, ok = True; For[i = 1, i <= k - 1, i++, If[Xor[GCD[k, i]==1, GCD[m, b[n, i]]==1], ok = False; Break[]]]; If[ok, Break[]]]; m]]; a[n_] := b[n, Prime[n + 1]]; Array[a, 10] (* Jean-François Alcover, Nov 28 2020, after Alois P. Heinz *)
Extensions
More terms from Alois P. Heinz, Nov 22 2010