The "length" of the pencil is actually the length from the middle of the two ends of the pencil. The length that touches the table is actually slightly larger. The radii difference is 288 times smaller then the "length," but the length we want is √(1+288^2) times larger. This is about 288.0017361. The difference in diameters is 144.0008681 times smaller than the length that touches the table.
When the pencil rolls, the two ends make two semi-circle paths. The length of the two paths are proportional to the circumferences of the ends of the pencil. The proportion is equal to the number of spins. The difference between the radii that make the circles is equal to the length of the pencil on the table.
Let s=the number of spins, d=the diameter of the smaller end, r=radius of the smaller semi-circle path, and L=length touching table. So put together, s*d*π=r*π for both larger and smaller diameters and radii. The difference in diameters is 144.0008681 times smaller than L. Solving, we get s*d = r and s(d+L/144.0008681)=(r+L).