login
This site is supported by donations to The OEIS Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A000030 Initial digit of n.
(Formerly M0470)
142

%I M0470

%S 0,1,2,3,4,5,6,7,8,9,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,3,3,3,3,

%T 3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,

%U 6,6,7,7,7,7,7,7,7,7,7,7,8,8,8,8,8

%N Initial digit of n.

%C n is the concatenation of a(n) and A217657(n). - _Reinhard Zumkeller_, Oct 10 2012

%C Equivalent definition: The initial a(0) = 0 is followed by each digit in S = {1,...,9} once. Thereafter, repeat 10 times each digit in S. Then, repeat 100 times each digit in S, etc.

%D N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

%H David W. Wilson, <a href="/A000030/b000030.txt">Table of n, a(n) for n = 0..10000</a>

%H A. Cobham, <a href="http://dx.doi.org/10.1007/BF01706087">Uniform Tag Sequences</a>, Mathematical Systems Theory, 6 (1972), 164-192.

%F a(n) = [n / 10^([log_10(n)])] where [] denotes floor and log_10(n) is the logarithm is base 10. - Dan Fux (dan.fux(AT)OpenGaia.com or danfux(AT)OpenGaia.com), Apr 07 2001

%F a(n) = k for k*10^j <= n < (k+1)*10^j, for some j. - _M. F. Hasler_, Mar 23 2015

%e 23 begins with a 2, so a(23) = 2.

%p Ldigit:=proc(n) local v; v:=convert(n,base,10); v[-1]; end;

%p [seq(Ldigit(n),n=0..200)]; # _N. J. A. Sloane_, Feb 10 2017

%t Join[{0},First[IntegerDigits[#]]&/@Range[90]] (* _Harvey P. Dale_, Mar 01 2011 *)

%t Table[Floor[n/10^(Floor[Log10[n]])], {n, 1, 50}] (* _G. C. Greubel_, May 16 2017 *)

%o (PARI) a(n)=if(n<1,0,if(n<10,n,a(n\10)))

%o (PARI) A000030(n)=Vecsmall(Str(n))[1]-48 \\ _M. F. Hasler_, Jun 19 2011

%o (PARI) A000030(n)=digits(n)[1] \\ _M. F. Hasler_, Mar 23 2015

%o (Haskell)

%o a000030 = until (< 10) (`div` 10)

%o -- _Reinhard Zumkeller_, Feb 20 2012, Feb 11 2011

%Y Cf. A061681, A130571, A109453, A134010, A052038.

%Y Cf. A002993, A089951, A002994, A143464, A098174, A098175, A072543, A072544, A073600, A073601, A037904. - _Reinhard Zumkeller_, Aug 17 2008

%K nonn,base,easy,nice,look

%O 0,3

%A _N. J. A. Sloane_, _Simon Plouffe_

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

License Agreements, Terms of Use, Privacy Policy .

Last modified February 17 22:32 EST 2018. Contains 299297 sequences. (Running on oeis4.)