login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A331771 a(n) = Sum_{-n<i<n, -n<j<n, gcd{i,j}=1} (n-|i|)*(n-|j|). 4

%I #31 Aug 17 2021 10:09:00

%S 0,12,56,172,400,836,1496,2564,4080,6212,8984,12788,17488,23644,31112,

%T 40148,50912,64172,79448,97868,118912,143108,170504,202500,238080,

%U 278700,323864,374508,430272,493380,561832,638692,722656,814604,914360,1023428

%N a(n) = Sum_{-n<i<n, -n<j<n, gcd{i,j}=1} (n-|i|)*(n-|j|).

%C a(n) = 8*A332612(n)+4*n*(n-1)+4*(n-1)^2. Also adding 2 to the terms of the present sequence gives (essentially) A114146. - _N. J. A. Sloane_, Mar 14 2020

%D Koplowitz, Jack, Michael Lindenbaum, and A. Bruckstein. "The number of digital straight lines on an N* N grid." IEEE Transactions on Information Theory 36.1 (1990): 192-197. (See I(n).)

%H Seiichi Manyama, <a href="/A331771/b331771.txt">Table of n, a(n) for n = 1..1000</a>

%H 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.

%H N. J. A. Sloane, <a href="/A115004/a115004.txt">Families of Essentially Identical Sequences</a>, Mar 24 2021 (Includes this sequence)

%F a(n) = 4 * A115005(n).

%F a(n) = 4*((n-1)*(2n-1)+Sum_{i=2..n-1} (n-i)*(2*n-i)*phi(i)). - _Chai Wah Wu_, Aug 17 2021

%p VR := proc(m,n,q) local a,i,j; a:=0;

%p for i from -m+1 to m-1 do for j from -n+1 to n-1 do

%p if gcd(i,j)=q then a:=a+(m-abs(i))*(n-abs(j)); fi; od: od: a; end;

%p [seq(VR(n,n,1),n=1..50)];

%t a[n_] := Sum[Boole[GCD[i, j] == 1] (n - Abs[i]) (n - Abs[j]), {i, -n + 1, n - 1}, {j, -n + 1, n - 1}];

%t Array[a, 36] (* _Jean-François Alcover_, Apr 19 2020 *)

%o (Python)

%o from sympy import totient

%o def A331771(n): return 4*((n-1)*(2*n-1)+sum(totient(i)*(n-i)*(2*n-i) for i in range(2,n))) # _Chai Wah Wu_, Aug 17 2021

%Y When divided by 4 this becomes A115005, so this is a ninth sequence to add to the following list.

%Y The following eight sequences are all essentially the same. The simplest is A115004(n), which we denote by z(n). Then A088658(n) = 4*z(n-1); A114043(n) = 2*z(n-1)+2*n^2-2*n+1; A114146(n) = 2*A114043(n); A115005(n) = z(n-1)+n*(n-1); A141255(n) = 2*z(n-1)+2*n*(n-1); A290131(n) = z(n-1)+(n-1)^2; A306302(n) = z(n)+n^2+2*n.

%Y Cf. A332612.

%K nonn

%O 1,2

%A _N. J. A. Sloane_, Feb 08 2020

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 06:14 EDT 2024. Contains 371964 sequences. (Running on oeis4.)