login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons 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
0, 12, 56, 172, 400, 836, 1496, 2564, 4080, 6212, 8984, 12788, 17488, 23644, 31112, 40148, 50912, 64172, 79448, 97868, 118912, 143108, 170504, 202500, 238080, 278700, 323864, 374508, 430272, 493380, 561832, 638692, 722656, 814604, 914360, 1023428 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,2

COMMENTS

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

REFERENCES

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).)

LINKS

Seiichi Manyama, Table of n, a(n) for n = 1..1000

M. A. Alekseyev, M. Basova, and N. Yu. Zolotykh. On the minimal teaching sets of two-dimensional threshold functions. SIAM Journal on Discrete Mathematics 29:1 (2015), 157-165. doi:10.1137/140978090. See p. 158.

N. J. A. Sloane, Families of Essentially Identical Sequences, Mar 24 2021 (Includes this sequence)

FORMULA

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

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

MAPLE

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

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

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

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

MATHEMATICA

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

Array[a, 36] (* Jean-Fran├žois Alcover, Apr 19 2020 *)

PROG

(Python)

from sympy import totient

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

CROSSREFS

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

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.

Cf. A332612.

Sequence in context: A046998 A212507 A212508 * A009430 A035289 A275505

Adjacent sequences:  A331768 A331769 A331770 * A331772 A331773 A331774

KEYWORD

nonn

AUTHOR

N. J. A. Sloane, Feb 08 2020

STATUS

approved

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

License Agreements, Terms of Use, Privacy Policy. .

Last modified September 18 10:13 EDT 2021. Contains 347518 sequences. (Running on oeis4.)