cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A369233 Smallest base for which the digits expansion of 2^n is palindromic.

Original entry on oeis.org

3, 3, 3, 3, 7, 7, 7, 15, 7, 7, 31, 7, 15, 15, 31, 15, 15, 31, 63, 15, 31, 31, 127, 63, 31, 31, 63, 127, 127, 31, 63, 63, 255, 255, 127, 63, 63, 127, 511, 255, 255, 63, 127, 127, 511, 511, 511, 255, 127, 127, 255, 1023, 1023, 511, 511, 127, 255, 255, 2047, 1023, 1023, 1023, 127, 255
Offset: 1

Views

Author

Michel Marcus, Jan 17 2024

Keywords

Comments

From the Kreher and Stinson article we know that a(n) is of the form 2^k-1 (cf. A000225). - David A. Corneth, Jan 18 2024

Crossrefs

Programs

  • Maple
    f:= proc(n) local x,b,L,i;
      x:= 2^n;
      for b from 3 do
        L:= convert(x,base,b);
        if andmap(i -> L[i]=L[-i], [$1..nops(L)/2]) then return b fi
      od
    end proc:
    map(f,[$1..100]); # Robert Israel, Jan 17 2024
  • Mathematica
    A369233[n_] := Block[{p = 2^n, k = 1}, While[!PalindromeQ[IntegerDigits[p, 2^++k-1]]]; 2^k-1]; Array[A369233, 100] (* Paolo Xausa, Mar 10 2024 *)
  • PARI
    ispal(n, b) = my(d=digits(n, b)); d == Vecrev(d);
    a(n) = my(b=2, N=2^n); while (! ispal(N, b), b++); b;
    
  • PARI
    a(n) = {my(pow2 = 1<David A. Corneth, Jan 18 2024
    
  • Python
    from itertools import count
    from sympy.ntheory.factor_ import digits
    def A369233(n):
        m = 1<>1)]==s[:-t-1:-1]) # Chai Wah Wu, Jan 17 2024

Formula

a(n) = A016026(A000079(n)).