# Is $11^2+12^2+13^2+14^2+15^2+16^2=1111$ special?

Is this pure coincidence or is this a special case of some well-known number-theoretic result?

If the latter is true, is there some notable generalization?

EDIT: Thanks to the interesting answers below, a follow-up question is now on MathOverflow: https://mathoverflow.net/questions/239033/repdigit-numbers-which-are-sum-of-consecutive-squares?noredirect=1#comment591447_239033

• What are you referring to as a pure coincidence? May 16, 2016 at 19:02
• Let me just note here that if you multiply both sides by $3^2$ and add $1^2$, then on one side you will have a sum of 7 squares and on the other a single square. May 16, 2016 at 19:02
• There certainly are a lot of numbers that are expressible as a sum of six squares... May 16, 2016 at 19:04
• @flawr I think OP is asking whether can we express concatenation of a digit $a\in \{1,2,\dots, 9\}$ as sum of squares of consecutive numbers (doesn't have to be exactly 6)? For ex- can 111111 or 2222 or 55555 can be expressed as sum of squares of n consecutive integers for some natural number n. May 16, 2016 at 19:08
• @DamianReding Well this is just "special" in base 10, and most number theoretic stuff is independent of the base. For each sum of consecutive squares you can probably find some base where the sum looks nice. If you want a base of a number n such that it consists of a repetition of a certain digit, just use base $n-1$ and $n=11_{n-1}$ May 16, 2016 at 19:16

It is probably coincidence. When considering sums of 16 or less consecutive squares, where the smallest is at most $200^2$, I found only one other such sum:

$$71^2+72^2+73^2+74^2+75^2+76^2+77^2+78^2=44444$$

• Interesting. I guess this raises the question whether or not there are infinitely many such :) May 16, 2016 at 19:55
• Expanding the search, the next one is $444444 = 51^2 + \ldots + 113^2$. May 16, 2016 at 20:51
• No more below $10^8$, if my program is right. May 16, 2016 at 21:06
• ... and now no more below $10^{12}$. On heuristic grounds (see my answer), I would be rather surprised if there were any more, and extremely surprised if there were infinitely many. May 16, 2016 at 21:57

rare. Seems to be impossible for numeral bases $5, 11.$ I reported the numbers in base ten, you need to imagine how to write them in the specified base. Base 15 does not seem to work, except for 13; that is, as the base gets larger, we get sums of consecutive squares that are smaller than the base and thus require just one digit. Base 16 ("hexadecimal") does well, we get $1111111_{16}.$

 base   17
54               2   5
90               2   6
126               4   7
2456               4   19
end base   17


 base   16
85               6   7
204               1   8
255               5   9
221               10   11
819               1   13
2730               8   20
17895697               624   666
end base   16


 base   14
30               1   4
90               2   6
135               3   7
20685               25   42
end base   14


 base   13
14               1   3
140               1   7
126               4   7
366               8   11
4760               8   24
4760               23   29
11900               18   34
23800               18   42
11900               35   42
end base   13


 base   12
13               2   3
91               1   6
7540               15   29
9425               5   30
end base   12


 base   10
55               1   5
77               4   6
1111               11   16
44444               71   78
444444               51   113
end base   10


 base   9
30               1   4
50               3   5
91               1   6
728               7   13
44286               16   51
332150               53   104
end base   9


 base   8
54               2   5
365               10   12
365               13   14
1755               5   17
3510               10   22
end base   8


 base   7
285               1   9
end base   7


 base   6
14               1   3
86               3   6
1036               9   15
9331               19   32
end base   6


 base   4
5               1   2
85               6   7
255               5   9
2730               8   20
end base   4


 base   3
13               2   3
728               7   13
end base   3


 base   2
255               5   9
end base   2


This is the meat of the program, C++ with GMP

mpz_class choose3(mpz_class n)
{
return n * (n-1) * (n-2) / 6;
}

mpz_class squarepyramid(mpz_class n)
{
return choose3(n+2 ) + choose3(n+1 ) ;
}

int main()
{
mpz_class base = 10;
cout << " base   " << base << endl;
for(mpz_class x = 2; x <= 12200; ++x) {
for(mpz_class y = 0; y < x -1; ++y) {

// cout << x << "   " << squarepyramid(x) << endl;
mpz_class m = squarepyramid(x) - squarepyramid(y) ;
mpz_class n =  1;
while (n < m) n *= base;
n -= 1;
n /= (base - 1);
if( m % n == 0 && m >= base) cout << m << "               "  << y+1 <<  "   "  << x << endl;

}}
cout << " end base   " << base << endl;
return 0 ;
}


• Nice! How far have you checked the base 10 ones? May 16, 2016 at 20:32
• @DamianReding I just did it over letting the higher end of the squared numbers to be <= 2200. Base 16 was nice, you get 1111111 in base 16, that is ( 16^7 - 1) / 15. May 16, 2016 at 20:41
• @DamianReding finshed the base 10 up to the 12200 in the program excerpt pasted above. Nothing new. May 16, 2016 at 21:10
• OK, now I'm curious^^ May 16, 2016 at 21:11
• @DamianReding good. Note that I do not know what ^^ means. It would be interesting to actually prove impossibility for some of the bases where i could not find any. Note that I had to add in the check " m >= base" because the program was reporting 13 as a solution whenever the base was at least 14. This just means that 13 requires just a single digit in, for example, hexadecimal. May 16, 2016 at 21:16

I've heard this kind of thing called a curio, or "curiosity." The kind of thing that makes you go, "Huh ... neat!"

Piquito's answer is interesting. I wouldn't be so bold as to say it's the answer, because there are lots of other ways to dissect and reassemble things. For example:

$$1111 = 555 + 555 + 1 = 10 \cdot 111 + 1.$$

The formula for the sum of the squares of six consecutive integers, starting with $n$, is $S(n) = 6n^2 + 30n + 55.$ This will let you probe that space (I didn't see any other examples of repeated-digit numbers, and I looked up to around $n=90000$.)

Or, extending a bit, the sum of $m$ consecutive squares, starting with the square of $n$ is

$$S'(m,n) = mn^2 + m(m-1)n + \frac{(m-1)m(2m-1)}{6}.$$

For example $$S'(6,11) = 1111$$

Canvassing this space would result in a subset of OEIS sequence A180436, "Palindromic numbers which are sum of consecutive squares." The next one above $1111$ that has just one digit in its representation is $44444$. I'm resisting the temptation to figure out which squares this one is a sum of. (OK, wythagoras figured it out.)

Anyway, if there is a relationship or an underlying rule, it's well-hidden. But it's fun to look!

• I corrected a typo in your formula. :) Dec 13, 2016 at 14:54

It looks like the $n$'th positive integer representable as a sum of consecutive squares is asymptotically on the order of $\alpha n^\beta$ for some positive constants $\alpha$ and $\beta$ (on the basis of the solutions $\le 10^6$, I'd estimate $\alpha \approx 0.871$, $\beta \approx 1.436$, but all that really matters for this posting is $\beta > 1$). If so, the probability that a random number $N$ is so representable is on the order of $\dfrac{N^{1/\beta - 1}}{\alpha^{1/\beta} \beta}$. Now there are $9$ base-10 repunits with $d$ digits, so (if these repunits are "typical") the expected number of those that are representable is on the order of a constant times $10^{d(1/\beta-1)}$. Since $\sum_{d=1}^\infty 10^{d(1/\beta-1)} < \infty$, we should expect only finitely many base-10 repunits to be representable as sums of consecutive squares.

Of course this is just heuristic (we really have no reason to think the repunits are "typical"), so should not be taken too seriously.

The reason is that $$11^2+12^2+13^2+14^2+15^2+16^2=600+420+91$$ in which the summands are such that successively give $1,1,1,1$ when making the sum. In fact, $$(10+1)^2+(10+2)^2+(10+3)^2+(10+4)^2+(10+5)^2+(10+6)^2=6\cdot10^2+20(1+2+3+4+5+6)+(1^2+2^2+3^2+4^2+5^2+6^2)=6\cdot10^2+20(\frac{6\cdot7}{2})+\frac{6(6+1)(2\cdot6+1)}{6}=600+420+91$$

I don't know if it is generalizable.