login
A067934
Let rep(k) = (10^k - 1)/9 be the k-th repunit number = 11111..1111 with k 1 digits, then sequence gives values of k such that rep(k) == 1 (mod k).
2
1, 2, 5, 7, 10, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 55, 59, 61, 67, 71, 73, 79, 83, 89, 91, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 259
OFFSET
1,2
COMMENTS
Due to Fermat's little theorem, all prime numbers except 3 are in the sequence. E.g., rep(17) = 1 + 17*653594771241830.
Numbers n such that 10^n == 10 (mod 9n). The number (10^n - 1)/9 is a term if and only if n is a term. - Thomas Ordowski, Apr 28 2018
Generally, the repunit theorem: Let integer b <> 1 and n be a positive integer. Define R_b(n) = (b^n-1)/(b-1) = N. Then R_b(N) == 1 (mod N) if and only if N == 1 (mod n). - Thomas Ordowski, Apr 28 2018
Proof: (b^N-1)/(b-1)-1 = (b^N-b)/(b-1) is divisible by N if and only if b^N-b is divisible by b^n-1. Since b^N-b == b^(N mod n)-b (mod b^n-1), we have that b^N-b is divisible by b^n-1 if and only if N == 1 (mod n). QED. - Max Alekseyev, Apr 28 2018
Terms which are not prime are 1 U A303608. - Robert G. Wilson v, Jun 13 2018
No multiples of 3 are in this sequence. - Eric Chen, Jun 13 2018
A005939 is subsequence. - Eric Chen, Jun 13 2018
LINKS
EXAMPLE
(10^11 - 1)/9 = 11111111111 == 1 (mod 11), so 11 is a term.
We also have the congruence 10^11 == 10 (mod 9*11).
MATHEMATICA
{1}~Join~Select[Range[260], Mod[#2, #1] == 1 & @@ {#, (10^# - 1)/9} &] (* Michael De Vlieger, May 06 2018 *)
fQ[n_] := PowerMod[10, n, 9 n] == 10; fQ[1] = True; Select[Range@260, fQ] (* Robert G. Wilson v, Jun 13 2018 *)
PROG
(PARI) is(n)=n==1 || ((10^n-1)/9)%n==1 \\ Eric Chen, Jun 13 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, Mar 05 2002
STATUS
approved