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!)
A140466 a(n) = 4*A002088(n). 1

%I #15 Mar 26 2021 08:42:19

%S 0,4,8,16,24,40,48,72,88,112,128,168,184,232,256,288,320,384,408,480,

%T 512,560,600,688,720,800,848,920,968,1080,1112,1232,1296,1376,1440,

%U 1536,1584,1728,1800,1896,1960,2120,2168,2336,2416,2512,2600,2784,2848,3016,3096

%N a(n) = 4*A002088(n).

%C Number of distinct slopes in an n X n grid.

%H Al Zimmermann, <a href="/A140466/b140466.txt">Table of n, a(n) for n = 0..49999</a>

%H Achim Flammenkamp, <a href="http://www.math.uni-bielefeld.de/~sillke/PUZZLES/cube3">Cube 3</a>

%o (Python)

%o from functools import lru_cache

%o @lru_cache(maxsize=None)

%o def A140466(n): # based on second formula in A018805

%o if n == 0:

%o return 0

%o c, j = 0, 2

%o k1 = n//j

%o while k1 > 1:

%o j2 = n//k1 + 1

%o c += (j2-j)*(A140466(k1)//2-1)

%o j, k1 = j2, n//j2

%o return 2*(n*(n-1)-c+j) # _Chai Wah Wu_, Mar 25 2021

%Y Cf. A002088.

%K nonn

%O 0,2

%A _Ed Pegg Jr_, Jun 29 2008

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 September 17 16:03 EDT 2024. Contains 375987 sequences. (Running on oeis4.)