login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A173551 Palindromes in base 10 and in at least one other base (from 2 to 9). 2

%I #40 Jul 13 2023 19:41:04

%S 0,1,2,3,4,5,6,7,8,9,33,55,88,99,111,121,141,151,171,191,212,242,252,

%T 282,292,313,333,343,373,393,414,434,464,484,555,585,626,646,656,666,

%U 676,717,757,777,787,868,939,1221,1441,3663,6886,7447,7667,7777,7997,8778,9009

%N Palindromes in base 10 and in at least one other base (from 2 to 9).

%H Robert G. Wilson v, <a href="/A173551/b173551.txt">Table of n, a(n) for n = 1..510</a>

%H Edray Herber Goins, <a href="http://www.emis.de/journals/INTEGERS/papers/j55/j55.Abstract.html">Palindromes in Different Bases: A Conjecture of J. Ernest Wilkins</a>, Integers 9 (2009), 725-734.

%e a(11) = 33 = {1,0,0,0,1} in base 2;

%e a(99) = 909909 = {3, 1, 3, 0, 0, 3, 1, 3} in base 6;

%e a(98) = 848848 = {1, 1, 2, 1, 0, 1, 0, 1, 0, 1, 2, 1, 1} in base 3.

%p N:= 6: # to get all terms of up to N digits

%p digrev:= proc(n) local L;

%p L:= convert(n,base,10);

%p add(L[-i]*10^(i-1),i=1..nops(L));

%p end proc:

%p basepali:= proc(b,n)

%p local L;

%p L:= convert(n,base,b);

%p evalb(L = ListTools:-Reverse(L))

%p end proc:

%p Res:= $0..9:

%p for d from 2 to N do

%p if d::even then

%p m:= d/2;

%p Res:= Res, seq(n*10^m + digrev(n), n=10^(m-1)..10^m-1);

%p else

%p m:= (d-1)/2;

%p Res:= Res, seq(seq(n*10^(m+1)+y*10^m+digrev(n), y=0..9), n=10^(m-1)..10^m-1);

%p fi

%p od:

%p select(t -> ormap(basepali,[$2..9],t), [Res]); # _Robert Israel_, Oct 15 2014

%t palQ[n_Integer,base_Integer]:=Block[{},Reverse[idn=IntegerDigits[n,base]]==idn]

%t ; Select[Range[0, 10000], palQ[#,10] && (palQ[#,2] || palQ[#,3] || palQ[#,4] || palQ[#,5] || palQ[#,6] || palQ[#,7] || palQ[#,8] || palQ[#,9]) &] (* _Robert G. Wilson v_, Oct 10 2014 *)

%t palQ[n_,b_]:=Module[{idb=IntegerDigits[n,b]},idb==Reverse[idb]]; pal2to9[n_]:=Total[Boole[ Table[palQ[n,b],{b,2,9}]]]>0; Select[Range[0,10000],PalindromeQ[#]&&pal2to9[#]&] (* _Harvey P. Dale_, Jul 13 2023 *)

%Y Cf. A165932.

%K nonn,base

%O 1,3

%A _José María Grau Ribas_, Feb 21 2010

%E Term 0 prepended by _Robert G. Wilson v_, Oct 10 2014

%E Definition clarified by _Harvey P. Dale_, Jul 13 2023

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 19 23:15 EDT 2024. Contains 371798 sequences. (Running on oeis4.)