login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A011531 Numbers that contain a digit 1 in their decimal representation. 73

%I #59 Nov 07 2022 20:11:38

%S 1,10,11,12,13,14,15,16,17,18,19,21,31,41,51,61,71,81,91,100,101,102,

%T 103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,

%U 120,121,122,123,124,125,126,127,128,129,130,131,132,133

%N Numbers that contain a digit 1 in their decimal representation.

%C A121042(a(n)) = 1. - _Reinhard Zumkeller_, Jul 21 2006

%C See A043493 for numbers that contain a single digit '1'. A subsequence of numbers having a digit that divides all other digits, A263314. - _M. F. Hasler_, Jan 11 2016

%H Reinhard Zumkeller, <a href="/A011531/b011531.txt">Table of n, a(n) for n = 1..10000</a>

%H <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>.

%F a(n) ~ n. - _Charles R Greathouse IV_, Nov 02 2022

%p M:= 3: # to get all terms of up to M digits

%p B:= {1}: A:= {1}:

%p for i from 2 to M do

%p B:= map(t -> seq(10*t+j,j=0..9),B) union

%p {seq(10*x+1,x=2*10^(i-2)..10^(i-1)-1)}:

%p A:= A union B;

%p od:

%p sort(convert(A,list)); # _Robert Israel_, Jan 10 2016

%p # second program:

%p A011531 := proc(n)

%p if n = 1 then

%p 1;

%p else

%p for a from procname(n-1)+1 do

%p if nops(convert(convert(a,base,10),set) intersect {1}) > 0 then

%p return a;

%p end if;

%p end do:

%p end if;

%p end proc: # _R. J. Mathar_, Jul 31 2016

%t Select[Range[600] - 1, DigitCount[#, 10, 1] > 0 &] (* _Vincenzo Librandi_, Jan 11 2016 *)

%o (Haskell)

%o a011531 n = a011531_list !! (n-1)

%o a011531_list = filter ((elem '1') . show) [0..]

%o -- _Reinhard Zumkeller_, Feb 05 2012

%o (PARI) is_A011531(n)=setsearch(Set(digits(n)),1) \\ _M. F. Hasler_, Jan 10 2016

%o (Magma) [n: n in [0..500] | 1 in Intseq(n) ]; // _Vincenzo Librandi_, Jan 11 2016

%o (GAP) Filtered([1..140],n->1 in ListOfDigits(n)); # _Muniru A Asiru_, Feb 23 2019

%o (Scala) (0 to 119).filter(_.toString.indexOf('1') > -1) // _Alonso del Arte_, Jan 12 2020

%o (Python)

%o def aupto(nn): return [m for m in range(1, nn+1) if '1' in str(m)]

%o print(aupto(133)) # _Michael S. Branicky_, Jan 10 2021

%Y Cf. A121041, A121022, A121023, A121024, A121025, A121026, A121027, A121028, A121029, A121030, A121031, A121032, A121033, A121034, A121035, A121036, A121037, A121038, A121039, A121040.

%Y Cf. A052383 (complement), A062634 (a subsequence).

%K nonn,base,easy

%O 1,2

%A _N. J. A. Sloane_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 22:17 EDT 2024. Contains 371964 sequences. (Running on oeis4.)