Generate an integer, convert it to an octal string, and then increase the value of each digit by 2. I'm not a PHP programmer, so I'll give you the pseudocode.
foo = 1
octFoo = decoct(foo)
// at this point, octFoo is equal to 1
// Now go through each character in octFoo and increase it by 2.
// So 0 becomes 2, 1 becomes 3, etc.
Given the number 8, octFoo
would be 10
, and the final result would be 32
.
You could do this without the intermediate octal step if you wanted to write your own integer-to-string routine. Rather than using the digits 0 through 7, use the digits 2 through 9.