|
|
A271626
|
|
Numbers n such that the sum of the digits of the numbers from 0 to n is a square.
|
|
3
|
|
|
0, 1, 8, 17, 19, 27, 46, 62, 91, 99, 145, 152, 304, 359, 472, 513, 571, 684, 720, 799, 913, 1204, 1232, 1413, 1771, 2599, 2907, 3059, 3509, 3769, 3887, 4158, 4507, 4787, 5071, 6209, 7399, 7739, 8059, 8486, 9566, 10709, 11545, 12139, 13284, 13573, 14607, 15417
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
1,3
|
|
LINKS
|
|
|
EXAMPLE
|
0 = 0^2 and 1 = 1^2;
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 = 36 = 6^2;
1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 1 + 0 + 1 + 1 + 1 + 2 + 1 + 3 + 1 + 4 + 1 + 5 + 1 + 6 + 1 + 7 = 81 = 9^2.
|
|
MAPLE
|
with(numtheory): P:=proc(q) local a, b, c, k, n; a:=0; for n from 0 to q do b:=0; c:=n;
for k from 1 to ilog10(n)+1 do b:=b+(c mod 10); c:=trunc(c/10); od; a:=a+b;
if a=trunc(sqrt(a))*trunc(sqrt(a)) then print(n); fi; od; end: P(10^6);
|
|
MATHEMATICA
|
Select[Range[0, 16000], IntegerQ@ Sqrt@ Total@ Map[Total@ IntegerDigits@ # &, Range[0, #]] &] (* Michael De Vlieger, Apr 11 2016 *)
|
|
PROG
|
(PARI) isok(n) = issquare(sum(k=1, n, sumdigits(k))); \\ Michel Marcus, Apr 11 2016
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy,base
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|