The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
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!)
A255873 The first nonzero digit of n/7. 1

%I #29 Aug 30 2016 09:48:41

%S 1,2,4,5,7,8,1,1,1,1,1,1,1,2,2,2,2,2,2,2,3,3,3,3,3,3,3,4,4,4,4,4,4,4,

%T 5,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,8,8,8,8,8,8,8,9,9,9,9,9,9,

%U 9,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1

%N The first nonzero digit of n/7.

%H Alois P. Heinz, <a href="/A255873/b255873.txt">Table of n, a(n) for n = 1..10000</a>

%e The leading (most significant) digit of 22/7 in A068028 is 3, so a(22)=3.

%p A255873 := proc(n)

%p local nshf ;

%p nshf := n/7 ;

%p while nshf < 1 do

%p nshf := 10*nshf;

%p end do;

%p while nshf >= 10 do

%p nshf := nshf/10;

%p end do;

%p floor(nshf) ;

%p end proc: # _R. J. Mathar_, May 28 2016

%t f[n_] := RealDigits[n/7, 10, 9][[1, 1]]; Array[f, 105] (* _Robert G. Wilson v_, Mar 08 2015 *)

%o (PARI) a(n) = {my(x = n/7.0); if (x < 1, x *= 10); while (x >= 10, x /= 10); floor(x);} \\ _Michel Marcus_, Mar 12 2015

%Y Cf. A020806 (1/7), A068028 (22/7), A216606 (360/7).

%K nonn,base

%O 1,2

%A _Kit Scriven_, Mar 08 2015

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 June 8 02:10 EDT 2024. Contains 373206 sequences. (Running on oeis4.)