login
A078788
Smallest m such that (n-1)*m+1 mod n = 0, or 0 if no such number exists.
0
0, 0, 3, 0, 5, 3, 7, 0, 3, 5, 11, 3, 13, 7, 3, 0, 17, 3, 19, 5, 3, 11, 23, 3, 5, 13, 3, 7, 29, 3, 31, 0, 3, 17, 5, 3, 37, 19, 3, 5, 41, 3, 43, 11, 3, 23, 47, 3, 7, 5, 3, 13, 53, 3, 5, 7, 3, 29, 59, 3, 61, 31, 3, 0, 5, 3, 67, 17, 3, 5, 71, 3, 73, 37, 3, 19, 7, 3, 79, 5, 3, 41, 83, 3, 5, 43, 3, 11
OFFSET
1,3
COMMENTS
Terms are primes or 0.
EXAMPLE
a(5) is representing 11. 11*(3-1)+1=23=2 mod 3, 11*(5-1)+1=45=0 mod 5, hence a(5)=5
PROG
(PARI) forstep (m=3, 1000, 2, forstep (n=3, 1000, 2, if (((n-1)*m+1)%n==0, print1(n", "); break); if (n==999, print1("0, "))))
CROSSREFS
Sequence in context: A326937 A336597 A076109 * A284599 A005069 A366840
KEYWORD
nonn
AUTHOR
Jon Perry, Jan 10 2003
STATUS
approved