login
Square array A(n,k) = A156552(gcd(A005940(1+n), A005940(1+k))), read by antidiagonals.
4

%I #6 Feb 27 2022 22:24:46

%S 0,0,0,0,1,0,0,0,0,0,0,1,2,1,0,0,0,0,0,0,0,0,1,0,3,0,1,0,0,0,2,0,0,2,

%T 0,0,0,1,2,1,4,1,2,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,3,0,5,0,3,0,1,0,0,0,

%U 0,0,0,2,2,0,0,0,0,0,0,1,2,1,0,1,6,1,0,1,2,1,0,0,0,2,0,4,0,0,0,0,4,0,2,0,0

%N Square array A(n,k) = A156552(gcd(A005940(1+n), A005940(1+k))), read by antidiagonals.

%C The indices run as A(0,0), A(0,1), A(1,0), A(0,2), A(1,1), A(2,0), etc. The array is symmetric.

%H <a href="/index/Bi#binary">Index entries for sequences related to binary expansion of n</a>

%F For all x, y >= 0, A(x, y) = A(x, A351960(x,y)) = A(A351960(x,y), y).

%e The top left corner of the array:

%e n= 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

%e -----|--------------------------------------------------------------

%e k= 0 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

%e 1 | 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1,

%e 2 | 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 2, 2, 0, 2, 2, 0, 0, 0,

%e 3 | 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1, 0, 3, 0, 1,

%e 4 | 0, 0, 0, 0, 4, 0, 0, 0, 0, 4, 4, 0, 4, 0, 0, 0, 0, 0,

%e 5 | 0, 1, 2, 1, 0, 5, 2, 1, 0, 1, 2, 5, 0, 5, 2, 1, 0, 1,

%e 6 | 0, 0, 2, 0, 0, 2, 6, 0, 0, 0, 2, 2, 0, 6, 6, 0, 0, 0,

%e 7 | 0, 1, 0, 3, 0, 1, 0, 7, 0, 1, 0, 3, 0, 1, 0, 7, 0, 1,

%e 8 | 0, 0, 0, 0, 0, 0, 0, 0, 8, 0, 0, 0, 0, 0, 0, 0, 0, 8,

%e 9 | 0, 1, 0, 1, 4, 1, 0, 1, 0, 9, 4, 1, 4, 1, 0, 1, 0, 1,

%e 10 | 0, 0, 2, 0, 4, 2, 2, 0, 0, 4, 10, 2, 4, 2, 2, 0, 0, 0,

%e 11 | 0, 1, 2, 3, 0, 5, 2, 3, 0, 1, 2, 11, 0, 5, 2, 3, 0, 1,

%e 12 | 0, 0, 0, 0, 4, 0, 0, 0, 0, 4, 4, 0, 12, 0, 0, 0, 0, 0,

%e 13 | 0, 1, 2, 1, 0, 5, 6, 1, 0, 1, 2, 5, 0, 13, 6, 1, 0, 1,

%e 14 | 0, 0, 2, 0, 0, 2, 6, 0, 0, 0, 2, 2, 0, 6, 14, 0, 0, 0,

%e 15 | 0, 1, 0, 3, 0, 1, 0, 7, 0, 1, 0, 3, 0, 1, 0, 15, 0, 1,

%e 16 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16, 0,

%e 17 | 0, 1, 0, 1, 0, 1, 0, 1, 8, 1, 0, 1, 0, 1, 0, 1, 0, 17,

%o (PARI)

%o up_to = 104; \\ 10439 = binomial(144+1,2)-1

%o A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); (t); };

%o A156552(n) = { my(f = factor(n), p, p2 = 1, res = 0); for(i = 1, #f~, p = 1 << (primepi(f[i, 1]) - 1); res += (p * p2 * (2^(f[i, 2]) - 1)); p2 <<= f[i, 2]); res };

%o A351961sq(n,k) = A156552(gcd(A005940(1+n),A005940(1+k)));

%o A351961list(up_to) = { my(v = vector(1+up_to), i=0); for(a=0,oo, for(col=0,a, i++; if(i > #v, return(v)); v[i] = A351961sq(col,(a-(col))))); (v); };

%o v351961 = A351961list(up_to);

%o A351961(n) = v351961[1+n];

%Y Cf. A003989, A005940, A156552.

%Y Cf. A001477 (main diagonal).

%Y Cf. also A341520, A351960, A351962.

%K nonn,tabl

%O 0,13

%A _Antti Karttunen_, Feb 26 2022