«

hv at crypt.org hv at crypt.org
Thu Oct 27 12:09:07 CEST 2005


Eric Angelini <Eric.Angelini at kntv.be> wrote:
[...]
:> Now, what about "balanced numbers" (this term already exists
:> in the OEIS, unfortunately), using the same criteria?
:>
:> 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 22, ... 101, ... 111, ... are
:> balanced numbers, of course, because palindromic -- but 7256 is
:> too:
:>                     7 . 2 . 5 . 6
:>                     3 2 1 0 1 2 3
:>                     ------^------
:>
:>                 7x3 + 2x1 = 5x1 + 6x3       (=23)
:>
:> I think a seq of such non-palindromic "balanced numbers" would
:> start like this (computed by hand):
:>
:> 1030, 1140, 1250, 1360, 1470, 1580, 1690, 2031, 2060, 2141, 2170...

You missed a few:

1030 1140 1250 1302 1360 1412 1470 1522 1580 1603 1632 1690 1713 1742 1823 1852
1904 1933 1962 2031 2060 2141 2170 2251 2280 2303 2361 2390 2413 2471 2523 2581
2604 2633 2691 2714 2743 2824 2853 2905 2934 2963 3032 3061 3090 3142 3171 3252

I'm not entirely convinced of the interestingness of this sequence, so I'll
leave you to submit and convince.

Hugo
---
#!/usr/bin/perl -w
$| = 1;
for (my $n = 1000; 1; ++$n) {
    next if $n == reverse $n;
    my $last = length($n) - 1;
    my $sum = 0;
    for my $index (0 .. $last) {
        $sum += substr($n, $index, 1) * (2 * $index  - $last);
    }
    print "$n " if $sum == 0;
}
__END__





More information about the SeqFan mailing list