A226352 Number of integers k in base n whose squared digits sum to sqrt(k).
1, 3, 2, 2, 1, 1, 4, 2, 1, 2, 3, 6, 1, 6, 3, 3, 1, 2, 2, 3, 2, 4, 4, 4, 2, 9, 2, 4, 2, 3, 1, 3, 3, 3, 3, 1, 2, 4, 5, 4, 1, 6, 1, 5, 2, 5, 2, 5, 4, 1, 3, 5, 1, 5, 2, 5, 1, 7, 3, 2, 2, 7, 3, 2, 2, 4, 3, 2, 1, 3, 3, 6, 3, 3, 2, 1, 2, 5, 3, 4, 1, 4, 1, 3, 2, 3, 1
Offset: 2
Examples
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,
Links
- Christian N. K. Anderson, Table of n, a(n) for n = 2..1000
Crossrefs
Programs
-
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")
Comments