Dynamically create fields based on integer value
you should look into
Licensing

This module is useful for people that plan on integrating a software
licensing system on their site.
Features Out of the box, it provides the following:

Ability to generate, edit &amp; delete unlimited unique license keys.
Ability to export your keys into a CSV document, which you can mail merge and distribute with physical copies of your product.
Ability for users to 'register' their key when they sign up for a drupal account, or by visiting a page when logged in.
Users can have multiple keys registered to one account, and they are all displayed on their user page.
Provides views functionality for default and custom reports.
Brandable license keys like XXXX-BRAND-XXXX-XXXX-XXXX
This module does provide functionality out of the box, however - it's power is in the hooks it provides which allow you to extend this
further.


Commerce Product Key

This module lets sites implementing the Commerce module, attach
product keys to orders. Product keys / Vouchers are strings of text
that are used to unlock or activate a piece of software.