login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(0) = 0; for n > 0, a(n) is the least positive integer not occurring earlier such that both the digits in a(n) and the digits in a(n-1)*a(n) are all distinct.
5

%I #12 Jun 16 2021 15:32:44

%S 0,1,2,3,4,5,6,7,8,9,10,12,13,14,15,16,19,18,17,20,21,23,26,24,27,25,

%T 29,28,30,31,34,37,35,36,38,39,32,40,41,43,42,45,48,52,49,50,47,51,46,

%U 53,56,54,57,60,58,62,59,68,64,61,65,63,72,69,67,70,71,73,74,76,78,80,79,82,75,81,83

%N a(0) = 0; for n > 0, a(n) is the least positive integer not occurring earlier such that both the digits in a(n) and the digits in a(n-1)*a(n) are all distinct.

%C The sequence is finite, the 18351st term being a(18350) = 41987 beyond which no number exists that has not occurred earlier that has all distinct digits and that 41987*a(n) has all distinct digits. The maximum term is a(18097) = 219087.

%H Scott R. Shannon, <a href="/A342382/a342382.png">Image of the 18351 terms</a>. The green line is a(n) = n.

%e a(1) = 1 as 1 has one distinct digit and a(0)*1 = 0*1 = 0 which has one distinct digit 0.

%e a(10) = 10 as 10 has two distinct digits and a(9)*10 = 9*10 = 90 which has two distinct digits 9 and 0.

%e a(11) = 12 as 12 has two distinct digits and a(10)*12 = 10*12 = 120 which has three distinct digits. Note that 11 is the first skipped number as 11 has 1 as a duplicate digit.

%e a(16) = 19 as 19 has two distinct digits and a(15)*19 = 16*19 = 304 which has three distinct digits. Note that 17 and 18 are skipped as 16*17 = 272 while 16*18 = 288, both of which contain duplicate digits.

%t Block[{a = {0}, k, m = 42000}, Do[k = 1; While[Nand[FreeQ[a, k], AllTrue[DigitCount[a[[-1]]*k], # < 2 &], AllTrue[DigitCount[k], # < 2 &]], If[k > m, Break[]]; k++]; If[k > m, Break[]]; AppendTo[a, k], {i, 76}]; a] (* _Michael De Vlieger_, Mar 11 2021 *)

%Y Cf. A338466, A010784, A043537, A043096, A276633, A002378.

%K nonn,base,fini

%O 0,3

%A _Scott R. Shannon_, Mar 09 2021

%E Offset corrected by _N. J. A. Sloane_, Jun 16 2021