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!)
A308308 Number of integer-sided triangles with perimeter n and at least one pair of side lengths that are not coprime. 1

%I #10 Oct 03 2023 17:41:31

%S 0,0,0,0,1,1,2,1,3,2,4,2,5,4,6,4,8,5,10,6,11,9,13,7,15,12,16,11,19,11,

%T 23,16,25,19,27,15,31,23,31,21,36,21,40,28,43,33,47,26,50,36,52,38,60,

%U 36,62,45,66,52,72,36,75,58,74,56,84,49,91,64,93,65

%N Number of integer-sided triangles with perimeter n and at least one pair of side lengths that are not coprime.

%H Robert Israel, <a href="/A308308/b308308.txt">Table of n, a(n) for n = 1..2500</a>

%H Wikipedia, <a href="https://en.wikipedia.org/wiki/Integer_triangle">Integer Triangle</a>

%F a(n) = Sum_{k=1..floor(n/3)} Sum_{i=k..floor((n-k)/2)} sign(floor((i+k)/(n-i-k+1))) * (1 - [gcd(i,k) * gcd(i,n-i-k) * gcd(k,n-i-k) = 1]), where [] is the Iverson bracket.

%F a(n) = A005044(n) - A308074(n).

%p N:= 100: # for a(1)..a(N)

%p A:= Vector(N):

%p for a from 1 to floor(N/3) do

%p for b from a to floor((N-a)/2) do

%p if igcd(a,b) = 1 then

%p C:= select(c -> igcd(c,a*b) <> 1, [$b .. min(a+b-1,N-a-b)])+~ (a+b)

%p else C:= [$b .. min(a+b-1,N-a-b)] +~ (a+b)

%p fi;

%p A[C]:= A[C] +~ 1

%p od od:

%p convert(A,list); # _Robert Israel_, Oct 03 2023

%t Table[Sum[Sum[(1 - KroneckerDelta[GCD[i, k]*GCD[i, n - i - k]*GCD[k, n - i - k], 1])*Sign[Floor[(i + k)/(n - i - k + 1)]], {i, k, Floor[(n - k)/2]}], {k, Floor[n/3]}], {n, 100}]

%Y Cf. A005044, A308074.

%K nonn,look

%O 1,7

%A _Wesley Ivan Hurt_, May 19 2019

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 24 20:08 EDT 2024. Contains 371963 sequences. (Running on oeis4.)