A374561 Integers which are palindromes when expressed in more than one base 2 to 10.
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 16, 17, 18, 20, 21, 24, 26, 27, 28, 31, 33, 36, 40, 45, 46, 50, 51, 52, 55, 57, 63, 65, 67, 73, 78, 80, 82, 85, 88, 91, 92, 93, 98, 99, 100, 104, 105, 107, 109, 111, 114, 119, 121, 127, 129, 130, 135, 141, 142, 150, 151, 154, 160, 164, 170, 171, 173, 178
Offset: 1
Examples
5 is a term since it's palindromic in more than one base: base 2 (101) and base 4 (11). 121 is a term since it's palindromic in base 3 (11111) and base 7 (232), and also in fact in bases 8 and 10.
Programs
-
Mathematica
q[n_] := Count[Range[2, 10], ?(PalindromeQ[IntegerDigits[n, #]] &)] > 1; Select[Range[180], q] (* _Amiram Eldar, Jul 20 2024 *)
-
PARI
isok(k) = sum(b=2, 10, my(v=digits(k, b)); v==Vecrev(v)) > 1; \\ Michel Marcus, Aug 03 2024
-
Python
from sympy.ntheory import is_palindromic def ok(n): c = 0 for b in range(2, 11): c += int(is_palindromic(n, b)) if c > 1: return True return False print([k for k in range(1, 180) if ok(k)]) # Michael S. Branicky, Aug 02 2024
Formula
A050812(a(n)) >= 2. - Michael S. Branicky, Aug 02 2024
Comments