cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A087094 a(n) = smallest k such that (10^k-1)/9 == 0 mod prime(n)^2, or 0 if no such k exists.

Original entry on oeis.org

0, 9, 0, 42, 22, 78, 272, 342, 506, 812, 465, 111, 205, 903, 2162, 689, 3422, 3660, 2211, 2485, 584, 1027, 3403, 3916, 9312, 404, 3502, 5671, 11772, 12656, 5334, 17030, 1096, 6394, 22052, 11325, 12246, 13203, 27722, 7439, 31862, 32580, 18145, 37056, 19306
Offset: 1

Views

Author

Ray Chandler, Aug 10 2003

Keywords

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

Examples

			a(2)=9 since 9 is least value of k for which (10^k-1)/9=0 mod 3^2.
		

Crossrefs

Programs

  • Maple
    0,9,0,seq(numtheory:-order(10,ithprime(i)^2), i=4..100); # Robert Israel, Dec 30 2015
  • 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

Formula

For n>3, a(n) = A084680(prime(n)^2) = A084680(A001248(n)), Jeppe Stig Nielsen, Dec 28 2015