We present an exact solution of a one-dimensional sandpile model for which sand is dropped along the wall and N=2 grains of sand fall over the neighboring downhill sites when the critical slope is exceeded. The slopes of N consecutive sites organize into a local state. The time evolution of the local states along the spatial direction shows a natural tree structure. As a result, various multifractals can be identified. The spatial two-point correlation function decreases exponentially with a correlation length of the order of the lattice spacing.