determine longest group of consecutive numbers
APL, 26 21 characters

1+⌈/+/^\9 9⍴0,1=-2-/⎕


Here's the 26-character solution:

i←⎕⋄⌈/{1++/^\⍵↓1=-2-/i}¨⍳9


I used Dyalog APL as my interpreter, and ⎕IO should be set to 0 for the 26-character version.

Example:

      1+⌈/+/^\9 9⍴0,1=-2-/⎕
⎕:
      6 7 51 51 53 51 54 55 56 55
3


This answer explains most of what I in the 26-character solution, but I might have to write a new one up for the 21-character version.