A011531 Numbers that contain a digit 1 in their decimal representation.
1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 21, 31, 41, 51, 61, 71, 81, 91, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Index entries for 10-automatic sequences.
Crossrefs
Programs
-
GAP
Filtered([1..140],n->1 in ListOfDigits(n)); # Muniru A Asiru, Feb 23 2019
-
Haskell
a011531 n = a011531_list !! (n-1) a011531_list = filter ((elem '1') . show) [0..] -- Reinhard Zumkeller, Feb 05 2012
-
Magma
[n: n in [0..500] | 1 in Intseq(n) ]; // Vincenzo Librandi, Jan 11 2016
-
Maple
M:= 3: # to get all terms of up to M digits B:= {1}: A:= {1}: for i from 2 to M do B:= map(t -> seq(10*t+j,j=0..9),B) union {seq(10*x+1,x=2*10^(i-2)..10^(i-1)-1)}: A:= A union B; od: sort(convert(A,list)); # Robert Israel, Jan 10 2016 # second program: A011531 := proc(n) if n = 1 then 1; else for a from procname(n-1)+1 do if nops(convert(convert(a,base,10),set) intersect {1}) > 0 then return a; end if; end do: end if; end proc: # R. J. Mathar, Jul 31 2016
-
Mathematica
Select[Range[600] - 1, DigitCount[#, 10, 1] > 0 &] (* Vincenzo Librandi, Jan 11 2016 *)
-
PARI
is_A011531(n)=setsearch(Set(digits(n)),1) \\ M. F. Hasler, Jan 10 2016
-
Python
def aupto(nn): return [m for m in range(1, nn+1) if '1' in str(m)] print(aupto(133)) # Michael S. Branicky, Jan 10 2021
-
Scala
(0 to 119).filter(.toString.indexOf('1') > -1) // _Alonso del Arte, Jan 12 2020
Formula
a(n) ~ n. - Charles R Greathouse IV, Nov 02 2022
Comments