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.

A255873 The first nonzero digit of n/7.

This page as a plain text file.
%I A255873 #29 Aug 30 2016 09:48:41
%S A255873 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 A255873 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 A255873 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 A255873 The first nonzero digit of n/7.
%H A255873 Alois P. Heinz, <a href="/A255873/b255873.txt">Table of n, a(n) for n = 1..10000</a>
%e A255873 The leading (most significant) digit of 22/7 in A068028 is 3, so a(22)=3.
%p A255873 A255873 := proc(n)
%p A255873     local nshf ;
%p A255873     nshf := n/7 ;
%p A255873     while nshf < 1 do
%p A255873         nshf := 10*nshf;
%p A255873     end do;
%p A255873     while nshf >= 10 do
%p A255873         nshf := nshf/10;
%p A255873     end do;
%p A255873     floor(nshf) ;
%p A255873 end proc: # _R. J. Mathar_, May 28 2016
%t A255873 f[n_] := RealDigits[n/7, 10, 9][[1, 1]]; Array[f, 105] (* _Robert G. Wilson v_, Mar 08 2015 *)
%o A255873 (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 A255873 Cf. A020806 (1/7), A068028 (22/7), A216606 (360/7).
%K A255873 nonn,base
%O A255873 1,2
%A A255873 _Kit Scriven_, Mar 08 2015