OFFSET
1,2
COMMENTS
What can we say about the asymptotic behavior of this sequence? Does it contain every integer > 2 infinitely often?
For n > 6, a(n) <= floor(n/2) + 1; but this seems to be a very crude estimate.
LINKS
Paul Tek, Table of n, a(n) for n = 1..10000
MATHEMATICA
allDiffQ[l_List] := (Length[l] == Length[DeleteDuplicates[l]]);
a[n_Integer] := Module[{ds = Divisors[n]},
Catch[Do[If[allDiffQ[Mod[#, m] & /@ ds], Throw[m]], {m, n}]]];
a /@ Range[92] (* Peter Illig, Jul 11 2018 *)
PROG
(PARI) alldiff(v)=v=vecsort(v); for(k=1, #v-1, if(v[k]==v[k+1], return(0))); 1
a(n)=local(ds); ds=divisors(n); for(k=#ds, n, if(alldiff(vector(#ds, i, ds[i]%k)), return(k)))
(Python)
from sympy import divisors
from itertools import count
def a(n):
d = divisors(n)
return next(k for k in count(1) if len(set(di%k for di in d))==len(d))
print([a(n) for n in range(1, 93)]) # Michael S. Branicky, Jan 30 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Franklin T. Adams-Watters, Oct 31 2009
STATUS
approved