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.

A011531 Numbers that contain a digit 1 in their decimal representation.

This page as a plain text file.
%I A011531 #59 Nov 07 2022 20:11:38
%S A011531 1,10,11,12,13,14,15,16,17,18,19,21,31,41,51,61,71,81,91,100,101,102,
%T A011531 103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,
%U A011531 120,121,122,123,124,125,126,127,128,129,130,131,132,133
%N A011531 Numbers that contain a digit 1 in their decimal representation.
%C A011531 A121042(a(n)) = 1. - _Reinhard Zumkeller_, Jul 21 2006
%C A011531 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 A011531 Reinhard Zumkeller, <a href="/A011531/b011531.txt">Table of n, a(n) for n = 1..10000</a>
%H A011531 <a href="/index/Ar#10-automatic">Index entries for 10-automatic sequences</a>.
%F A011531 a(n) ~ n. - _Charles R Greathouse IV_, Nov 02 2022
%p A011531 M:= 3: # to get all terms of up to M digits
%p A011531 B:= {1}: A:= {1}:
%p A011531 for i from 2 to M do
%p A011531    B:= map(t -> seq(10*t+j,j=0..9),B) union
%p A011531       {seq(10*x+1,x=2*10^(i-2)..10^(i-1)-1)}:
%p A011531    A:= A union B;
%p A011531 od:
%p A011531 sort(convert(A,list)); # _Robert Israel_, Jan 10 2016
%p A011531 # second program:
%p A011531 A011531 := proc(n)
%p A011531     if n = 1 then
%p A011531         1;
%p A011531     else
%p A011531         for a from procname(n-1)+1 do
%p A011531             if nops(convert(convert(a,base,10),set) intersect {1}) > 0 then
%p A011531                 return a;
%p A011531             end if;
%p A011531         end do:
%p A011531     end if;
%p A011531 end proc: # _R. J. Mathar_, Jul 31 2016
%t A011531 Select[Range[600] - 1, DigitCount[#, 10, 1] > 0 &] (* _Vincenzo Librandi_, Jan 11 2016 *)
%o A011531 (Haskell)
%o A011531 a011531 n = a011531_list !! (n-1)
%o A011531 a011531_list = filter ((elem '1') . show) [0..]
%o A011531 -- _Reinhard Zumkeller_, Feb 05 2012
%o A011531 (PARI) is_A011531(n)=setsearch(Set(digits(n)),1) \\ _M. F. Hasler_, Jan 10 2016
%o A011531 (Magma) [n: n in [0..500] | 1 in Intseq(n) ]; // _Vincenzo Librandi_, Jan 11 2016
%o A011531 (GAP) Filtered([1..140],n->1 in ListOfDigits(n)); # _Muniru A Asiru_, Feb 23 2019
%o A011531 (Scala) (0 to 119).filter(_.toString.indexOf('1') > -1) // _Alonso del Arte_, Jan 12 2020
%o A011531 (Python)
%o A011531 def aupto(nn): return [m for m in range(1, nn+1) if '1' in str(m)]
%o A011531 print(aupto(133)) # _Michael S. Branicky_, Jan 10 2021
%Y A011531 Cf. A121041, A121022, A121023, A121024, A121025, A121026, A121027, A121028, A121029, A121030, A121031, A121032, A121033, A121034, A121035, A121036, A121037, A121038, A121039, A121040.
%Y A011531 Cf. A052383 (complement), A062634 (a subsequence).
%K A011531 nonn,base,easy
%O A011531 1,2
%A A011531 _N. J. A. Sloane_