The sum can be expressed as
[tex]\displaystyle\sum_{k=0}^n(3k+1)=n+1+3\sum_{k=1}^nk=n+1+\dfrac{3n(n+1)}2[/tex]
[tex]=\dfrac32n^2+\dfrac52n+1[/tex]
The sum will exceed 1 million for [tex]n[/tex] satisfying
[tex]\dfrac32n^2+\dfrac52n+1>1000000[/tex]
[tex]3n^2+5n+2>2000000[/tex]
[tex]3n^2+5n-1999998>0[/tex]
The least integer that satisfies this is [tex]n=816[/tex].