cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A160078 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.

This page as a plain text file.
%I A160078 #22 Jul 14 2024 08:42:40
%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 expansion 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 a palindrome after 1000 iterations.
%o A160078 (Python)
%o A160078 from sympy.ntheory.digits import digits
%o A160078 def make_int(l, b):
%o A160078     return int(''.join(str(d) for d in l), b)
%o A160078 maxn = 102
%o A160078 it = []
%o A160078 for i in range( 1, maxn ) :
%o A160078     d = digits( i, 2 )[1:]
%o A160078     isLychrel = True
%o A160078     for j in range( 1000 ) :
%o A160078         d = digits( make_int( d, 2 ) + make_int( d[::-1], 2 ), 2 )[1:]
%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', list(map( lambda x: ''.join( map( str, toSystem( x, 2 ) ) ), Lychrel )))
%Y A160078 Binary version of A023108.
%K A160078 base,nonn
%O A160078 1,1
%A A160078 Dremov Dmitry (dremovd(AT)gmail.com), May 01 2009