Novel Prime Factors of Repunits The Background

Folks were talking prime factorization in chat and we found ourselves talking about repunits. Repunits are a subset of the numbers known as repdigits, which are numbers consisting of only repeating digits, like 222 or 4444444444444444, but repunits consist only of 1.

The first couple repunits are therefore 1, 11, 111, etc. These are referred to by Rn, so R1=1, R2=11, etc., and are generated by the formula R(n) = (10^n - 1)/9, with n &gt; 0.

Prime factorization of these repunit numbers follows sequence A102380 in the OEIS. For example:


  R1 = 1
  R2 = 11
  R3 = 111 = 3 * 37
  R4 = 1111 = 11 * 101
  R5 = 11111 = 41 * 271
  R6 = 111111 = 3 * 7 * 11 * 13 * 37
  R7 = 1111111 = 239 * 4649
  ...


The Challenge

Write a program or function which, when given an input integer n with n &gt;= 2 via STDIN or equivalent, outputs or returns the novel prime factors for Rn, in any convenient format. "Novel prime factors" here means all x where x is a prime factor of Rn, but x is not a prime factor for any previous Rk, with 1 &lt;= k &lt; n (i.e., if we write the prime factors for all R in sequence, we've not seen x before).

The Examples

Input: 6
Output: 7, 13
(because 3, 11, and 37 are factors of a smaller R_k)

Input: 19
Output: 1111111111111111111
(because R_19 is prime, so no other factors)

Input: 24
Output: 99990001
(because 3, 7, 11, 13, 37, 73, 101, 137, 9901 are factors of a smaller R_k)

Input: 29
Output: 3191, 16763, 43037, 62003, 77843839397
(because no factors of R_29 are also factors of a smaller R_k)


The Extras:


Your code can do anything or nothing if n &lt; 2.
You can assume a "reasonable" upper limit for n for testing and execution purposes -- your code will not be expected to output for n = 10000000, for example, but your algorithm should work for such a case if given unlimited computing power and time.
Here is a site dedicated to the factorizations of repunits for reference.
I've not gone through the math, but I propose a hypothesis that every n has a distinct result for this algorithm -- that is, no n exists such that Rn has no novel factors. I'll offer a 250-point bounty if someone proves or disproves that in their answer. Thomas Kwa proposed an elegant proof, and I awarded the bounty.
Proof that every repunit has a novel prime factor
Using Zsigmondy's Theorem, the proof is simple. From Wikipedia:

In number theory, Zsigmondy's theorem, named after Karl Zsigmondy,
states that if a &gt; b &gt; 0 are coprime integers, then for any integer n
≥ 1, there is a prime number p (called a primitive prime divisor) that
divides an − bn and does not divide ak − bk for any positive integer k
&lt; n, with the following exceptions: [things that don't apply here].

Consider the repunits times 9: that is, 10n-1. By Zsigmondy's Theorem with a=10, b=1, there is some prime p | 10n-1 that does not divide any 10k-1, k &lt; n.

Since p is prime and 10n-1 = 9 · Rn, it must divide either 9 or Rn.

p cannot divide 9, since 9 = 101-1.

Therefore p divides Rn.

p cannot divide any Rk, since it doesn't divide 10k-1 = 9 · Rk.


Therefore the p from Zsigmondy's Theorem is a novel prime factor of any Rn, n ≥ 2. ∎

An example of a repeated novel prime factor
The prime 487 is a repeated prime factor of R486:
By the Fermat-Euler theorem, 10487-1 ≡ 1 (mod 487). The order of 10 mod 487, that is, the smallest power of 10 that is 1 mod 487, therefore must be a divisor of 486. In fact, the order is equal to 486. It also happens that not only is 10486 ≡ 1 (mod 487), it's also 1 (mod 4872).
See here that the order of 10 mod 487 is 486; that is, that no smaller 10k-1 is divisible by 487. Obviously, 487 doesn't divide 9, so it must divide R486.