[go: up one dir, main page]

login
A374561
Integers which are palindromes when expressed in more than one base 2 to 10.
0
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,2
COMMENTS
Sequence is infinite because all integers of the form 4^n-1 are palindromic in bases 2 and 4.
FORMULA
A050812(a(n)) >= 2. - Michael S. Branicky, Aug 02 2024
EXAMPLE
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.
MATHEMATICA
q[n_] := Count[Range[2, 10], _?(PalindromeQ[IntegerDigits[n, #]] &)] > 1; Select[Range[180], q] (* Amiram Eldar, Jul 20 2024 *)
PROG
(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
(PARI) isok(k) = sum(b=2, 10, my(v=digits(k, b)); v==Vecrev(v)) > 1; \\ Michel Marcus, Aug 03 2024
CROSSREFS
Sequence in context: A372317 A117923 A117924 * A239616 A231848 A200373
KEYWORD
base,easy,nonn
AUTHOR
Paul Duckett, Jul 11 2024
STATUS
approved