OFFSET
1,3
COMMENTS
From A.H.M. Smeets, Jun 08 2019: (Start)
All repunit numbers in base 2 with 6*k digits are included in this sequence, i.e., all terms A000225(6*k) for k >= 0.
All repunit numbers in base 4 with 2+3*k digits are included in this sequence, i.e., all terms A002450(2+3*k) for k >= 0.
All terms A000051(6*k) for k > 0 are included in this sequence.
All terms A052539(3*k) for k > 0 are included in this sequence.
In general, for sequences with palindromic numbers in the set of bases {b, b^2, ..., b^k}, gaps of size 2 occur at the term pairs (b^(k!) - 1, b^(k!) + 1). See also A319598 for b = 2 and k = 4.
The terms occur in bursts with large gaps in between as shown in the scatterplots of log_b(a(n)-a(n-1)) versus log_b(n) and log_b(1-a(n-1)/a(n)) versus log_b(n). Terms of this sequence are those with b = 2 and k = 3. For comparison, terms with b = 3 and k = 3 are also shown in these plots.
(End)
LINKS
A.H.M. Smeets, Table of n, a(n) for n = 1..2298
A.H.M. Smeets, Scatterplot of log_b(a(n)-a(n-1)) versus log_b(n)
A.H.M. Smeets, Scatterplot of log_b(1-a(n-1)/a(n)) versus log_b(n)
EXAMPLE
89478485 = 101010101010101010101010101_2 = 11111111111111_4 = 525252525_8.
MATHEMATICA
palQ[n_, b_] := PalindromeQ[IntegerDigits[n, b]];
Reap[Do[If[palQ[n, 2] && palQ[n, 4] && palQ[n, 8], Print[n]; Sow[n]], {n, 0, 10^6}]][[2, 1]] (* Jean-François Alcover, Sep 25 2018 *)
Select[Range[0, 168*10^5], AllTrue[Table[IntegerDigits[#, d], {d, {2, 4, 8}}], PalindromeQ]&] (* Harvey P. Dale, Jan 27 2024 *)
PROG
(Sage) [n for n in (0..1000) if Word(n.digits(2)).is_palindrome() and Word(n.digits(4)).is_palindrome() and Word(n.digits(8)).is_palindrome()]
(Magma) [n: n in [0..2*10^7] | Intseq(n, 2) eq Reverse(Intseq(n, 2)) and Intseq(n, 4) eq Reverse(Intseq(n, 4)) and Intseq(n, 8) eq Reverse(Intseq(n, 8))]; // Vincenzo Librandi, Sep 24 2018
(Python)
def nextpal(n, base): # m is the first palindrome successor of n in base base
m, pl = n+1, 0
while m > 0:
m, pl = m//base, pl+1
if n+1 == base**pl:
pl = pl+1
n = n//(base**(pl//2))+1
m, n = n, n//(base**(pl%2))
while n > 0:
m, n = m*base+n%base, n//base
return m
def rev(n, b):
m = 0
while n > 0:
n, m = n//b, m*b+n%b
return m
n, a = 1, 0
while n <= 100:
if a == rev(a, 4) == rev(a, 2):
print(a)
n += 1
a = nextpal(a, 8) # A.H.M. Smeets, Jun 08 2019
(PARI) ispal(n, b) = my(d=digits(n, b)); Vecrev(d) == d;
isok(n) = ispal(n, 2) && ispal(n, 4) && ispal(n, 8); \\ Michel Marcus, Jun 11 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Jeremias M. Gomes, Sep 23 2018
STATUS
approved