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!)
A278761 a(n) is the number of parallelepipeds with vertices with integer coordinates between 0 and n and diagonals from one corner to the opposite corner with an integer length. 0
0, 0, 1, 1, 1, 1, 2, 4, 5, 6, 6, 7, 10, 10, 11, 12, 15, 16, 19, 20, 23, 25, 28, 30, 33, 35, 38, 40, 44, 47, 52, 54, 57, 59, 63, 65, 71, 73, 79, 81, 86, 89, 98, 101, 106, 108, 114, 117, 126, 130, 137, 142, 147, 150, 159, 162, 173, 178, 182 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,7
LINKS
FORMULA
Sides a,b,c must satisfy the conditions that (1) a^2 + b^2 + c^2 = d^2 and (2) a, b, and c are positive, coprime, and not > n.
EXAMPLE
n=8: [1,2,2],[1,4,8],[2,3,6],[4,4,7],[6,6,7].
PROG
(Python)
def coprime(k, m, n):
while m:
k, m=m, k%m
if k==1:return 1
while k:
n, k=k, n%k
return n
oeis=[0]
for n in range(n):
kv=[i**2 for i in range(2*n)]
pyt=[]
for a in range(1, n):
for b in range(a, n+1):
for c in range(b, n+1):
if a**2+b**2+c**2 in kv and coprime(a, b, c)==1:
pyt.append([a, b, c, int((a**2+b**2+c**2)**0.5+0.1)])
oeis.append(len(pyt))
print(pyt)
CROSSREFS
Sequence in context: A086370 A083788 A058317 * A287076 A344587 A100006
KEYWORD
nonn
AUTHOR
Knut Ångström, Nov 27 2016
EXTENSIONS
Formula clarified by Harvey P. Dale, Dec 08 2017
STATUS
approved

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 10:01 EDT 2024. Contains 371967 sequences. (Running on oeis4.)