Skip to content

Instantly share code, notes, and snippets.

@gjb2048
Created September 25, 2013 15:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gjb2048/6701603 to your computer and use it in GitHub Desktop.
Save gjb2048/6701603 to your computer and use it in GitHub Desktop.
Sequence to calculate x = y * y - y
/*
* Sequence.
* © G J Barnard 2013 - Attribution-NonCommercial-ShareAlike 3.0 Unported - http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_GB.
*/
package sequence;
/**
* This class outputs a sequence where x = y * y - y.
*
* @author G J Barnard
*/
public class Sequence {
public static void main(String[] args) {
for (int y = -24; y < 25; y++) {
System.out.println(y + " = " + (y * y - y));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment