A003982 Table read by rows: 1 if x = y, 0 otherwise, where (x,y) = (0,0),(0,1),(1,0),(0,2),(1,1),(2,0),...
1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 0
Examples
Table begins 1; 0, 0; 0, 1, 0; 0, 0, 0, 0; 0, 0, 1, 0, 0; .... Northwest corner when formatted as a rectangular array: 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1 0 0 0
Links
Crossrefs
Programs
-
Mathematica
f[n_,k_]:=0; f[n_,n_]:=1; TableForm[Table[f[n,k],{n,1,10},{k,1,10}]] (* array *) Table[f[n-k+1,k],{n,10},{k,n,1,-1}]//Flatten (*sequence *) Table[Join[{1},Table[0,4n-1]],{n,10}]//Flatten (* Harvey P. Dale, Dec 21 2016 *)
-
PARI
{a(n) = issquare(2*n + 1)}; /* Michael Somos, Apr 13 2005 */
-
PARI
{a(n) = local(A); if( n<0, 0, A = x * O(x^n); polcoeff( eta(x^8 + A)^2 / eta(x^4 + A), n))};
-
PARI
A(i,j)=i==j
Formula
n-th 1 is followed by 4*n-1 0's. In the sequence with flattened indices, the 1's are at positions listed in A046092.
G.f.: 1/(1 - x*y). E.g.f.: exp(x*y).
Considered as a linear sequence, expansion of q^(-1/2)*eta(q^8)^2/eta(q^4) in powers of q. If A(x) is the g.f., then B(a) = (q*A(a^2))^2 satisfies 0 = f(B(q), B(q^2), B(q^4)) where f(u, v, w) = u^2*w - v^3 - 4*v*w^2. Also, given g.f. A(x), then B(q) = q*A(q^2) satisfies 0 = f(B(q), B(q^2), B(q^3), B(q^6)) where f(u1, u2, u3, u6) = u1*u2^2*u6 - u1*u6^3 - u3^3*u2. - Michael Somos, Apr 13 2005
a(n) = b(2*n + 1) where b(n) is multiplicative and b(2^e) = 0^e, b(p^e) = (1 + (-1)^e)/2 if p>2. - Michael Somos, Jun 06 2005
a(n) = floor(sqrt(2*n+1)) - floor(sqrt(2*n)). - Ridouane Oudra, Oct 09 2020
Comments