cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A342382 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.

Original entry on oeis.org

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, 29, 28, 30, 31, 34, 37, 35, 36, 38, 39, 32, 40, 41, 43, 42, 45, 48, 52, 49, 50, 47, 51, 46, 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
Offset: 0

Views

Author

Scott R. Shannon, Mar 09 2021

Keywords

Comments

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.

Examples

			a(1) = 1 as 1 has one distinct digit and a(0)*1 = 0*1 = 0 which has one distinct digit 0.
a(10) = 10 as 10 has two distinct digits and a(9)*10 = 9*10 = 90 which has two distinct digits 9 and 0.
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.
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.
		

Crossrefs

Programs

  • Mathematica
    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 *)

Extensions

Offset corrected by N. J. A. Sloane, Jun 16 2021