OFFSET
1,5
COMMENTS
Let k be the smallest number such that {p(1), p(2), ..., p(k)} contains each residue class mod n, where p(m) is the m-th partition number A000041(m). Then a(n) = p(k) mod n.
LINKS
Charles R Greathouse IV, Table of n, a(n) for n = 1..10000
EXAMPLE
p(1) = 1, p(2) = 2, p(3) = 3, p(4) = 5, p(5) = 7, p(6) = 11, p(7) = 15, p(8) = 22, p(9) = 30, p(10) = 42, and p(11) = 56. Mod 4 these are 1, 2, 3, 1, 3, 3, 3, 2, 2, 2, and 0 respectively. The last term to appear is 0 mod 4 at index 11, so a(4) = 0.
MATHEMATICA
Table[k = 1; While[Length@ Union@ Map[Mod[PartitionsP@ #, n] &, Range@ k] != n, k++]; Mod[PartitionsP@ k, n], {n, 82}] (* Michael De Vlieger, Nov 21 2016 *)
PROG
(PARI) a(n)=if(n==1, return(1)); my(v=vectorsmall(n), s=1, t, k=1); v[2]=1; while(s<n, t=numbpart(k++)%n; if(v[t+1]==0, v[t+1]=1; if(s++==n, return(t))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Charles R Greathouse IV, Nov 15 2016
STATUS
approved