login
Starting with 1, smallest integer not having a zero and not yet in the sequence such that two neighboring digits of the sequence multiply to a composite.
1

%I #27 Feb 03 2025 13:54:22

%S 1,4,2,3,5,6,7,8,9,14,16,18,19,22,23,24,25,26,27,28,29,32,33,34,35,36,

%T 37,38,39,41,42,43,44,45,46,47,48,49,52,53,54,55,56,57,58,59,61,62,63,

%U 64,65,66,67,68,69,72,73,74,75,76,77,78,79,81,82,83,84

%N Starting with 1, smallest integer not having a zero and not yet in the sequence such that two neighboring digits of the sequence multiply to a composite.

%C The number after 1 has to be 4, because the product 1*4 must be composite.

%C Then 2 is OK, because 4*2 = 8 is composite.

%C Then 3, because 2*3 = 6 is composite, and so on.

%C Note that 14 is the term after 9 because 10 is now the smallest candidate, but 10 has a 0 digit, 11 consists of two unit digits, and 12 and 13 have digit products 2 and 3, which are prime. - _T. D. Noe_, Apr 25 2012

%H Dominic McCarty, <a href="/A182273/b182273.txt">Table of n, a(n) for n = 1..10000</a>

%o (Python)

%o a, z = [1], [1,2,3,5,7]

%o while len(a) < 100:

%o k, s = 2, "2"

%o while (k in a) or ("0" in s) or (a[-1] % 10 * int(s[0]) in z) or \

%o any(int(s[n]) * int(s[n+1]) in z for n in range(0, len(s)-1)): s, k = str(k+1), k+1

%o a.append(k)

%o print(a) # _Dominic McCarty_, Jan 30 2025

%Y Cf. A182272.

%K nonn,base,easy,nice

%O 1,2

%A _Jim Nastos_ and _Eric Angelini_, Apr 22 2012