%I A007633 M1164
%S A007633 0,1,2,4,8,121,151,212,242,484,656,757,29092,48884,74647,75457,76267,
%T A007633 92929,93739,848848,1521251,2985892,4022204,4219124,4251524,4287824,
%U A007633 5737375,7875787,7949497,27711772,83155138,112969211,123464321
%N A007633 Palindromic in bases 3 and 10.
%D A007633 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences,
Academic Press, 1995 (includes this sequence).
%D A007633 J. Meeus, Multibasic palindromes, J. Rec. Math., 18 (No. 3, 1985-1986),
168-173.
%t A007633 Do[ a = IntegerDigits[n]; b = IntegerDigits[n, 3]; If[a == Reverse[a]
&& b == Reverse[b], Print[n] ], {n, 0, 10^9} ]
%t A007633 NextPalindrome[n_] := Block[{l = Floor[ Log[10, n] + 1], idn = IntegerDigits[n]},
If[ Union[idn] == {9}, Return[n + 2], If[l < 2, Return[n + 1], If[
FromDigits[ Reverse[ Take[idn, Ceiling[l/2]] ]] FromDigits[ Take[idn,
-Ceiling[l/2]]], FromDigits[ Join[ Take[idn, Ceiling[l/2]], Reverse[
Take[idn, Floor[l/2]] ]]], idfhn = FromDigits[ Take[idn, Ceiling[l/
2]]] + 1; idp = FromDigits[ Join[ IntegerDigits[idfhn], Drop[ Reverse[
IntegerDigits[idfhn]], Mod[l, 2]] ]]] ]]]; palQ[n_Integer, base_Integer]
:= Block[{idn = IntegerDigits[n, base]}, idn == Reverse[idn]]; l
= {0}; a = 0; Do[a = NextPalindrome[a]; If[ palQ[a, 4], AppendTo[l,
a]], {n, 100000}]; l (from Robert G. Wilson v Sep 30 2004)
%Y A007633 Cf. A007632, A029961, A029962, A029963, A029964, A029804, A029965, A029966,
A029967, A029968, A029969, A029970, A029731, A097855, A099165.
%Y A007633 Sequence in context: A018694 A129661 A018713 this_sequence A018777 A130693
A060815
%Y A007633 Adjacent sequences: A007630 A007631 A007632 this_sequence A007634 A007635
A007636
%K A007633 nonn,base
%O A007633 1,3
%A A007633 N. J. A. Sloane (njas(AT)research.att.com), Mira Bernstein, Robert G.
Wilson v (rgwv(AT)rgwv.com)
|