# Six-story card castle problems with general term

First of all sorry if i am mistaking word translation, i am not a native English speaker.

I got a problem which i partially solved. I must do calculations with a six-story card castle (two-dimensional pyramid of cards making triangles), and to simplify i think i already solved the general term, i got four possibilities, which i think all right:

Pn = to n, index=1 -> Σ(3n)-n

Pn = to n, index=1 -> Σ(2n) + to n-1, index=1 -> Σ(1)

Pn = (n*(n+1)/2)*3-n and

Pn = 1.5n² + 0.5n

Are them all right to calculate the cards used knowing the height of this?

Now i need to know with one of the formulas to know where will it cross a multiple of 52. In another words, i need to know when will the division of them by 52 result in an integer.

I need a justification, not a solution. How am i supposed to reach the solution?

Thanks

-
Is Pn supposed to be the number of cards in a triangle of height $n$? It seems so. I agree then that Pn$=\frac 12(3n^2+n)$ – Ross Millikan Dec 2 '13 at 19:12
That’s an impressive card castle! – Brian M. Scott Dec 2 '13 at 19:33

If you want to know when $52$ divides $\frac 12(3n^2+n)$, you can say you want $104$ to divide $n(3n+1)$ You need to account for all the factors of $104$, which are $2^3\cdot 13$ As $n$ and $3n+1$ are of opposite parity, one of them must be divisible by $8$ and one must be divisible by $13$. This gives four possibilities: $$\begin {array}{c|c}\\ n \pmod {104}&3n+1 \pmod {104}\\0&1\\69&0\\13&40\\56&65\end{array}$$ The last two come from applying the Chinese remainder theorem to $n\equiv 0 \pmod {13}, n\equiv 5 \pmod 8$ and $n \equiv 0 \pmod 8, n \equiv 4 \pmod{13}$
The smallest positive solution is then $n=13, \frac12(3n^2+n)=260$
@Claudiop: You might look at Wikipedia on modular arithmetic to see what the mods are about. The prime factorization of $n(3n+1)$ will be the product of the factorization of $n$ and that of $3n+1$. Since one is odd and the other even, the even one has to be a multiple of $8$. One of them (maybe the same one) has to be a multiple of $13$ The first line in my table is when $n$ is a multiple of $104$, the second when $3n+1$ is a multiple of $104$, the third when $n$ is a multiple of $13$ and $3n+1$ a multiple of $8$ and the last – Ross Millikan Dec 4 '13 at 21:54
when $n$ is a multiple of $8$ and $3n+1$ a multiple of $13$ – Ross Millikan Dec 4 '13 at 21:54