A171901 Numbers with at least two identical neighboring digits in their decimal representation.
11, 22, 33, 44, 55, 66, 77, 88, 99, 100, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 122, 133, 144, 155, 166, 177, 188, 199, 200, 211, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 233, 244, 255, 266, 277, 288, 299, 300, 311, 322, 330, 331, 332, 333
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
import Data.List (elemIndices) a171901 n = a171901_list !! n a171901_list = elemIndices 0 a196368_list -- Reinhard Zumkeller, Oct 29 2001
-
Mathematica
Select[Range[350],SequenceCount[IntegerDigits[#],{_,x_,x_,_}]>0&] (* The program uses the SequenceCount function from Mathematica version 10 *) (* Harvey P. Dale, May 14 2016 *)
-
Python
def is_ok(n): s = str(n) return any(s[i] == s[i - 1] for i in range(1, len(s))) A171901_list = [n for n in range(400) if is_ok(n)] # Chai Wah Wu, Feb 14 2019
Comments