%I #22 Jul 14 2024 08:42:40
%S 22,26,28,35,37,41,45,46,47,49,60,61,67,75,77,78,84,86,89,90,93,94,95,
%T 97,105,106,108,110,116,120,122,124,125,131,135,139,141,147,149,152
%N Positive integers which apparently never result in a palindrome under repeated applications of the function f(x) = x + (x with digits in binary expansion reversed). Binary analog of Lychrel numbers.
%C Number of iterations equals 1000, but all non-seeded numbers (under) fall out in 32 iterations
%H Diofant.ru, <a href="http://diofant.ru/problem/287/">Problem: binary Lychrel numbers under 1024.</a> (Russian language!) [From Dremov Dmitry (dremovd(AT)gmail.com), May 03 2009]
%e 22 = 10110
%e 10110 + 01101 = 100011
%e 100011 + 110001 = 1010100...
%e Not forming a palindrome after 1000 iterations.
%o (Python)
%o from sympy.ntheory.digits import digits
%o def make_int(l, b):
%o return int(''.join(str(d) for d in l), b)
%o maxn = 102
%o it = []
%o for i in range( 1, maxn ) :
%o d = digits( i, 2 )[1:]
%o isLychrel = True
%o for j in range( 1000 ) :
%o d = digits( make_int( d, 2 ) + make_int( d[::-1], 2 ), 2 )[1:]
%o if d == d[::-1] :
%o it.append( j + 1 )
%o isLychrel = False
%o break
%o if isLychrel :
%o it.append( 0 )
%o print('Maximum iterations for non-seed numbers', max( it ))
%o Lychrel = []
%o for i in range( len(it) ) :
%o if it[i] == 0 :
%o Lychrel.append( i + 1 )
%o print('Count of binary Lychrel numbers', len( Lychrel ))
%o print('All binary lichler under', maxn)
%o print('Decimal form', Lychrel)
%o print('Binary form', list(map( lambda x: ''.join( map( str, toSystem( x, 2 ) ) ), Lychrel )))
%Y Binary version of A023108.
%K base,nonn
%O 1,1
%A Dremov Dmitry (dremovd(AT)gmail.com), May 01 2009
|