|
|
A253903
|
|
The characteristic function of square pyramidal numbers.
|
|
7
|
|
|
1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0
|
|
COMMENTS
|
The n-th 1 is followed by n^2 - 1 zeros.
Square pyramidal numbers are of the form m(m+1)(2m+1)/6.
As pyramid(m) = m(m+1)(2m+1)/6 = m*(m+1/2)*(m+1)/3, (3 * pyramid(m))^(1/3) is slightly less than m + 1/2. - David A. Corneth, Oct 14 2018
|
|
LINKS
|
|
|
MATHEMATICA
|
Flatten[Table[Join[{1}, PadRight[{}, n^2-1, 0]], {n, 10}]] (* Harvey P. Dale, Mar 05 2015 *)
|
|
PROG
|
(PARI) lista(nn) = {id = 0; while (id <= nn, print1(1, ", "); id++; for (k=1, id^2-1, print1(0, ", "); ); ); } \\ Michel Marcus, Feb 20 2015
(PARI) a(n) = {if (n <= 1, return (1)); my(s = 1, k = 2); while (s < n, s += k^2; k++); (s == n); } \\ Michel Marcus, Oct 14 2018
(PARI) a(n) = my(m = sqrtnint(3*n, 3)); n==m*(m+1)*(2*m+1)/6 \\ David A. Corneth, Oct 14 2018
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|