%I A160078
%S A160078 22,26,28,35,37,41,45,46,47,49,60,61,67,75,77,78,84,86,89,90,93,94,95,
%T A160078 97,105,106,108,110,116,120,122,124,125,131,135,139,141,147,149,152
%N A160078 Positive integers which apparently never result in a palindrome under
repeated applications of the function f(x) = x + (x with digits in
binary expantion reversed). Binary analog of Lychrel numbers.
%C A160078 number of iterations equals 1000, but all non-seeded numbers(under) fall
out in 32 iterations
%H A160078 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 A160078 22 = 10110
%e A160078 10110 + 01101 = 100011
%e A160078 100011 + 110001 = 1010100...
%e A160078 Not forming polyndrom in 1000 iterations.
%o A160078 (Python) def toSystem( n, k ) :
%o A160078 ....d = []
%o A160078 ....while n > 0 :
%o A160078 ........d.append( n % k )
%o A160078 ........n /= k
%o A160078 ....return d[ -1::-1]
%o A160078 def makeint( l, system = 10 ) :
%o A160078 ....i = 0
%o A160078 ....for d in l :
%o A160078 ........i = i * system + d
%o A160078 ....return i
%o A160078 maxn = 1024
%o A160078 it = []
%o A160078 for i in range( 1, maxn ) :
%o A160078 ....d = toSystem( i, 2 )
%o A160078 ....isLychrel = True
%o A160078 ....for j in range( 1000 ) :
%o A160078 ........d = toSystem( makeint( d, 2 ) + makeint( d[::-1], 2 ), 2 )
%o A160078 ........if d == d[::-1] :
%o A160078 ............it.append( j + 1 )
%o A160078 ............isLychrel = False
%o A160078 ............break
%o A160078 ....if isLychrel :
%o A160078 ........it.append( 0 )
%o A160078 print 'Maximum iterations for non-seed numbers', max( it )
%o A160078 Lychrel = []
%o A160078 for i in range( len(it) ) :
%o A160078 ....if it[i] == 0 :
%o A160078 ........Lychrel.append( i + 1 )
%o A160078 print 'Count of binary Lychrel numbers', len( Lychrel )
%o A160078 print 'All binary lichler under', maxn
%o A160078 print 'Decimal form', Lychrel
%o A160078 print 'Binary form', map( lambda x: ''.join( map( str, toSystem( x, 2
) ) ), Lychrel )
%Y A160078 Binary A023108
%Y A160078 Sequence in context: A108632 A045096 A124177 this_sequence A066059 A084891
A162422
%Y A160078 Adjacent sequences: A160075 A160076 A160077 this_sequence A160079 A160080
A160081
%K A160078 base,nonn
%O A160078 1,1
%A A160078 Dremov Dmitry (dremovd(AT)gmail.com), May 01 2009
|