OFFSET
1,2
FORMULA
If n-1 > 0 has not already appeared in sequence then a(n) = n-1, otherwise a(n) = n^2 - n + 1.
EXAMPLE
a(3)=2 because 1 is already in the sequence, 2 has not yet appeared (i.e., is not the sum of 1 earlier term), and the sum of 3 earlier terms is 3, 5 or 7.
a(4)=13 because 1, 2, and 3 have already appeared and the sum of 4 earlier terms could be any integer from 4 through 12.
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Henry Bottomley, May 19 2000
STATUS
approved