cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A088978 Number of Pythagorean triangles having the n-th prime prime(n) as one of their sides.

This page as a plain text file.
%I A088978 #25 Sep 08 2022 08:45:12
%S A088978 0,1,2,1,1,2,2,1,1,2,1,2,2,1,1,2,1,2,1,1,2,1,1,2,2,2,1,1,2,2,1,1,2,1,
%T A088978 2,1,2,1,1,2,1,2,1,2,2,1,1,1,1,2,2,1,2,1,2,1,2,1,2,2,1,2,1,1,2,2,1,2,
%U A088978 1,2,2,1,1,2,1,1,2,2,2,2,1,2,1,2,1,1,2,2,2,1,1,1,1,1,1,1,2,2,1,2,1,2,1,2,1
%N A088978 Number of Pythagorean triangles having the n-th prime prime(n) as one of their sides.
%C A088978 Primitive Pythagorean triples are given parametrically by (M^2 - N^2)^2  +  (2MN)^2 = (M^2 + N^2)^2. Odd primes are uniquely representable (ignoring signs) as M^2 - N^2, but only primes of the form 4k + 1 are uniquely representable as M^2 + N^2. Since 2MN is composite for MN > 1, an odd prime can be a side of one or two Pythagorean triangles. Thus, except for a(1) = 0, a(n) is 2 for prime(n) of the form 4k + 1, and 1 otherwise. - _Chris Boyd_, Jan 25 2016
%H A088978 Robert Israel, <a href="/A088978/b088978.txt">Table of n, a(n) for n = 1..10000</a>
%p A088978 0, seq((4-ithprime(i) mod 4 + 1)/2, i=2..1000); # _Robert Israel_, Jan 25 2016
%t A088978 Table[(4 - Mod[Prime@ n, 4] + 1)/2, {n, 105}] /. _Rational -> 0 (* _Michael De Vlieger_, Jan 26 2016 *)
%o A088978 (PARI) a088978(n) = my(p=prime(n)); if(p==2,0,if((p-1)%4==0,2,1))
%o A088978 for(i=1,105,print1(a088978(i),", ")) \\ _Chris Boyd_, Jan 25 2016
%o A088978 (Magma) [0] cat [(4-NthPrime(n) mod 4+1)/2: n in [2..100]]; // _Vincenzo Librandi_, Jan 26 2016
%Y A088978 Cf. A046081.
%K A088978 nonn
%O A088978 1,3
%A A088978 _Lekraj Beedassy_, Oct 31 2003
%E A088978 Corrected and extended by _Ray Chandler_, Nov 01 2003