login
A190301
Smallest number h such that n*h is a repunit (A002275), or 0 if no such h exists.
4
1, 0, 37, 0, 0, 0, 15873, 0, 12345679, 0, 1, 0, 8547, 0, 0, 0, 65359477124183, 0, 5847953216374269, 0, 5291, 0, 48309178743961352657, 0, 0, 0, 4115226337448559670781893, 0, 38314176245210727969348659, 0, 3584229390681, 0, 3367, 0, 0, 0, 3, 0, 2849, 0, 271, 0
OFFSET
1,3
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..1001 (first 300 terms from T. D. Noe)
EXAMPLE
For n = 7: a(7) = 15873 because 7 * 15873 = 111111. Repunit 111111 is the smallest repunit with prime factor 7.
MATHEMATICA
Table[If[GCD[n, 10] > 1, 0, k = MultiplicativeOrder[10, 9*n]; (10^k - 1)/(9*n)], {n, 100}] (* T. D. Noe, May 08 2011 *)
PROG
(PARI) a(n)=if(gcd(n, 10)>1, 0, (10^znorder(Mod(10, 9*n))-1)/9/n) \\ Charles R Greathouse IV, Aug 28 2016
CROSSREFS
Cf. A084681 (repunit length), A216479 (the repunit).
Cf. A050782 = the smallest number h such that n*h is palindromic number, A083117 = the smallest number h such that n*h is repdigit number.
Sequence in context: A058432 A058458 A180463 * A077575 A215258 A176795
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, May 07 2011
STATUS
approved