cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

Showing 1-1 of 1 results.

A271626 Numbers n such that the sum of the digits of the numbers from 0 to n is a square.

Original entry on oeis.org

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
Offset: 1

Views

Author

Paolo P. Lava, Apr 11 2016

Keywords

Examples

			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.
		

Crossrefs

Programs

  • 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 *)
  • PARI
    isok(n) = issquare(sum(k=1, n, sumdigits(k))); \\ Michel Marcus, Apr 11 2016
Showing 1-1 of 1 results.