VOOZH
about
URL: https://oeis.org/A118595
⇱ A118595 - OEIS
login
A118595
Palindromes in base 4 (written in base 4).
10
0, 1, 2, 3, 11, 22, 33, 101, 111, 121, 131, 202, 212, 222, 232, 303, 313, 323, 333, 1001, 1111, 1221, 1331, 2002, 2112, 2222, 2332, 3003, 3113, 3223, 3333, 10001, 10101, 10201, 10301, 11011, 11111, 11211, 11311, 12021, 12121, 12221, 12321, 13031
(
list
;
graph
;
refs
;
listen
;
history
;
text
;
internal format
)
OFFSET
1,3
COMMENTS
2*a(n) and 3*a(n) give palindromes in base 10 for any n. -
Arkadiusz Wesolowski
, Jun 22 2012
Equivalently, palindromes k (written in base 10) such that 3*k is a palindrome. -
Bruno Berselli
, Sep 12 2018
LINKS
Table of n, a(n) for n=1..44.
MATHEMATICA
(* get NextPalindrome from
A029965
*) Select[NestList[NextPalindrome, 0, 290], Max@IntegerDigits@# < 4 &] (*
Robert G. Wilson v
, May 09 2006 *)
PROG
(Python)
from gmpy2 import digits
def
A118595
(n):
if n == 1: return 0
y = (x:=1<<(n.bit_length()-2&-2))<<2
return int((s:=digits(n-x, 4))+s[-2::-1] if n<x+y else (s:=digits(n-y, 4))+s[::-1]) #
Chai Wah Wu
, Jun 14 2024
CROSSREFS
Cf.
A014192
,
A057148
,
A118594
,
A118595
,
A118596
,
A118597
,
A118598
,
A118599
,
A118600
,
A002113
.
Sequence in context:
A215952
A276375
A128921
*
A229549
A229804
A241096
Adjacent sequences:
A118592
A118593
A118594
*
A118596
A118597
A118598
KEYWORD
nonn
,
base
AUTHOR
Martin Renner
, May 08 2006
EXTENSIONS
More terms from
Robert G. Wilson v
, May 09 2006
STATUS
approved