A171775
a(n) = smallest number M such that there exist bases b_2, b_3, ..., b_n with the property that M written in base b_k is a k-digit palindrome for all k=2..n.
Original entry on oeis.org
1, 3, 5, 52, 130, 1885, 1073741824, 4398046511104
Offset: 1
a(6)=1885: the bases are 1884 (1885 is 11 in base 1884), 14 (1885 is 989 in base 14), 12 (it is 1111 in base 12), 6 (it is 12421 in base 6), and 4 (it is 131131 in base 4).
Cf.
A007632,
A007633,
A029961,
A029962,
A029963,
A029964,
A029804,
A029965,
A029966,
A029967,
A029968,
A029969,
A029970,
A029731,
A097855,
A099165,
A087155,
A171701,
A171702,
A171703,
A171704,
A171705,
A171706,
A171740,
A171741,
A171742,
A253294.
Offset changed to 1, with corresponding addition of a(1) by
James G. Merickel, Jul 24 2015
A259381
Palindromic numbers in bases 3 and 8 written in base 10.
Original entry on oeis.org
0, 1, 2, 4, 121, 130, 203, 316, 8578, 9490, 17492, 944035, 1141652, 1276916, 1554173, 58961443, 67470916, 4099065139, 5691134677, 81452592329, 81473867465, 419572845958, 21056462595764, 363376288168081
Offset: 1
121 is in the sequence because 121_10 = 171_8 = 11111_3.
Cf.
A048268,
A060792,
A097856,
A097928,
A182232,
A259374,
A097929,
A182233,
A259375,
A259376,
A097930,
A182234,
A259377,
A259378,
A249156,
A097931,
A259380,
A259381,
A259382,
A259383,
A259384,
A099145,
A259385,
A259386,
A259387,
A259388,
A259389,
A259390,
A099146,
A007632,
A007633,
A029961,
A029962,
A029963,
A029964,
A029804,
A029965,
A029966,
A029967,
A029968,
-
(* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 8]; If[palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
b1=3; b2=8; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10000000}]; lst (* Vincenzo Librandi, Jul 17 2015 *)
A259383
Palindromic numbers in bases 5 and 8 written in base 10.
Original entry on oeis.org
0, 1, 2, 3, 4, 6, 18, 36, 186, 438, 2268, 2709, 11898, 18076, 151596, 228222, 563786, 5359842, 32285433, 257161401, 551366532, 621319212, 716064597, 2459962002, 5018349804, 5067084204, 7300948726, 42360367356, 139853034114, 176616961826, 469606524278, 669367713609, 1274936571666, 1284108810066, 5809320306961, 8866678870082, 11073162740322, 14952142559323, 325005646077513
Offset: 1
186 is in the sequence because 186_10 = 272_8 = 1221_5.
Cf.
A048268,
A060792,
A097856,
A097928,
A182232,
A259374,
A097929,
A182233,
A259375,
A259376,
A097930,
A182234,
A259377,
A259378,
A249156,
A097931,
A259380,
A259381,
A259382,
A259383,
A259384,
A099145,
A259385,
A259386,
A259387,
A259388,
A259389,
A259390,
A099146,
A007632,
A007633,
A029961,
A029962,
A029963,
A029964,
A029804,
A029965,
A029966,
A029967,
A029968,
A029969,
A029970,
A029731,
A097855,
A250408,
A250409,
A250410,
A250411,
A099165,
A250412.
-
(* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 8]; If[palQ[pp, 5], AppendTo[lst, pp]; Print[pp]]; k++]; lst
b1=5; b2=8; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10000000}]; lst (* Vincenzo Librandi, Jul 17 2015 *)
A259387
Palindromic numbers in bases 4 and 9 written in base 10.
Original entry on oeis.org
0, 1, 2, 3, 5, 10, 255, 273, 373, 546, 2550, 2730, 2910, 16319, 23205, 54215, 1181729, 1898445, 2576758, 3027758, 3080174, 4210945, 9971750, 163490790, 2299011170, 6852736153, 6899910553, 160142137430, 174913133450, 204283593150, 902465909895, 1014966912315, 2292918574418, 9295288254930, 11356994802010, 11372760382810, 38244097345762
Offset: 1
273 is in the sequence because 273_10 = 333_9 = 10101_4.
Cf.
A048268,
A060792,
A097856,
A097928,
A182232,
A259374,
A097929,
A182233,
A259375,
A259376,
A097930,
A182234,
A259377,
A259378,
A249156,
A097931,
A259380,
A259381,
A259382,
A259383,
A259384,
A099145,
A259385,
A259386,
A259387,
A259388,
A259389,
A259390,
A099146,
A007632,
A007633,
A029961,
A029962,
A029963,
A029964,
A029804,
A029965,
A029966,
A029967,
A029968,
-
(* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 9]; If[palQ[pp, 4], AppendTo[lst, pp]; Print[pp]]; k++]; lst
b1=4; b2=9; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10000000}]; lst (* Vincenzo Librandi, Jul 17 2015 *)
A259388
Palindromic numbers in bases 5 and 9 written in base 10.
Original entry on oeis.org
0, 1, 2, 3, 4, 6, 109, 246, 282, 564, 701, 22386, 32152, 41667, 47653, 48553, 1142597, 1313858, 1412768, 1677684, 12607012902, 19671459008, 20134447808, 24208576998, 24863844904, 26358878059
Offset: 1
246 is in the sequence because 246_10 = 303_9 = 1441_5.
Cf.
A007632,
A007633,
A029731,
A029804,
A029961,
A029962,
A029963,
A029964,
A029965,
A029966,
A029967,
A029968,
A029969,
A029970,
A048268,
A060792,
A097855,
A097856,
A097928,
A097929,
A097930,
A097931,
A099145,
A099146,
A099165,
A182232,
A182233,
A182234,
A250408,
A250409,
A250410,
A250411,
A250412,
A259374,
A259375,
A259376,
A259377,
A259378,
A249156,
A259380,
A259381,
A259382,
A259383,
A259384,
A259385,
A259386,
A259387,
A259388,
A259389,
A259390.
-
(* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 9]; If[palQ[pp, 5], AppendTo[lst, pp]; Print[pp]]; k++]; lst
b1=5; b2=9; lst={};Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10000000}]; lst (* Vincenzo Librandi, Jul 17 2015 *)
A259389
Palindromic numbers in bases 6 and 9 written in base 10.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 7, 80, 154, 191, 209, 910, 3740, 5740, 8281, 16562, 16814, 2295481, 2300665, 2350165, 2439445, 2488945, 2494129, 2515513, 7971580, 48307924, 61281793, 69432517, 123427622, 124091822, 124443290, 55854298990, 184314116750, 185794441250, 187195815770, 327925630018, 7264479038060, 27832011695551
Offset: 1
209 is in the sequence because 209_10 = 252_9 = 545_6.
Cf.
A048268,
A060792,
A097856,
A097928,
A182232,
A259374,
A097929,
A182233,
A259375,
A259376,
A097930,
A182234,
A259377,
A259378,
A249156,
A097931,
A259380,
A259381,
A259382,
A259383,
A259384,
A099145,
A259385,
A259386,
A259387,
A259388,
A259389,
A259390,
A099146,
A007632,
A007633,
A029961,
A029962,
A029963,
A029964,
A029804,
A029965,
A029966,
A029967,
A029968,
A029969,
A029970,
A029731,
A097855,
A250408,
A250409,
A250410,
A250411,
A099165,
A250412.
-
(* first load nthPalindromeBase from A002113 *) palQ[n_Integer, base_Integer] := Block[{}, Reverse[ idn = IntegerDigits[n, base]] == idn]; k = 0; lst = {}; While[k < 21000000, pp = nthPalindromeBase[k, 9]; If[palQ[pp, 6], AppendTo[lst, pp]; Print[pp]]; k++]; lst
b1=6; b2=9; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 1000000}]; lst (* Vincenzo Librandi, Jul 17 2015 *)
A248889
Palindromic in base 10 and 18.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 171, 323, 343, 505, 595, 686, 848, 1661, 2112, 3773, 23332, 46664, 69996, 262262, 583385, 782287, 859958, 981189, 1254521, 1403041, 1832381, 39388393, 54411445, 55499455, 88844888, 118919811, 191010191
Offset: 1
848 in decimal is 2B2 in base 18, so 848 is in the sequence.
1661 in decimal is 525 in base 18, so 1661 is in the sequence.
1771 in decimal is 587 in base 18, which is not a palindrome, so 1771 is not in the sequence.
Cf.
A007632,
A007633,
A029961,
A029962,
A029963,
A029964,
A029965,
A029966,
A029967,
A029968,
A029969,
A029970,
A028731,
A097855,
A248899
-
[n: n in [0..2*10^7] | Intseq(n) eq Reverse(Intseq(n)) and Intseq(n,18) eq Reverse(Intseq(n,18))]; // Vincenzo Librandi, Mar 21 2015
-
IsPalindromic := proc(n, Base)
local Conv, i;
Conv := convert(n, base, Base);
for i from 1 to nops(Conv) / 2 do
if Conv [i] <> Conv [nops(Conv) + 1 - i] then
return false;
fi:
od:
true;
end proc:
Base := 18;
A := [];
for i from 1 to 10^6 do:
S := convert(i, base, 10);
V := 0;
if i mod 10 = 0 then
next;
fi;
for j from 1 to nops(S) do:
V := V * 10 + S [j];
od:
for j from 0 to 10 do:
V1 := V * 10^(nops(S) + j) + i;
if IsPalindromic(V1, Base) then
A := [op(A), V1];
fi;
od:
V1 := (V - (V mod 10)) * 10^(nops(S) - 1) + i;
if IsPalindromic(V1, Base) then
A := [op(A), V1];
fi;
od:
sort(A);
-
palindromicQ[n_, b_:10] := TrueQ[IntegerDigits[n, b] == Reverse[IntegerDigits[n, b]]]; Select[Range[0, 499], palindromicQ[#] && palindromicQ[#, 18] &] (* Alonso del Arte, Mar 21 2015 *)
-
isok(n) = (n==0) || ((d = digits(n, 10)) && (Vecrev(d) == d) && (d = digits(n, 18)) && (Vecrev(d) == d)); \\ Michel Marcus, Mar 14 2015
-
def palgen10(l): # generator of palindromes of length <= 2*l
if l > 0:
yield 0
for x in range(1,l+1):
n = 10**(x-1)
n2 = n*10
for y in range(n,n2):
s = str(y)
yield int(s+s[-2::-1])
for y in range(n,n2):
s = str(y)
yield int(s+s[::-1])
def palcheck(n, b): # check if n is a palindrome in base b
s = digits(n, b)
return s == s[::-1]
A248889_list = [n for n in palgen10(9) if palcheck(n, 18)]
# Chai Wah Wu, Mar 23 2015
A248899
Numbers that are palindromic in bases 10 and 19.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 666, 838, 1771, 432234, 864468, 1551551, 1897981, 2211122, 155292551, 330050033, 453848354, 467535764, 650767056, 666909666, 857383758, 863828368, 47069796074, 62558085526, 67269596276, 87161116178, 96060106069, 121791197121, 127673376721, 139103301931, 234595595432, 246025520642
Offset: 1
Cf.
A007632,
A007633,
A029961,
A029962,
A029963,
A029964,
A029965,
A029966,
A029967,
A029968,
A029969,
A029970,
A029731,
A097855,
A248889.
-
[n: n in [0..2*10^7] | Intseq(n) eq Reverse(Intseq(n))and Intseq(n, 19) eq Reverse(Intseq(n, 19))]; // Vincenzo Librandi, Mar 08 2015
-
IsPalindromic := proc(n, Base) local Conv, i;
Conv := convert(n, base, Base);
for i from 1 to nops(Conv) / 2 do:
if Conv [i] <> Conv [nops(Conv) + 1 - i] then
return false:
fi:
od:
return true;
end proc;
Base := 19;
A := [];
for i from 1 to 10^6 do:
S := convert(i, base, 10);
V := 0;
if i mod 10 = 0 then
next;
fi;
for j from 1 to nops(S) do:
V := V * 10 + S [j];
od:
for j from 0 to 10 do:
V1 := V * 10^(nops(S) + j) + i;
if IsPalindromic(V1, Base) then
A := [op(A), V1];
fi;
od:
V1 := (V - (V mod 10)) * 10^(nops(S) - 1) + i;
if IsPalindromic(V1, Base) then
A := [op(A), V1];
fi;
od:
sort(A);
-
palQ[n_, b_] := Block[{d = IntegerDigits[n, b]}, If[d == Reverse@ d, True, False]]; Select[Range[0, 10^6], And[palQ[#, 10], palQ[#, 19]] &] (* Michael De Vlieger, Mar 07 2015 *)
b1=10; b2=19; lst={}; Do[d1=IntegerDigits[n, b1]; d2=IntegerDigits[n, b2]; If[d1==Reverse[d1]&&d2==Reverse[d2], AppendTo[lst, n]], {n, 0, 10^7}]; lst (* Vincenzo Librandi, Mar 08 2015 *)
-
isok(n) = (n==0) || ((d = digits(n, 10)) && (Vecrev(d) == d) && (d = digits(n, 19)) && (Vecrev(d) == d)); \\ Michel Marcus, Mar 07 2015
Comments