OFFSET
1,2
EXAMPLE
a(1) = 1, a(2) = 12 and the product a(1)*a(2) = 12 have n = 1 in common;
a(2) = 12, a(3) = 23 and the product a(2)*a(3) = 276 have n = 2 in common;
a(3) = 23, a(4) = 134 and the product a(3)*a(4) = 3082 have n = 3 in common;
a(4) = 134, a(5) = 145 and the product a(4)*a(5) = 19430 have n = 4 in common;
...
a(120) = 11912061, a(121) = 1012120 and their product 12056435179320 share the substring 120; etc.
MATHEMATICA
a[1]=1; a[n_]:=a[n]=Block[{k=1}, While[MemberQ[Array[a, n-1], k]||!(Q=StringContainsQ)[(T=ToString)@k, T@n]||!And@@(Q[T@#, T[n-1]]&/@{a[n-1], k, a[n-1]*k}), k++]; k]; Array[a, 26] (* Giorgos Kalogeropoulos, May 12 2022 *)
CROSSREFS
KEYWORD
base,nonn
AUTHOR
Jean-Marc Falcoz and Eric Angelini, Apr 10 2020
STATUS
approved