A370757 a(n) is the least k > 0 such that 1/n and 1/k have equivalent repeating decimal digits.
1, 1, 3, 1, 1, 6, 7, 1, 9, 1, 11, 3, 13, 7, 6, 1, 17, 18, 19, 1, 21, 22, 23, 6, 1, 26, 27, 7, 29, 3, 31, 1, 33, 17, 7, 36, 37, 19, 39, 1, 41, 42, 43, 44, 45, 23, 47, 3, 49, 1, 51, 13, 53, 54, 55, 7, 57, 29, 59, 6, 61, 31, 63, 1, 26, 66, 67, 17, 69, 7, 71, 72
Offset: 1
Examples
The first terms, alongside the decimal expansion of 1/n with its repeating decimal digits in parentheses, are: n a(n) 1/n -- ---- ----------- 1 1 1.(0) 2 1 0.5(0) 3 3 0.(3) 4 1 0.25(0) 5 1 0.2(0) 6 6 0.1(6) 7 7 0.(142857) 8 1 0.125(0) 9 9 0.(1) 10 1 0.1(0) 11 11 0.(09) 12 3 0.08(3) 13 13 0.(076923) 14 7 0.07(142857) 15 6 0.0(6)
Links
- Rémy Sigrist, Table of n, a(n) for n = 1..10000
- Rémy Sigrist, PARI program
- Index entries for sequences related to decimal expansion of 1/n
Crossrefs
Programs
-
PARI
\\ See Links section.
-
Python
from itertools import count from sympy import multiplicity, n_order def A370757(n): m2, m5 = (~n & n-1).bit_length(), multiplicity(5,n) r = max(m2,m5) w, m = 10**r, 10**(t:=n_order(10,n2) if (n2:=(n>>m2)//5**m5)>1 else 1)-1 c = w//n s = str(m*w//n-c*m).zfill(t) l = len(s) for k in count(1): m2, m5 = (~k & k-1).bit_length(), multiplicity(5,k) r = max(m2,m5) w, m = 10**r, 10**(t:=n_order(10,k2) if (k2:=(k>>m2)//5**m5)>1 else 1)-1 c = w//k if any(s[i:]+s[:i] == str(m*w//k-c*m).zfill(t) for i in range(l)): return k # Chai Wah Wu, Mar 03 2024
Comments