OFFSET
0,4
COMMENTS
Reptend length of 1/(2n+1) in hexadecimal.
a(n) <= n; it appears that equality holds if and only if n=1 or is in A163778. - Robert Israel, Apr 02 2018
From Jianing Song, Dec 24 2022: (Start)
a(n) <= psi(2*n+1)/2 <= n. a(n) = psi(2*n+1)/2 if and only if the multiplicative order of 2 modulo 2*n+1 is psi(2*n+1) or psi(2*n+1)/2, and psi(2*n+1) == 2 (mod 4).
a(n) = n if and only if A053447(n) = n and A053447(n) is odd. As a result, a(n) = n if and only if 2*n+1 = p is a prime congruent to 3 modulo 4, and the multiplicative order of 2 modulo p is p-1 or (p-1)/2 (p-1 if p == 3 (mod 8), (p-1)/2 if p == 7 (mod 8)). Such primes p are listed in A105876. (End)
LINKS
Alois P. Heinz, Table of n, a(n) for n = 0..10000 (first 1001 terms from Jianing Song)
Eric Weisstein's World of Mathematics, Multiplicative Order
FORMULA
a(n) = A002326(n)/gcd(A002326(n),4) = A053447(n)/gcd(A053447(n),2). [Corrected by Jianing Song, Dec 24 2022]
EXAMPLE
The fraction 1/13 is equal to 0.13B13B... in hexadecimal, so a(6) = 3.
MAPLE
seq(numtheory:-order(16, 2*n+1), n=0..100); # Robert Israel, Apr 02 2018
MATHEMATICA
Table[MultiplicativeOrder[16, 2 n + 1], {n, 0, 150}] (* Vincenzo Librandi, Apr 03 2018 *)
PROG
(PARI) a(n) = znorder(Mod(16, 2*n+1)) \\ Felix Fröhlich, Apr 02 2018
(Magma) [1] cat [ Modorder(16, 2*n+1): n in [1..100]]; // Vincenzo Librandi, Apr 03 2018
(GAP) List([0..100], n->OrderMod(16, 2*n+1)); # Muniru A Asiru, Feb 25 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Jianing Song, Apr 02 2018
STATUS
approved