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.

A014192 Palindromes in base 4 (written in base 10).

This page as a plain text file.
%I A014192 #39 Jun 14 2024 11:08:24
%S A014192 0,1,2,3,5,10,15,17,21,25,29,34,38,42,46,51,55,59,63,65,85,105,125,
%T A014192 130,150,170,190,195,215,235,255,257,273,289,305,325,341,357,373,393,
%U A014192 409,425,441,461,477,493,509,514,530,546,562,582,598,614,630,650,666
%N A014192 Palindromes in base 4 (written in base 10).
%C A014192 Rajasekaran, Shallit, & Smith prove that this sequence is an additive basis of order (exactly) 3. - _Charles R Greathouse IV_, May 03 2020
%H A014192 T. D. Noe, <a href="/A014192/b014192.txt">Table of n, a(n) for n = 1..10000</a>
%H A014192 Patrick De Geest, <a href="http://www.worldofnumbers.com/nobase10.htm">Palindromic numbers beyond base 10</a>.
%H A014192 Phakhinkon Phunphayap and Prapanpong Pongsriiam, <a href="https://doi.org/10.13140/RG.2.2.23202.79047">Estimates for the Reciprocal Sum of b-adic Palindromes</a>, 2019.
%H A014192 Aayush Rajasekaran, Jeffrey Shallit, and Tim Smith, <a href="https://arxiv.org/abs/1706.10206">Sums of palindromes: an approach via automata</a>, arXiv:1706.10206 [cs.FL], 2017.
%H A014192 <a href="/index/Ab#basis_03">Index entries for sequences that are an additive basis</a>, order 3.
%F A014192 Sum_{n>=2} 1/a(n) = 2.7857715... (Phunphayap and Pongsriiam, 2019). - _Amiram Eldar_, Oct 17 2020
%t A014192 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 *)
%t A014192 pal4Q[n_]:=Module[{c=IntegerDigits[n,4]},c==Reverse[c]]; Select[Range[ 0,700],pal4Q] (* _Harvey P. Dale_, Jul 21 2020 *)
%o A014192 (Magma) [n: n in [0..800] | Intseq(n, 4) eq Reverse(Intseq(n, 4))]; // _Vincenzo Librandi_, Sep 09 2015
%o A014192 (PARI) ispal(n,b=4)=my(d=digits(n,b)); d==Vecrev(d) \\ _Charles R Greathouse IV_, May 03 2020
%o A014192 (Python)
%o A014192 from gmpy2 import digits
%o A014192 def A014192(n):
%o A014192     if n == 1: return 0
%o A014192     y = (x:=1<<(n.bit_length()-2&-2))<<2
%o A014192     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
%Y A014192 Palindromes in bases 2 through 10: A006995, A014190, A014192, A029952, A029953, A029954, A029803, A029955, A002113.
%K A014192 nonn,base,easy
%O A014192 1,3
%A A014192 _N. J. A. Sloane_
%E A014192 More terms from _Patrick De Geest_