A067131 Number of elements in the largest set of divisors of n which are in arithmetic progression.
1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 4, 2, 2, 3, 2, 2, 3, 2, 2, 2, 2, 2, 4, 2, 2, 2, 3, 2, 3, 2, 2, 2, 2, 2, 4, 2, 2, 2, 3, 2, 3, 2, 2, 3, 2, 2, 4, 2, 2, 2, 2, 2, 3, 2, 3, 2, 2, 2, 6, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 4, 2, 2, 3, 2, 2, 3, 2, 3, 2, 2, 2, 4, 2, 2, 2, 2, 2, 3, 3, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 3, 2
Offset: 1
Examples
a(12) = 4 as the divisors of 12 are {1,2,3,4,6,12} and the maximal subset in arithmetic progression is {1,2,3,4}. a(15) = 3; the maximal set is {1,3,5}.
Links
- Antti Karttunen, Table of n, a(n) for n = 1..65537
Programs
-
Mathematica
lap[s_] := Module[{}, l=Length[s]; If[l<2, Return[l]]; val=2; For[i=1, i
val, val=k]]]; val]; lap/@Divisors/@Range[1, 200] -
PARI
A067131(n) = { my(d=divisors(n),m=1); for(i=1,(#d-1), for(j=(i+1),#d,my(c=1,k=d[j],s=(d[j]-d[i])); while(!(n%k), k+=s; c++); m = max(m,c))); (m); }; \\ Antti Karttunen, Sep 21 2018
Formula
Extensions
Edited by Dean Hickerson, Jan 15 2002
Comments