A358054 Starting with 0, smallest integer not yet in the sequence such that no two neighboring digits differ by 1.
0, 2, 4, 1, 3, 5, 7, 9, 6, 8, 11, 13, 14, 15, 16, 17, 18, 19, 20, 22, 24, 25, 26, 27, 28, 29, 30, 31, 33, 35, 36, 37, 38, 39, 40, 41, 42, 44, 46, 47, 48, 49, 50, 51, 52, 53, 55, 57, 58, 59, 60, 61, 62, 63, 64, 66, 68, 69, 70, 71, 72, 73, 74, 75, 77, 79, 90, 80
Offset: 0
Examples
a(0) = 0. a(1) = 2. Cannot be 1. Smallest integer that can be placed = 2. a(2) = 4. Cannot be 1 or 3. Smallest integer that can be placed = 4. a(3) = 1. Cannot be 3 or 5. Smallest integer that can be placed = 1. ... (Nonnegative integers < 86, disregarding invalid integers, have already appeared.) a(74) = 86. a(75) = 88. Cannot be 87, as it contains adjacent digits that differ by 1. Smallest integer that can be placed = 88. a(76) = 111. Cannot be 89, 90->99 (9 and 8 differ by 1), or 100->110 (1 and 0 are adjacent and differ by 1). Smallest integer that can be placed = 111.
Links
- Gavin Lupo, Table of n, a(n) for n = 0..5000
- David A. Corneth, PARI program
Programs
-
PARI
\\ See PARI link \\ David A. Corneth, Oct 31 2022
Comments