You would have needed to disable Simple Passcode which only accepts four digits. Without the passcode you need to restore your device.
Locked Out, Forgot Lock or Restrictions Passcode, or Need to Restore Your Device: Several Alternative Solutions
Choose one:
A
1. iOS- Forgotten passcode or device disabled after entering wrong passcode
2. iPhone, iPad, iPod touch: Wrong passcode results in red disabled screen
3. Restoring iPod touch after forgotten passcode
4. What to Do If You've Forgotten Your iPhone's Passcode
5. iOS- Understanding passcodes
6. iTunes 10 for Mac- Update and restore software on iPod, iPhone, or iPad
7. iOS - Unable to update or restore
Forgotten Restrictions Passcode Help
iPad,iPod,iPod Touch Recovery Mode
You will need to restore your device as New to remove a Restrictions passcode. Go through the normal process to restore your device, but when you see the options to restore as New or from a backup, be sure to choose New.
You can restore from a backup if you have one from BEFORE you set the restrictions passcode.
Also, see iTunes- Restoring iOS software.