A number double the size when reversed.
#2

Interesting question..
Think like a computer!
This script I just wrote can find such numbers (if exisiting).
Note that its just functional to do what you need, no eye given to speed

pawn Код:
stock findRev(min, max)
{
    for (new i = min; i <= max; i++) {
        if (reverseNumber(i) == 2 * i) printf("%d is a reverse-magic number!", i);
    }
}

stock reverseNumber(num)
{
    new t[12], n[12];
    format(t, 12, "%d", num);
    new slen = strlen(t);
    for (new i = 0; i < slen; i++) {
        n[slen - i - 1] = t[i];
    }
    return strval(n);
}
This does not return any result except 0 for the first million numbers.
Explanation why such a number cant exist is following as soon as I made up my mind
Reply


Messages In This Thread
A number double the size when reversed. - by Mrkrabz - 28.08.2012, 18:57
Re: A number double the size when reversed. - by Mauzen - 28.08.2012, 19:40
Re: A number double the size when reversed. - by Finn - 28.08.2012, 20:36
Re: A number double the size when reversed. - by Extremo - 28.08.2012, 20:39
Re: A number double the size when reversed. - by mamorunl - 28.08.2012, 20:49
Re: A number double the size when reversed. - by Si|ent - 28.08.2012, 20:55
Re: A number double the size when reversed. - by Mrkrabz - 28.08.2012, 21:08
Re: A number double the size when reversed. - by Extremo - 29.08.2012, 07:23
Re: A number double the size when reversed. - by Si|ent - 29.08.2012, 13:19
Re: A number double the size when reversed. - by Extremo - 29.08.2012, 14:08

Forum Jump:


Users browsing this thread: 1 Guest(s)