login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A060511
Hexagonal excess: smallest amount by which n exceeds a hexagonal number (2k^2-k, A000384).
1
0, 0, 1, 2, 3, 4, 0, 1, 2, 3, 4, 5, 6, 7, 8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20
OFFSET
0,4
EXAMPLE
a(19)=4 since 15(=2*3^2-3) is the largest hexagonal less than or equal to 19 and 19-15=4.
MATHEMATICA
Flatten[Range[#]&/@Differences[Array[#(2#-1)&, 10, 0]]-1] (* Harvey P. Dale, Jun 05 2013 *)
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Henry Bottomley, Mar 22 2001
STATUS
approved