%I #26 Aug 02 2024 12:03:56
%S 1,3,6,9,2,6,16,18,6,22,27,28,15,6,3,6,5,21,46,42,48,13,18,58,60,18,
%T 33,66,35,8,6,13,81,41,84,44,6,15,96,18,4,34,53,108,3,112,18,48,22,15,
%U 42,21,130,18,8,46,138,6,42,148,75,144,78,39,66,81,166,78,18,43,174,178
%N Least m such that repunit R_m is a multiple of A045572(n) (i.e., odd numbers not divisible by 5).
%H Charles R Greathouse IV, <a href="/A099679/b099679.txt">Table of n, a(n) for n = 1..10000</a>
%H Patrick de Geest, <a href="http://www.worldofnumbers.com/repunits.htm">Repunits and their prime factors</a>
%H T. Granlund, <a href="http://www.swox.com/gmp/fac10m.txt">Factors of 10^n - 1</a>
%H M. Kamada, <a href="https://stdkmd.net/nrr/repunit/">Factorizations of 11...11(Repunits)</a>
%H Y. Koide, <a href="https://repunit-koide.jimdofree.com/">Factorization of Repunit Numbers</a>
%H P. Yiu, <a href="http://math.fau.edu/yiu/RecreationalMathematics2003.pdf">Factorization of Repunits R_n for n<=50</a>, Appendix Chap. 18.5 pp. 173/360 in 'Recreational Mathematics'.
%t f[n_] := Block[{k = 1}, While[ Mod[(10^k - 1)/9, n] != 0, k++ ]; k]; f /@ Select[ 2Range[ 90] - 1, Mod[ #, 5] != 0 &] (* _Robert G. Wilson v_, Oct 27 2004 *)
%o (PARI) A(n)={ \\ Least m such that n | R_m
%o my(f=factor(n),s=1,t);
%o for(i=1,#f[,1],
%o if(f[i,1]==3,
%o t=3
%o ,
%o t=Mod(10,9*f[i,1]);
%o fordiv(f[i,1]-1,d,
%o if(t^d==1,t=d;break)
%o )
%o );
%o t*=f[i,1]^(f[i,2]-1);
%o s=lcm(s,t)
%o );
%o s
%o };
%o a(n)=A(10*(n>>2)+[-1, 1, 3, 7][n%4+1]) \\ Least m such that A045572(n) | R_m
%o \\ _Charles R Greathouse IV_, Jul 31 2011
%Y Cf. A002275, A045572.
%K nonn,easy
%O 1,2
%A _Lekraj Beedassy_, Oct 26 2004
%E Corrected and extended by _Robert G. Wilson v_, Oct 27 2004