OFFSET
1,24
COMMENTS
The only square whose average digit is 0 is the 1-digit number 0^2 = 0.
The only square whose average digit is 9 is the 1-digit number 3^2 = 9.
Suppose m^2 is an n-digit number whose average digit is an integer k, i.e., digitsum(m^2) = n*k. Since digitsum(m^2) mod 9 = 0, 1, 4, or 7 (cf. A004159), it follows that
- if k = 1, 4, or 7, then n mod 9 = 0, 1, 4, or 7;
- if k = 2, 5, or 8, then n mod 9 = 0, 2, 5, or 8;
- if k = 3 or 6, then n mod 9 = 0, 3, or 6.
In this table, each possible combination of a value of k and a value of n mod 9 is identified with an asterisk (*):
.
n mod 9
.
0 1 2 3 4 5 6 7 8
+----------------------------------
1 | * * * *
|
2 | * * * *
|
3 | * * *
|
4 | * * * *
k |
5 | * * * *
|
6 | * * *
|
7 | * * * *
|
8 | * * * *
.
Not surprisingly, among the values k=1..8, the value of k that occurs least frequently as the average digit of a square is 8.
LINKS
Jon E. Schoenfield, Table of n, a(n) for n = 1..190
EXAMPLE
Table begins
n\k| 0 1 2 3 4 5 6 7 8 9
---+---------------------------------------------------------
1 | 1 1 0 0 1 0 0 0 0 1
2 | 0 0 0 0 0 1 0 0 0 0
3 | 0 0 0 5 0 0 2 0 0 0
4 | 0 0 0 0 6 0 0 0 0 0
5 | 0 0 5 0 0 21 0 0 1 0
6 | 0 0 0 57 0 0 42 0 0 0
7 | 0 2 0 0 192 0 0 14 0 0
8 | 0 0 52 0 0 499 0 0 0 0
9 | 0 25 191 1281 2658 2282 705 65 0 0
10 | 0 12 0 0 5308 0 0 93 0 0
11 | 0 0 548 0 0 13597 0 0 1 0
12 | 0 0 0 23310 0 0 12871 0 0 0
13 | 0 77 0 0 143724 0 0 753 0 0
14 | 0 0 5572 0 0 360720 0 0 1 0
15 | 0 0 0 449170 0 0 239403 0 0 0
16 | 0 102 0 0 3990950 0 0 6029 0 0
17 | 0 0 51977 0 0 9994767 0 0 4 0
18 | 0 417 157382 8665925 55115308 45351595 4568205 36552 8 0
MATHEMATICA
Block[{nn = 9, s}, s = MapAt[Prepend[#, 0] &, Map[Mean@ IntegerDigits[#] &, SplitBy[Range[10^(nn/2)]^2, IntegerLength], {2}], 1]; Table[Count[s[[n]], k], {n, nn}, {k, 0, 9}]] // Flatten (* Michael De Vlieger, Jul 06 2018 *)
CROSSREFS
KEYWORD
nonn,tabf,base
AUTHOR
Jon E. Schoenfield, Jul 04 2018
STATUS
approved