Learning a simple sequence with RNN (Keras)
Using the raw integers as inputs and targets will make this a very difficult task. A better approach would be to come up with a vector for each number. You can simply encode each number directly as a vector, use a "onehot" representation, or use an Embedding layer. You can see an example of embeddings in conx that is built on Keras here: 

http://conx.readthedocs.io/en/latest/Predicting%20and%20Generating%20Texts.html?highlight=embeddinglayer 

and and example without embeddings using onehot representations here:

http://conx.readthedocs.io/en/latest/AliceInWonderland.html