OFFSET
1,2
LINKS
Paolo P. Lava, Table of n, a(n) for n = 1..1000
EXAMPLE
a(2) = 2 because 2 is coprime to 1, a(3) = 3 because 3, 2, 1 are coprime; a(4) cannot be 4 because 2 and 4 have 2 as great common divisor, but cannot be concat(4,5) = 45 because 45 and 3 have 3 as greatest common divisor, neither concat(4,5,6) = 456 because prime factors of 456 are 2, 3 and 19. So a(4) = concat(4,5,6,7) = 4567, a prime.
MAPLE
P:=proc(q) local a, b, k, n, ok; a:=[1]; print(1); b:=0;
for n from 2 to q do ok:=1; b:=b*10^(ilog10(n)+1)+n; for k from 1 to
nops(a) do if gcd(a[k], b)>1 then ok:=0; break; fi; od;
if ok=1 then print(b); a:=[op(a), b]; b:=0; fi;
od; print(); end: P(10^5);
MATHEMATICA
L={1}; n=1; While[Length@L < 100, t = ++n; While[{1} != Union@ GCD[t, L], n++; t = t*10^IntegerLength[n] + n]; AppendTo[L, t]]; L (* Giovanni Resta, Apr 18 2016 *)
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
Paolo P. Lava, Apr 18 2016
STATUS
approved