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.

A331772 a(n) = Sum_{-n

This page as a plain text file.
%I A331772 #23 Oct 19 2023 11:26:07
%S A331772 0,0,16,48,120,224,424,688,1096,1600,2392,3344,4568,5984,7976,10256,
%T A331772 13112,16320,20360,24848,30136,35936,43208,51152,60184,69952,81800,
%U A331772 94576,109000,124448,141944,160592,181480,203648,229400,256688,286424,317792
%N A331772 a(n) = Sum_{-n<i<n, -n<j<n, gcd{i,j}=2} (n-|i|)*(n-|j|).
%H A331772 Paolo Xausa, <a href="/A331772/b331772.txt">Table of n, a(n) for n = 1..1000</a>
%H A331772 M. A. Alekseyev, M. Basova, and N. Yu. Zolotykh. <a href="https://doi.org/10.1137/140978090">On the minimal teaching sets of two-dimensional threshold functions</a>. SIAM Journal on Discrete Mathematics 29:1 (2015), 157-165. doi:10.1137/140978090. See p. 158.
%p A331772 VR := proc(m,n,q) local a,i,j; a:=0;
%p A331772 for i from -m+1 to m-1 do for j from -n+1 to n-1 do
%p A331772 if gcd(i,j)=q then a:=a+(m-abs(i))*(n-abs(j)); fi; od: od: a; end;
%p A331772 [seq(VR(n,n,2),n=1..50)];
%t A331772 A331772[n_]:=Sum[If[GCD[i,j]==2,If[i==j,4(n-i)^2,8(n-i)(n-j)],0],{i,2,n-1,2},{j,2,i,2}]+If[n>2,4n(n-2),0];Array[A331772,50] (* _Paolo Xausa_, Oct 18 2023 *)
%Y A331772 When divided by 8 this becomes A331773.
%K A331772 nonn
%O A331772 1,3
%A A331772 _N. J. A. Sloane_, Feb 08 2020