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.

A014190 Palindromes in base 3 (written in base 10).

This page as a plain text file.
%I A014190 #48 Feb 16 2025 08:32:33
%S A014190 0,1,2,4,8,10,13,16,20,23,26,28,40,52,56,68,80,82,91,100,112,121,130,
%T A014190 142,151,160,164,173,182,194,203,212,224,233,242,244,280,316,328,364,
%U A014190 400,412,448,484,488,524,560,572,608,644,656,692,728,730,757
%N A014190 Palindromes in base 3 (written in base 10).
%C A014190 Rajasekaran, Shallit, & Smith prove that this sequence is an additive basis of order (exactly) 3. - _Charles R Greathouse IV_, May 03 2020
%H A014190 T. D. Noe, <a href="/A014190/b014190.txt">Table of n, a(n) for n = 1..10000</a>
%H A014190 Patrick De Geest, <a href="http://www.worldofnumbers.com/nobase10.htm">Palindromic numbers beyond base 10</a>.
%H A014190 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 A014190 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 A014190 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PalindromicNumber.html">Palindromic Number</a>.
%H A014190 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/Ternary.html">Ternary</a>.
%H A014190 <a href="/index/Ab#basis_03">Index entries for sequences that are an additive basis</a>, order 3.
%F A014190 Sum_{n>=2} 1/a(n) = 2.61676111... (Phunphayap and Pongsriiam, 2019). - _Amiram Eldar_, Oct 17 2020
%p A014190 isA014190 := proc(n)
%p A014190     local L;
%p A014190     L := convert(n,base,3) ;
%p A014190     ListTools[Reverse](L) = L ;
%p A014190 end proc:
%p A014190 for n from 0 to 500 do
%p A014190     if isA014190(n) then
%p A014190         printf("%d,",n) ;
%p A014190     end if;
%p A014190 end do: # _R. J. Mathar_, Jul 07 2015
%t A014190 f[n_,b_] := Module[{i=IntegerDigits[n,b]}, i==Reverse[i]]; lst={}; Do[If[f[n,3], AppendTo[lst,n]], {n,1000}]; lst (* _Vladimir Joseph Stephan Orlovsky_, Jul 08 2009 *)
%o A014190 (Magma) [n: n in [0..800] | Intseq(n, 3) eq Reverse(Intseq(n, 3))]; // _Vincenzo Librandi_, Sep 09 2015
%o A014190 (Sage)
%o A014190 [n for n in (0..757) if Word(n.digits(3)).is_palindrome()] # _Peter Luschny_, Sep 13 2018
%o A014190 (PARI) ispal(n,b=3)=my(d=digits(n,b)); d==Vecrev(d) \\ _Charles R Greathouse IV_, May 03 2020
%o A014190 (Python)
%o A014190 from gmpy2 import digits
%o A014190 def A014190(n):
%o A014190     if n == 1: return 0
%o A014190     y = 3*(x:=3**(len(digits(n>>1,3))-1))
%o A014190     return int((c:=n-x)*x+int(digits(c,3)[-2::-1]or'0',3) if n<x+y else (c:=n-y)*y+int(digits(c,3)[-1::-1]or'0',3)) # _Chai Wah Wu_, Jun 13 2024
%Y A014190 Cf. A007089, A118594, A134027, A330312 (first differences).
%Y A014190 Palindromes in bases 2 through 10: A006995, A014190, A014192, A029952, A029953, A029954, A029803, A029955, A002113.
%K A014190 nonn,base,easy
%O A014190 1,3
%A A014190 _N. J. A. Sloane_