A182232
Numbers that are palindromic in bases 2 and 5.
Original entry on oeis.org
0, 1, 3, 31, 93, 119, 2709, 38937, 520831, 682341, 340134981, 7609865031, 17935304097, 26777829859, 169179279801, 567897922593, 286118927218753, 2996750083037781, 4738749440161121, 6299497017331917, 8829547069230943
Offset: 1
2709 base 2 = 101010010101 and 2709 base 5 = 41314.
-
b1 = 2; b2 = 5; lst = {}; Do[d1 = IntegerDigits[n, b1]; d2 = IntegerDigits[n, b2]; If[d1 == Reverse[d1] && d2 == Reverse[d2], AppendTo[lst, n]], {n, 1000000}]; lst (* T. D. Noe, Apr 19 2012 *)
A259374
Palindromic numbers in bases 3 and 5 written in base 10.
Original entry on oeis.org
0, 1, 2, 4, 26, 52, 1066, 1667, 2188, 32152, 67834, 423176, 437576, 14752936, 26513692, 27711772, 33274388, 320785556, 1065805109, 9012701786, 9256436186, 12814126552, 18814619428, 201241053056, 478999841578, 670919564984, 18432110906024, 158312796835916, 278737550525722
Offset: 1
52 is in the sequence because 52_10 = 202_5 = 1221_3.
- Giovanni Resta, Table of n, a(n) for n = 1..39
- A.H.M. Smeets, Scatterplot of log_3(number is palindromic in base 3 and base b) versus b, for b in {2,4,5, 6,7,8,10}
Cf.
A048268,
A060792,
A097856,
A097928,
A182232,
A259374,
A097929,
A182233,
A259375,
A259376,
A097930,
A182234,
A259377,
A259378,
A249156,
A097931,
A259380-
A259384,
A099145,
A259385-
A259390,
A099146,
A007632,
A007633,
A029961-
A029964,
A029804,
A029965-
A029970,
A029731,
A097855,
A250408-
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, 5]; If[ palQ[pp, 3], AppendTo[lst, pp]; Print[pp]]; k++]; lst
b1=3; b2=5; 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 15 2015 *)
-
def nextpal(n,b): # returns the palindromic successor of n in base b
m, pl = n+1, 0
while m > 0:
m, pl = m//b, pl+1
if n+1 == b**pl:
pl = pl+1
n = (n//(b**(pl//2))+1)//(b**(pl%2))
m = n
while n > 0:
m, n = m*b+n%b, n//b
return m
n, a3, a5 = 0, 0, 0
while n <= 20000:
if a3 < a5:
a3 = nextpal(a3,3)
elif a5 < a3:
a5 = nextpal(a5,5)
else: # a3 == a5
print(n,a3)
a3, a5, n = nextpal(a3,3), nextpal(a5,5), n+1
# A.H.M. Smeets, Jun 03 2019
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 *)
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 *)
A118596
Palindromes in base 5 (written in base 5).
Original entry on oeis.org
0, 1, 2, 3, 4, 11, 22, 33, 44, 101, 111, 121, 131, 141, 202, 212, 222, 232, 242, 303, 313, 323, 333, 343, 404, 414, 424, 434, 444, 1001, 1111, 1221, 1331, 1441, 2002, 2112, 2222, 2332, 2442, 3003, 3113, 3223, 3333, 3443, 4004, 4114, 4224, 4334, 4444, 10001
Offset: 1
-
(* get NextPalindrome from A029965 *) Select[NestList[NextPalindrome, 0, 198], Max@IntegerDigits@# < 5 &] (* Robert G. Wilson v, May 09 2006 *)
Select[FromDigits/@IntegerDigits[Range[1000],5],PalindromeQ] (* Fred Patrick Doty, Aug 12 2017 *)
-
is(n)=if(n<5, return(n>=0)); my(d=digits(n)); vecmax(d)<5 && Vecrev(d)==d \\ Charles R Greathouse IV, Aug 22 2017
-
from sympy import integer_log
from gmpy2 import digits
def A118596(n):
if n == 1: return 0
y = 5*(x:=5**integer_log(n>>1,5)[0])
return int((s:=digits(n-x,5))+s[-2::-1] if nChai Wah Wu, Jun 14 2024
A029958
Numbers that are palindromic in base 13.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 28, 42, 56, 70, 84, 98, 112, 126, 140, 154, 168, 170, 183, 196, 209, 222, 235, 248, 261, 274, 287, 300, 313, 326, 340, 353, 366, 379, 392, 405, 418, 431, 444, 457, 470, 483, 496, 510, 523, 536, 549, 562
Offset: 1
- John Cerkan, Table of n, a(n) for n = 1..10000
- Javier Cilleruelo, Florian Luca and Lewis Baxter, Every positive integer is a sum of three palindromes, Mathematics of Computation, Vol. 87, No. 314 (2018), pp. 3023-3055, arXiv preprint, arXiv:1602.06208 [math.NT], 2017.
- Patrick De Geest, Palindromic numbers beyond base 10.
- Phakhinkon Phunphayap and Prapanpong Pongsriiam, Estimates for the Reciprocal Sum of b-adic Palindromes, 2019.
- Index entries for sequences that are an additive basis, order 3.
Palindromes in bases 2 through 12:
A006995,
A014190,
A014192,
A029952,
A029953,
A029954,
A029803,
A029955,
A002113,
A029956,
A029957.
-
f[n_,b_]:=Module[{i=IntegerDigits[n,b]},i==Reverse[i]];lst={};Do[If[f[n,13],AppendTo[lst,n]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 08 2009 *)
Select[Range[0,600],IntegerDigits[#,13]==Reverse[IntegerDigits[#,13]]&] (* Harvey P. Dale, Nov 16 2022 *)
-
isok(n) = my(d=digits(n, 13)); d == Vecrev(d); \\ Michel Marcus, May 13 2017
-
from sympy import integer_log
from gmpy2 import digits
def A029958(n):
if n == 1: return 0
y = 13*(x:=13**integer_log(n>>1,13)[0])
return int((c:=n-x)*x+int(digits(c,13)[-2::-1]or'0',13) if nChai Wah Wu, Jun 14 2024
A214425
Numbers n palindromic in exactly three bases b, 2 <= b <= 10.
Original entry on oeis.org
9, 10, 21, 40, 55, 63, 65, 80, 85, 100, 130, 154, 164, 178, 191, 195, 203, 235, 242, 255, 257, 273, 282, 292, 300, 325, 328, 341, 400, 455, 585, 656, 819, 910, 2709, 4095, 4097, 4161, 6643, 8200, 12291, 12483, 14762, 20485, 20805, 21525, 21845, 32152, 53235
Offset: 1
10 is palindromic in bases 3, 4, and 9.
273 is in the sequence because 100010001_2 = 101010_3 = 10101_4 = 2043_5 = 1133_6 = 540_7 = 421_8 = 333_9 = 273_10 and three of the bases, namely 2, 4 & 9, yield palindromes. - _Giovanni Resta_ and _Robert G. Wilson v_, Jul 17 2015
-
n = -1; t = {}; While[Length[t] < 100, n++; If[Count[Table[s = IntegerDigits[n, m]; s == Reverse[s], {m, 2, 10}], True] == 3, AppendTo[t, n]]]; t
A029959
Numbers that are palindromic in base 14.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 15, 30, 45, 60, 75, 90, 105, 120, 135, 150, 165, 180, 195, 197, 211, 225, 239, 253, 267, 281, 295, 309, 323, 337, 351, 365, 379, 394, 408, 422, 436, 450, 464, 478, 492, 506, 520, 534, 548, 562, 576, 591
Offset: 1
195 is DD in base 14.
196 is 100 in base 14, so it's not in the sequence.
197 is 101 in base 14.
- John Cerkan, Table of n, a(n) for n = 1..10000
- Javier Cilleruelo, Florian Luca and Lewis Baxter, Every positive integer is a sum of three palindromes, Mathematics of Computation, Vol. 87, No. 314 (2018), pp. 3023-3055, arXiv preprint, arXiv:1602.06208 [math.NT], 2017.
- Patrick De Geest, Palindromic numbers beyond base 10.
- Phakhinkon Phunphayap and Prapanpong Pongsriiam, Estimates for the Reciprocal Sum of b-adic Palindromes, 2019.
- Index entries for sequences that are an additive basis, order 3.
Palindromes in bases 2 through 13:
A006995,
A014190,
A014192,
A029952,
A029953,
A029954,
A029803,
A029955,
A002113,
A029956,
A029957,
A029958.
-
palQ[n_, b_:10] := Module[{idn = IntegerDigits[n, b]}, idn == Reverse[idn]]; Select[ Range[0, 600], palQ[#, 14] &] (* Harvey P. Dale, Aug 03 2014 *)
-
isok(n) = Pol(d=digits(n, 14)) == Polrev(d); \\ Michel Marcus, Mar 12 2017
-
from sympy import integer_log
from gmpy2 import digits
def A029959(n):
if n == 1: return 0
y = 14*(x:=14**integer_log(n>>1,14)[0])
return int((c:=n-x)*x+int(digits(c,14)[-2::-1]or'0',14) if nChai Wah Wu, Jun 14 2024
A029960
Numbers that are palindromic in base 15.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 32, 48, 64, 80, 96, 112, 128, 144, 160, 176, 192, 208, 224, 226, 241, 256, 271, 286, 301, 316, 331, 346, 361, 376, 391, 406, 421, 436, 452, 467, 482, 497, 512, 527, 542, 557, 572, 587, 602, 617
Offset: 1
- John Cerkan, Table of n, a(n) for n = 1..10000
- Javier Cilleruelo, Florian Luca and Lewis Baxter, Every positive integer is a sum of three palindromes, Mathematics of Computation, Vol. 87, No. 314 (2018), pp. 3023-3055, arXiv preprint, arXiv:1602.06208 [math.NT], 2017.
- Patrick De Geest, Palindromic numbers beyond base 10.
- Phakhinkon Phunphayap and Prapanpong Pongsriiam, Estimates for the Reciprocal Sum of b-adic Palindromes, 2019.
- Index entries for sequences that are an additive basis, order 3.
Palindromes in bases 2 through 14:
A006995,
A014190,
A014192,
A029952,
A029953,
A029954,
A029803,
A029955,
A002113,
A029956,
A029957,
A029958,
A029959.
-
f[n_,b_]:=Module[{i=IntegerDigits[n,b]},i==Reverse[i]];lst={};Do[If[f[n,15],AppendTo[lst,n]],{n,7!}];lst (* Vladimir Joseph Stephan Orlovsky, Jul 08 2009 *)
Select[Range@ 620, PalindromeQ@ IntegerDigits[#, 15] &] (* Michael De Vlieger, May 13 2017, Version 10.3 *)
-
isok(n) = my(d=digits(n, 15)); d == Vecrev(d); \\ Michel Marcus, May 14 2017
-
from sympy import integer_log
from gmpy2 import digits
def A029960(n):
if n == 1: return 0
y = 15*(x:=15**integer_log(n>>1,15)[0])
return int((c:=n-x)*x+int(digits(c,15)[-2::-1]or'0',15) if nChai Wah Wu, Jun 14 2024
A262065
Numbers that are palindromes in base-60 representation.
Original entry on oeis.org
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 61, 122, 183, 244, 305, 366
Offset: 1
. n | a(n) | base 60 n | a(n) | base 60
. -----+------+----------- ------+-------+--------------
. 100 | 2440 | [40, 40] 1000 | 56415 | [15, 40, 15]
. 101 | 2501 | [41, 41] 1001 | 56475 | [15, 41, 15]
. 102 | 2562 | [42, 42] 1002 | 56535 | [15, 42, 15]
. 103 | 2623 | [43, 43] 1003 | 56595 | [15, 43, 15]
. 104 | 2684 | [44, 44] 1004 | 56655 | [15, 44, 15]
. 105 | 2745 | [45, 45] 1005 | 56715 | [15, 45, 15]
. 106 | 2806 | [46, 46] 1006 | 56775 | [15, 46, 15]
. 107 | 2867 | [47, 47] 1007 | 56835 | [15, 47, 15]
. 108 | 2928 | [48, 48] 1008 | 56895 | [15, 48, 15]
. 109 | 2989 | [49, 49] 1009 | 56955 | [15, 49, 15]
. 110 | 3050 | [50, 50] 1010 | 57015 | [15, 50, 15]
. 111 | 3111 | [51, 51] 1011 | 57075 | [15, 51, 15]
. 112 | 3172 | [52, 52] 1012 | 57135 | [15, 52, 15]
. 113 | 3233 | [53, 53] 1013 | 57195 | [15, 53, 15]
. 114 | 3294 | [54, 54] 1014 | 57255 | [15, 54, 15]
. 115 | 3355 | [55, 55] 1015 | 57315 | [15, 55, 15]
. 116 | 3416 | [56, 56] 1016 | 57375 | [15, 56, 15]
. 117 | 3477 | [57, 57] 1017 | 57435 | [15, 57, 15]
. 118 | 3538 | [58, 58] 1018 | 57495 | [15, 58, 15]
. 119 | 3599 | [59, 59] 1019 | 57555 | [15, 59, 15]
. 120 | 3601 | [1, 0, 1] 1020 | 57616 | [16, 0, 16]
. 121 | 3661 | [1, 1, 1] 1021 | 57676 | [16, 1, 16]
. 122 | 3721 | [1, 2, 1] 1022 | 57736 | [16, 2, 16]
. 123 | 3781 | [1, 3, 1] 1023 | 57796 | [16, 3, 16]
. 124 | 3841 | [1, 4, 1] 1024 | 57856 | [16, 4, 16]
. 125 | 3901 | [1, 5, 1] 1025 | 57916 | [16, 5, 16] .
Corresponding sequences for bases 2 through 12:
A006995,
A014190,
A014192,
A029952,
A029953,
A029954,
A029803,
A029955,
A002113,
A029956,
A029957.
-
import Data.List.Ordered (union)
a262065 n = a262065_list !! (n-1)
a262065_list = union us vs where
us = [val60 $ bs ++ reverse bs | bs <- bss]
vs = [0..59] ++ [val60 $ bs ++ cs ++ reverse bs |
bs <- tail bss, cs <- take 60 bss]
bss = iterate s [0] where
s [] = [1]; s (59:ds) = 0 : s ds; s (d:ds) = (d + 1) : ds
val60 = foldr (\b v -> 60 * v + b) 0
-
[n: n in [0..600] | Intseq(n, 60) eq Reverse(Intseq(n, 60))]; // Vincenzo Librandi, Aug 24 2016
-
f[n_, b_]:=Module[{i=IntegerDigits[n, b]}, i==Reverse[i]]; lst={}; Do[If[f[n, 60], AppendTo[lst, n]], {n, 400}]; lst (* Vincenzo Librandi, Aug 24 2016 *)
pal60Q[n_]:=Module[{idn60=IntegerDigits[n,60]},idn60==Reverse[idn60]]; Select[Range[0,400],pal60Q] (* Harvey P. Dale, Nov 04 2017 *)
-
isok(m) = my(d=digits(m, 60)); d == Vecrev(d); \\ Michel Marcus, Jan 22 2022
-
from sympy import integer_log
from gmpy2 import digits, mpz
def A262065(n):
if n == 1: return 0
y = 60*(x:=60**integer_log(n>>1,60)[0])
return int((c:=n-x)*x+mpz(digits(c,60)[-2::-1]or'0',60) if nChai Wah Wu, Jun 13-14 2024
Comments