Narrative:

While in cruise at FL340; ARTCC advised us that we were 5-6 miles off course. Upon hearing this; I noticed the FMA showing we were in heading mode. ARTCC cleared us to turn back left and rejoin qxxx and we did. No other issues were noted. I was pilot monitoring for the flight and allowed myself to not be watching the FMA for a bit of time after level off at cruise altitude. I was looking at fuel calculations since ZZZ had weather all morning and was expecting to be slowed and possibly hold in route. I was noticing some discrepancy in my calculations based on fuel flow numbers and was looking into that. My mfd was on mfd advance (not FMS plan map) and my attention was diverted from monitoring the aircraft. I had chosen to do this once cruise flight was reached. The autopilot was on; and FMS was the active lateral mode. At some point; heading mode became active. I hadn't noticed this selected and there was no reason for it to be selected as we had been on our FMS course and were not assigned a heading. I honestly do not know how heading mode became the active mode. Alas; I was too distracted with fuel calculations and should have been watching the FMA closer.even when busy with other items; in the future I will not turn my attention away from the FMA for so long.

Google
 

Original NASA ASRS Text

Title: CRJ-900 Captain reported becoming distracted while performing a fuel calculation; resulting in a navigation error.

Narrative: While in cruise at FL340; ARTCC advised us that we were 5-6 miles off course. Upon hearing this; I noticed the FMA showing we were in HDG mode. ARTCC cleared us to turn back left and rejoin QXXX and we did. No other issues were noted. I was Pilot Monitoring for the flight and allowed myself to not be watching the FMA for a bit of time after level off at cruise altitude. I was looking at fuel calculations since ZZZ had weather all morning and was expecting to be slowed and possibly hold in route. I was noticing some discrepancy in my calculations based on fuel flow numbers and was looking into that. My MFD was on MFD advance (not FMS plan map) and my attention was diverted from monitoring the aircraft. I had chosen to do this once cruise flight was reached. The autopilot was on; and FMS was the active lateral mode. At some point; HDG mode became active. I hadn't noticed this selected and there was no reason for it to be selected as we had been on our FMS course and were not assigned a heading. I honestly do not know how HDG mode became the active mode. Alas; I was too distracted with fuel calculations and should have been watching the FMA closer.Even when busy with other items; in the future I will not turn my attention away from the FMA for so long.

Data retrieved from NASA's ASRS site and automatically converted to unabbreviated mixed upper/lowercase text. This report is for informational purposes with no guarantee of accuracy. See NASA's ASRS site for official report.