Repunits are numbers that consist entirely of repetitions of the digit one (unity). The notation Rn symbolizes the repunit made up of n ones.

Every prime p larger than 5, evenly divides the repunit Rp-1.



E.G.
The repunit R6 is evenly divisible by 7.

111111 / 7 = 15873

The repunit R42 is evenly divisible by 43.

111111111111111111111111111111111111111111 / 43 = 2583979328165374677002583979328165374677

And so on.



There are composite numbers that also have this same property. They are often referred to as deceptive non-primes or deceptive numbers.



The repunit R90 is evenly divisible by the composite number 91 (=7*13).

111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 / 91 = 1221001221001221001221001221001221001221001221001221001221001221001221001221001221001221


Task 
 Find and show at least the first 10 deceptive numbers; composite numbers n that evenly divide the repunit Rn-1


See also
 Numbers Aplenty - Deceptive numbers
 OEIS:A000864 - Deceptive nonprimes: composite numbers k that divide the repunit R_{k-1}




BEGIN # find repunits (all digits are 1 ) such that R(n-1) is divisible by n and n is not prime #
      # R(n) is the nth repunit, so has n 1s                                                    #
    PR precision 8000 PR             # set precision of LONG LONG INT, enough for up to R(8000) #
    PR read "primes.incl.a68" PR                                      # include prime utilities #
    []BOOL prime = PRIMESIEVE 8000;
    LONG LONG INT repunit := 111 111;   # n must be odd as all repunits are odd, the lowest odd #
    INT           r count := 0;          # non-prime is 9, so we start with repunit set to R(6) #
    FOR n FROM 9 BY 2 WHILE r count < 15 DO 
        repunit *:= 100 +:= 11;                                       # gets R(n-1) from R(n-3) #
        IF NOT prime[ n ] THEN
            IF repunit MOD n = 0 THEN
                # found non-prime n which divides R(n-1) #
                print( ( " ", whole( n, 0 ) ) );
                r count +:= 1
            FI
        FI
    OD
END