login
Numbers that are palindromic in base 11.
10

%I #39 Jun 14 2024 11:55:30

%S 0,1,2,3,4,5,6,7,8,9,10,12,24,36,48,60,72,84,96,108,120,122,133,144,

%T 155,166,177,188,199,210,221,232,244,255,266,277,288,299,310,321,332,

%U 343,354,366,377,388,399,410,421,432,443,454,465,476,488,499

%N Numbers that are palindromic in base 11.

%C Cilleruelo, Luca, & Baxter prove that this sequence is an additive basis of order (exactly) 3. - _Charles R Greathouse IV_, May 04 2020

%H John Cerkan, <a href="/A029956/b029956.txt">Table of n, a(n) for n = 1..10000</a>

%H Javier Cilleruelo, Florian Luca and Lewis Baxter, <a href="https://doi.org/10.1090/mcom/3221">Every positive integer is a sum of three palindromes</a>, Mathematics of Computation, Vol. 87, No. 314 (2018), pp. 3023-3055, <a href="http://arxiv.org/abs/1602.06208">arXiv preprint</a>, arXiv:1602.06208 [math.NT], 2017.

%H Patrick De Geest, <a href="http://www.worldofnumbers.com/nobase10.htm">Palindromic numbers beyond base 10</a>.

%H 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 <a href="/index/Ab#basis_03">Index entries for sequences that are an additive basis</a>, order 3.

%F Sum_{n>=2} 1/a(n) = 3.4369816... (Phunphayap and Pongsriiam, 2019). - _Amiram Eldar_, Oct 17 2020

%t f[n_,b_]:=Module[{i=IntegerDigits[n,b]},i==Reverse[i]];lst={};Do[If[f[n,11],AppendTo[lst,n]],{n,7!}];lst (* _Vladimir Joseph Stephan Orlovsky_, Jul 08 2009 *)

%t pal11Q[n_]:=Module[{idn11=IntegerDigits[n,11]},idn11==Reverse[idn11]]; Select[Range[0,500],pal11Q] (* _Harvey P. Dale_, May 11 2015 *)

%t Select[Range[0, 500], PalindromeQ[IntegerDigits[#, 11]] &] (* _Michael De Vlieger_, May 12 2017, Version 10.3 *)

%o (PARI) ispal(n,b)=my(tmp,d=log(n+.5)\log(b)-1);while(d,tmp=n%b;n\=b;if(n\b^d!=tmp,return(0));n=n%(b^d);d-=2;);d<0||n%(b+1)==0

%o is(n)=ispal(n,11) \\ _Charles R Greathouse IV_, Aug 21 2012

%o (PARI) ispal(n,b=11)=my(d=digits(n,b)); d==Vecrev(d) \\ _Charles R Greathouse IV_, May 04 2020

%o (Sage)

%o [n for n in (0..499) if Word(n.digits(11)).is_palindrome()] # _Peter Luschny_, Sep 13 2018

%o (Python)

%o from gmpy2 import digits

%o from sympy import integer_log

%o def A029956(n):

%o if n == 1: return 0

%o y = 11*(x:=11**integer_log(n>>1,11)[0])

%o return int((c:=n-x)*x+int(digits(c,11)[-2::-1]or'0',11) if n<x+y else (c:=n-y)*y+int(digits(c,11)[-1::-1]or'0',11)) # _Chai Wah Wu_, Jun 14 2024

%Y Cf. A002113 (base 10), A029957 (base 12).

%K nonn,base,easy

%O 1,3

%A _Patrick De Geest_