A372799 Smallest prime p such that the multiplicative order of 9 modulo p is 2*n, or 0 if no such prime exists.
5, 13, 67, 313, 41, 61, 883, 433, 271, 2161, 683, 193, 1223, 8317, 2131, 769, 2551, 1621, 8513, 2521, 8779, 4357, 5843, 3889, 7451, 16069, 3079, 19993, 14327, 661, 23747, 95617, 42703, 2857, 15401, 17209, 2887, 7297, 547, 13441, 4019, 757, 41453, 29833, 54631, 31741, 20399
Offset: 1
Keywords
Examples
In the following examples let () denote the reptend. The prime numbers themselves and the fractions are written out in decimal. The base-9 expansion of 1/5 is 0.(17), so the reptend has length 2 = (5-1)/2. Also, the base-9 expansions of 1/5 = 0.(17), 2/5 = (0.35), 3/5 = 0.(53) and 4/5 = 0.(71) have two cycles 17 and 35. 5 is the smallest such prime, so a(1) = 5. The base-9 expansion of 1/13 is 0.(062), so the reptend has length 3 = (13-1)/4. Also, the base-9 expansions of 1/13, 2/13, ..., 12/13 have four cycles 062, 134, 268 and 475. 13 is the smallest such prime, so a(2) = 13. The base-9 expansion of 1/67 is 0.(01178285332), so the reptend has length 11 = (67-1)/6. Also, the base-9 expansions of 1/67, 2/67, ..., 66/67 have six cycles 01178285332, 02367581664, 03556877106, 04746273438, 07224865213 and 08414261545. 67 is the smallest such prime, so a(3) = 67.
Links
- Jean-François Alcover, Table of n, a(n) for n = 1..1000
Crossrefs
Programs
-
Mathematica
a[n_] := a[n] = For[p = 2, True, p = NextPrime[p], If[MultiplicativeOrder[9, p] == (p-1)/(2n), Return[p]]]; Table[Print[n, " ", a[n]]; a[n], {n, 1, 100}] (* Jean-François Alcover, Nov 24 2024 *)
-
PARI
a(n,{base=9}) = forprime(p=2, oo, if((base%p) && znorder(Mod(base,p)) == (p-1)/(n * if(issquare(base), 2, 1)), return(p)))
Comments