A221645 Square array read by antidiagonals: T(n,k^2) = A040000(n) (= 1,2,2,2,...) if n=0 (mod k), T(n,k) = 0 else, n>=0, k>=1.
1, 2, 0, 2, 0, 0, 2, 0, 0, 1, 2, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 2, 0, 0, 2, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 2, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
Offset: 1
Examples
First 16 elements of first 16 rows of the square array are 1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,... 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... 2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,... 2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,... 2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,... 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... 2,0,0,2,0,0,0,0,2,0,0,0,0,0,0,0,... 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... 2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,2,... 2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,... 2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,... 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... 2,0,0,2,0,0,0,0,2,0,0,0,0,0,0,2,... 2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,... 2,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,... 2,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,... ... For n = 3 the sum of the third antidiagonal is 2+0+0 = d(3) = A000005(3) = 2. For n = 16 the sum of the 16th antidiagonal is 2+0+0+2+0+0+0+0+0+0+0+0+0+0+0+1 = d(16) = A000005(16) = 5.
Programs
-
PARI
A221645(n,m)={my(t); issquare(m,&t)||return; n||return(1); n%t & return;2} \\ M. F. Hasler, Feb 02 2013
Formula
sum_{k=1...n} a(n-k,k) = A000005(n) for all n>0. - M. F. Hasler, Feb 02 2013
Comments