Here you can find the source of pixelsPerPanel(int n)
public static int pixelsPerPanel(int n)
//package com.java2s; //License from project: Open Source License public class Main { public static int pixelsPerPanel(int n) { return n * (n + 1) / 2; }//from w w w . ja v a 2 s . c om }