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.

Showing 1-2 of 2 results.

A284602 Numbers k such that the decimal representation of 1/k is either finite or has even period.

Original entry on oeis.org

1, 2, 4, 5, 7, 8, 10, 11, 13, 14, 16, 17, 19, 20, 21, 22, 23, 25, 26, 28, 29, 32, 33, 34, 35, 38, 39, 40, 42, 44, 46, 47, 49, 50, 51, 52, 55, 56, 57, 58, 59, 61, 63, 64, 65, 66, 68, 69, 70, 73, 76, 77, 78, 80, 84, 85, 87, 88, 89, 91, 92, 94, 95, 97, 98, 99, 100, 101, 102, 103, 104, 105, 109, 110, 112, 113, 114, 115
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 30 2017

Keywords

Comments

All numbers of the form 2^i*5^j with i, j >= 0 are in this sequence (numbers with a finite decimal expansion).
From Robert G. Wilson v, Apr 02 2017: (Start)
If k is in the sequence, then so are 2k and 5k.
The complement of A284601.
Primitives: 1, 7, 11, 13, 17, 19, 21, 23, 29, 33, 39, 47, 49, 51, 57, 59, 61, 63, ..., .
(End)

Examples

			14 is in the sequence because 1/14 = 0.0714285(714285)..., whose period is 6, an even number.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[115], Mod[Length[RealDigits[1/#][[1, -1]]], 2] == 0 & ]

A284904 The number of integers k less than 2^n whose decimal representation of their reciprocals has an odd period.

Original entry on oeis.org

0, 0, 1, 2, 5, 10, 20, 40, 80, 150, 280, 522, 965, 1802, 3393, 6426, 12197, 23236, 44419, 85116, 163543, 314837, 607440, 1174134, 2273619, 4409116, 8561931, 16646790, 32404446, 63145533, 123173667
Offset: 0

Views

Author

Robert G. Wilson v, Apr 05 2017

Keywords

Comments

The number of terms in A284601 less than 2^n.

Examples

			a(5)=10 because the reciprocals of {3, 6, 9, 12, 15, 18, 24, 27, 30, 31} all have an odd period, i.e., {1, 1, 1, 1, 1, 1, 1, 3, 1, 15}, respectively.
		

Crossrefs

Cf. A284601.

Programs

  • Mathematica
    f[n_] := Mod[ Length[ RealDigits[1/n][[1, -1]]], 2]; s = 0; k = 1; lst = {}; Do[ While[k < 2^n, s += f@k; k++]; AppendTo[lst, s], {n, 0, 18}] (* or *)
    g[n_] := Mod[ MultiplicativeOrder[10, FixedPoint[ Quotient[#, GCD[#, 10]] &, n]], 2]; h[n_] := Length@ Most@ Flatten@ Table[2^i*5^j, {i, 0, n}, {j, 0, Log[5, 2^(n -i)]}]; s = 0; k = 1; lst = {}; Do[ While[k < 2^n, s += g@k; k++]; AppendTo[lst, s - h[n]], {n, 0, 30}]

Formula

log(a(n)) is approximately 0.33 + 0.727*n - 0.643*sqrt(n).
Showing 1-2 of 2 results.