OFFSET
2,1
COMMENTS
From Robert G. Wilson v, Mar 26 2014: (Start)
Obviously the first prime number, 2, can never become a repunit since it is even; therefore this sequence has the offset of 2.
Most terms, a(n), are one less than the n-th prime; e.g., for a(8) the eighth prime is 19_10 = 11_18. Therefore a(n) <= Pi(n)-1.
However there are some terms for which a(n) occurs before Pi(n)-1; e.g., for a(14) the fourteenth prime is 43_10 = 111_6.
Those indices, i, are: 4, 6, 11, 14, 21, 31, 37, 47, 53, 63, 82, 90, ..., . Prime(i) = A085104.
In those cases a(n) is a proper divisor of Prime(n)-1.
(End)
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 2..1001
Eric Weisstein's World of Mathematics, Repunit
EXAMPLE
n=6: A000040(6) = 13 = 1*3^2 + 1*3^1 + 1*3^0: ternary(13)='111' and binary(13)='1101', therefore a(6)=3.
MATHEMATICA
f[n_] := Block[{i = 1, d, p = Prime@ n}, d = Rest@ Divisors[p - 1]; While[id = IntegerDigits[p, d[[i]]]; id != Reverse@ id || Union@ id != {1}, i++]; d[[i]]]; Array[f, 60, 2]
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Reinhard Zumkeller, Sep 21 2003
STATUS
approved