OFFSET
1,2
COMMENTS
For a given a(n)>0, all of the values of k such that (10^k-1)/9=0 mod prime(n)^2 is given by the sequence a(n)*A000027, i.e. integral multiples of a(n). For example, for n=2, prime(2)=3, a(n)=9, the set of values of k for which (10^k-1)/9=0 mod 3^2 is 9*A000027=9,18,27,36,45,...
The union of the collection of sequences formed from the nonzero terms of a(n)*A000027, gives the values of k for which (10^k-1)/9 is not squarefree, see A046412. All of terms of the sequence a(n) are integer multiples of prime(n) for primes <1000 except for a(93)=486 where prime(93)=487. Conjecture: there are no 0 terms after a(3).
That conjecture is easily proved, for a(n) is just the multiplicative order of 10 modulo (prime(n))^2 for n>3. - Jeppe Stig Nielsen, Dec 28 2015
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(2)=9 since 9 is least value of k for which (10^k-1)/9=0 mod 3^2.
MAPLE
0, 9, 0, seq(numtheory:-order(10, ithprime(i)^2), i=4..100); # Robert Israel, Dec 30 2015
PROG
(PARI) a(n)=p=prime(n); 10%p==0 && return(0); for(k=1, p^2, ((10^k-1)/9) % p^2 == 0 && return(k)); error() \\ Jeppe Stig Nielsen, Dec 28 2015
(PARI) a(n)=p=prime(n); if(10%p==0, 0, 10%p==1, 9, znorder(Mod(10, p^2))) \\ Jeppe Stig Nielsen, Dec 28 2015
CROSSREFS
KEYWORD
nonn
AUTHOR
Ray Chandler, Aug 10 2003
STATUS
approved