OFFSET
1,3
COMMENTS
Rajasekaran, Shallit, & Smith prove that this sequence is an additive basis of order (exactly) 3. - Charles R Greathouse IV, May 03 2020
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
Patrick De Geest, Palindromic numbers beyond base 10.
Phakhinkon Phunphayap and Prapanpong Pongsriiam, Estimates for the Reciprocal Sum of b-adic Palindromes, 2019.
Aayush Rajasekaran, Jeffrey Shallit, and Tim Smith, Sums of palindromes: an approach via automata, arXiv:1706.10206 [cs.FL], 2017.
FORMULA
Sum_{n>=2} 1/a(n) = 2.7857715... (Phunphayap and Pongsriiam, 2019). - Amiram Eldar, Oct 17 2020
MATHEMATICA
f[n_, b_] := Module[{i=IntegerDigits[n, b]}, i==Reverse[i]]; lst={}; Do[If[f[n, 4], AppendTo[lst, n]], {n, 1000}]; lst (* Vladimir Joseph Stephan Orlovsky, Jul 08 2009 *)
pal4Q[n_]:=Module[{c=IntegerDigits[n, 4]}, c==Reverse[c]]; Select[Range[ 0, 700], pal4Q] (* Harvey P. Dale, Jul 21 2020 *)
PROG
(Magma) [n: n in [0..800] | Intseq(n, 4) eq Reverse(Intseq(n, 4))]; // Vincenzo Librandi, Sep 09 2015
(PARI) ispal(n, b=4)=my(d=digits(n, b)); d==Vecrev(d) \\ Charles R Greathouse IV, May 03 2020
(Python)
from gmpy2 import digits
def A014192(n):
if n == 1: return 0
y = (x:=1<<(n.bit_length()-2&-2))<<2
return (c:=n-x)*x+int(digits(c, 4)[-2::-1]or'0', 4) if n<x+y else (c:=n-y)*y+int(digits(c, 4)[-1::-1]or'0', 4) # Chai Wah Wu, Jun 14 2024
CROSSREFS
KEYWORD
nonn,base,easy
AUTHOR
EXTENSIONS
More terms from Patrick De Geest
STATUS
approved