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”).
%I #15 Sep 16 2023 15:30:51
%S 1,2,12,3,13,113,1113,7,17,117,23,123,30,5,15,25,35,27,31,131,1131,29,
%T 129,32,20,21,33,11,110,22,24,26,28,37,137,1137,34,42,36,38,19,119,47,
%U 147,39,43,143,111,53,153,63,57,73,173,1173,83,183,61,161,67,167,1167,93,103,1030,45,50,51
%N a(1) = 1, a(2) = 2; for n > 2, a(n) is the smallest positive number that has not yet appeared whose string value contains at least one prime factor of a(n-1).
%C This is a base-10 string version of the EKG sequence A064413. Any number that contains only nonprime digits, does not contain any substring that is prime, and is not itself a prime can never appear, e.g., 4, 6, 8, 9, 10, 14. The first number to contain only digits 4, 6, 8 or 9 that does appear is a(524) = 489, as it contains the substring 89 which is prime and is a factor of a(523) = 534.
%C The fixed points begin 15, 72, 248, 249, 670, 1055, 1056, 1377, although it is likely their total number is unbounded.
%H Scott R. Shannon, <a href="/A365703/b365703.txt">Table of n, a(n) for n = 1..10000</a>.
%e a(3) = 12 as a(2) = 2 and "12" is the smallest unused number to contain "2".
%e a(4) = 3 as a(3) = 12 = 2*3, and "3" is the smallest unused number to contain "3".
%e a(5) = 13 as a(4) = 3 and "13" is the smallest unused number to contain "3".
%e a(6) = 113 as a(5) = 13 and "113" is the smallest unused number to contain "13".
%t nn = 120; c[_] := False; f[x_] := FactorInteger[x][[All, 1]];
%t g[x_] := g[x] = Select[FromDigits /@ Union@ Rest@ Subsequences@ IntegerDigits[x], PrimeQ];
%t Array[Set[{a[#], c[#]}, {#, True}] &, 2]; j = 2; u = 3;
%t Do[Set[{j, k}, {f[j], u}];
%t While[Or[c[k], # == {}, ! IntersectingQ[j, #]] &[g[k]], k++];
%t Set[{a[n], c[k], j}, {k, True, k}];
%t If[k == u, While[Or[c[u], g[u] == {}], u++]], {n, 3, nn}];
%t Array[a, nn] (* _Michael De Vlieger_, Sep 16 2023 *)
%Y Cf. A064413, A027748, A027746.
%K nonn,base
%O 1,2
%A _Scott R. Shannon_, Sep 16 2023