OFFSET
2,2
COMMENTS
Any d-digit number in base n meeting the criterion must also meet the condition d*(n-1)^2 < n^(d/2). Numerically, it can be shown this limits the candidate values to squares < 22*n^4. The larger values are statistically unlikely, and in fact the largest value of k in the first 1000 bases is ~9.96*n^4 in base 775.
LINKS
Christian N. K. Anderson, Table of n, a(n) for n = 2..1000
EXAMPLE
In base 8, the four solutions are the values {1,16,256,2601}, which are written as {1,20,400,5051} in base 8 and
sqrt(1) = 1 = 1^2;
sqrt(16) = 4 = 2^2 + 0^2;
sqrt(256) = 16 = 4^2 + 0^2 + 0^2;
sqrt(2601) = 51 = 5^2 + 0^2 + 5^2 + 1^2,
PROG
(R) inbase=function(n, b) { x=c(); while(n>=b) { x=c(n%%b, x); n=floor(n/b) }; c(n, x) }
for(n in 2:50) cat("Base", n, ":", which(sapply((1:(4.7*n^2))^2, function(x) sum(inbase(x, n)^2)==sqrt(x)))^2, "\n")
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Christian N. K. Anderson and Kevin L. Schwartz, Jun 04 2013
STATUS
approved