OFFSET
1,4
LINKS
Wikipedia, Divisibility rule
EXAMPLE
a(6) = 4 because 13 (the sixth prime) divides 39, which is adjacent to 40.
MATHEMATICA
a[n_] := Block[{p = Prime[n], k = 0}, Mod[10, p] > 0 && While[! MemberQ[{1, p-1}, Mod[10*k, p]], k++]; k]; Array[a, 68] (* Giovanni Resta, Apr 30 2013 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
J. Lowell, Apr 23 2013
EXTENSIONS
a(20)-a(68) from Giovanni Resta, Apr 30 2013
STATUS
approved