Higher reciprocity laws and ternary linear recurrences