OFFSET
2,3
COMMENTS
By definition, a(n) <= sqrt(Sum_{i=0..n-1} i*n^i) = sqrt(A062813(n)). If n is odd and n-1 has an even number of 2s as prime factors, then there are no pandigital squares in base n, so a(n) <= sqrt(Sum_{i=1..n-1} i*n^(i-1)) = sqrt(A051846(n-1)); see A258103.
If n is odd and n-1 has an even 2-adic valuation, then a(n) <= sqrt(Sum_{i=2..n-1} i*n^(i-2)); see A258103. - Chai Wah Wu, Feb 25 2024
LINKS
Michael S. Branicky, Table of n, a(n) for n = 2..28
EXAMPLE
Base 4: 15^2 = 225 = 3201_4;
Base 6: 195^2 = 38025 = 452013_6;
Base 7: 867^2 = 751689 = 6250341_7;
Base 8: 3213^2 = 10323369 = 47302651_8;
Base 9: 18858^2 = 355624164 = 823146570_9;
Base 10: 99066^2 = 9814072356;
Base 11: 528905^2 = 279740499025 = A8701245369_11;
Base 12: 2950717^2 = 8706730814089 = B8750A649321_12;
Base 13: 294699^2 = 86847500601 = 8260975314_13.
PROG
(PARI) isconsecutive(m, n)=my(v=vecsort(digits(m, n))); for(i=2, #v, if(v[i]!=1+v[i-1], return(0))); 1 \\ isconsecutive(k, n) == 1 if and only if any two consecutive digits of the base-n expansion of m differ by 1 after arranging the digits in decreasing order
a(n) = forstep(m=sqrtint(if(n%2==1 && valuation(n-1, 2)%2==0, n^(n-1) - (n^(n-1)-1)/(n-1)^2, n^n - (n^n-n)/(n-1)^2)), 0, -1, if(isconsecutive(m^2, n), return(m)))
(Python)
from math import isqrt
from sympy import multiplicity
from sympy.ntheory import digits
def a(n):
ub = isqrt(sum(i*n**i for i in range(n)))
if n%2 == 1 and multiplicity(2, n-1)%2 == 0:
ub = isqrt(sum(i*n**(i-2) for i in range(2, n)))
return(next(i for i in range(ub, -1, -1) if len(d:=sorted(digits(i*i, n)[1:])) == d[-1]-d[0]+1 == len(set(d))))
print([a(n) for n in range(2, 13)]) # Michael S. Branicky, Feb 23 2024
CROSSREFS
KEYWORD
nonn,base,hard
AUTHOR
Jianing Song, Feb 16 2024
EXTENSIONS
a(17)-a(20) and a(22)-a(26) from Michael S. Branicky, Feb 23 2024
a(21) from Chai Wah Wu, Feb 25 2024
STATUS
approved