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.

A369841 n-th digit of the decimal expansion of 1/n, with the digit to the left of the decimal point counted as the first digit.

Original entry on oeis.org

1, 5, 3, 0, 0, 6, 7, 0, 1, 0, 9, 3, 3, 5, 6, 0, 7, 5, 1, 0, 4, 5, 3, 6, 0, 5, 3, 5, 1, 3, 9, 0, 3, 5, 5, 7, 7, 5, 2, 0, 9, 0, 3, 2, 2, 5, 7, 3, 8, 0, 1, 9, 3, 1, 1, 1, 1, 5, 1, 6, 9, 5, 1, 0, 3, 5, 7, 4, 1, 4, 9, 8, 3, 5, 3, 3, 9, 2, 1, 0, 7, 5, 3, 0, 7, 5, 1, 6, 1, 1, 9, 0, 1, 5, 5, 6, 7, 6, 1, 0
Offset: 1

Views

Author

Itamar Zamir, Feb 03 2024

Keywords

Comments

The digits seem to occur with unequal frequency. In the limit as n increases, it seems that the digits, sorted in decreasing order of frequency of occurrence, are 0,5,1,3,7,9,2,6,8,4.

Examples

			a(2) = 5 since 1/2 = 0.5 and the 2nd digit of "0.5" (including the 0) is 5.
a(7) = 7 since 1/7 = 0.142857142857... and its 7th digit is 7.
From _Jon E. Schoenfield_, Feb 03 2024: (Start)
In each row of the following table, the n-th digit is surrounded by spaces:
.
   n         1/n         a(n)
  --  -----------------  ----
   1   1 .0000000000...    1
   2  0. 5 000000000...    5
   3  0.3 3 33333333...    3
   4  0.25 0 0000000...    0
   5  0.200 0 000000...    0
   6  0.1666 6 66666...    6
   7  0.14284 7 1428...    7
   8  0.125000 0 000...    0
   9  0.1111111 1 11...    1
  10  0.10000000 0 0...    0
(End)
		

Crossrefs

Cf. A061480.

Programs

  • Mathematica
    Table[Mod[Floor[10^(n-1)/n],10],{n,100}] (* James C. McMahon, Feb 04 2024 *)
  • Python
    def a(n): return (10**(n-1)//n)%10
    print([a(n) for n in range(1, 101)]) # Michael S. Branicky, Feb 03 2024

Formula

a(n) = floor((10^(n-1))/n) mod 10.