Capacitive Touch Sensor Code fails for pin 23 on Mega 2560

I have wired up 25 touch sensors to my Mega 2560. The first 9 of them work on pins 3, 5, 7, 9, 11, 13, 15, 17, and 19. Pins 21 and 23 do not work, with the same code. Fearing that the digitalPinToPort routines might not work for pins over 19, I modified the code to do explicit pinModes and digitalWrites; this continues to work for pins 3 ... 19, but continues to fail for pins 21 and 23. Any idea what is going on? I tried to find out if pins 21 and 23 are not valid digital pins, but have not found any information that would explain this situation.

Which library are you using? This could be the library's limitation. The author could have written it on UNO.