It could possibly be a physiological medical condition/state, which is causing fatigue (the symptoms you have listed are just indicative of fatigue – including inability to concentrate.)
Some questions:
How often do you experience one of these episodes?
Have they just started occurring, or have you been having them for a while?
Do you feel dizzy or 'wooozy' when you get these? Nauseated? Do you have any other symptoms, like fast heart rate or pain?
Does anyone comment on how you look pale during these episodes?
How long do you have to be sitting for before you get this feeling?
When you stand up after you’ve had this feeling, do your eyes go black and does your vision disappear for a couple of seconds? etc...
Possible causes:
1) As you are sitting when they occur, it could be due to pooling of blood in the peripherals. When you sit for long period of time and if you have rather sluggish vasoconstriction (which is common), blood can pool in your legs, causing hypotension (low blood pressure) and weak pulse pressure. The reason why it doesn’t happen when you’re walking is because the blood is pumped back up to the heart. But when your legs are dangling and not moving for extended periods of time, blood pools. Low blood pressure can cause the symptoms you have described.
2) Just fatigue due to late nights, playing sport (especially if you don’t participate in physical activity regularly and have a burst of unusual exercise.)
3) Perhaps stress? Stress can cause fatigue.
I can’t really think of any human emotions which would be causing these episodes – you’re just describing fatigue, which is why I am thinking it has a physiological aetiology.
4) Another medical condition.
However I'm leaning towards pooling, seeing as you feel fine when you walk around.
Low blood pressure (hypotension) can cause fatigue, dizziness, inability to concentrate, fainting, head ache, washed out feeling etc.
My recommendations:
-Go to the doctor.
-When you have an episode, move your legs around (still sitting – don’t get up too quickly, you may faint). See if it helps.
-Lie on the floor, or put your legs up on a desk as this can increase venous return, which makes blood more available to the organs.
-Don't sit it out. Stop what you're doing until you feel better and comfortable.
-Have a salty snack, like a packet of chips. Sodium raises BP, oh and have a drink of water. Or powerade.
-Do regular leg strengthening exercises. It increases venous return long term.
Things to look out for:
-Purple legs. Symptomatic of blood pooling.
-When you have an episode, take your pulse by placing three of your fingers across the side of your wrist that is next to your thumb. Count how many beats there are in 1 minute or 30 seconds (and then times by two etc, although you probably already know this lol). If your pulse rate (BPM) is either under 50 or over 100, I think your blood may be pooling in your legs. (Your heart in itself can do one of two things when it is faced with lack of blood to pump – one, start beating unusually fast, or two, start beating unusually slowly. Depends on the individual on what happens.)
Hope it helps... I don't know what else it could be

I may be wrong though, but it just fits in really well!