A226087 Number of values k in base n for which the sum of digits of k = sqrt(k).
1, 4, 2, 3, 3, 6, 2, 2, 2, 5, 2, 6, 2, 5, 5, 2, 2, 4, 2, 6, 6, 4, 2, 5, 2, 4, 2, 6, 2, 11, 2, 2, 6, 4, 5, 6, 2, 4, 6, 5, 2, 11, 2, 6, 5, 4, 2, 6, 2, 4, 6, 5, 2, 4, 5, 5, 6, 4, 2, 13, 2, 4, 4, 2, 5, 11, 2, 5, 6, 11, 2, 5, 2, 4, 6, 6, 6, 11, 2, 5, 2, 4, 2, 12, 5
Offset: 2
Examples
For a(16)=5 the solutions are the square numbers {1, 36, 100, 225, 441} because in base 16 they are written as {1, 24, 64, E1, 1B9} and sqrt(1) = 1 sqrt(36) = 6 = 2+4 sqrt(100) = 10 = 6+4 sqrt(225) = 15 = 14+1, and sqrt(441) = 21 = 1+11+9.
Links
- Christian N. K. Anderson, Table of n, a(n) for n = 2..10000
Crossrefs
Programs
-
R
sapply(2:16,function(n) sum(sapply((1:(n^ifelse(n>6,1.5,2)))^2, function(x) sum(inbase(x,n))==sqrt(x))))
Comments