A348209 a(n) is the smallest positive integer k such that the base-n representation of 2^k has a pandigital ending of length n, or 0 if no such k exists.
1, 5, 0, 34, 33, 20, 0, 1689, 7386, 1971, 34180, 43983, 262717, 37576, 0, 617963, 2818633, 2136492, 5325278, 140997161, 572340185, 1140209730, 800810806, 5573697257, 6694155083, 15533636306, 220798644390
Offset: 2
Examples
a(5) = 34 because the base-5 representation of 2^34 is 240141021303214 and thus has the ending 03214, whereas none of the base-5 representations of the previous powers of 2 ends with a pandigital string of length 5.
Links
- Dimiter Skordev, Pascal program for A348209
- Dimiter Skordev, Numbers witnessing that a(n) > 0 for certain n
Programs
-
Python
from labmath import multord def w(r,n): z,s=r,set() while z%n not in s: s.add(z%n) z=z//n return len(s) def a(n): if n==2: return 1 else: v=n while v%2==0: v=v//2 if v==1: return 0 else: k,r,m=0,1,n**(n-1) while r
-
Python
from itertools import count from sympy.ntheory import digits def A348209(n): if n == 2: return 1 if n.bit_count() == 1: return 0 r = (a:=n**n).bit_length() m = pow(2,r,a) for k in count(r): if len(set((s:=digits(m,n)[1:])+([0] if len(s)
Chai Wah Wu, Aug 22 2025
Extensions
a(28) from Chai Wah Wu, Dec 13 2021
Comments