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!)
A088978 Number of Pythagorean triangles having the n-th prime prime(n) as one of their sides. 2
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, 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, 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 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,3

COMMENTS

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

LINKS

Robert Israel, Table of n, a(n) for n = 1..10000

MAPLE

0, seq((4-ithprime(i) mod 4 + 1)/2, i=2..1000); # Robert Israel, Jan 25 2016

MATHEMATICA

Table[(4 - Mod[Prime@ n, 4] + 1)/2, {n, 105}] /. _Rational -> 0 (* Michael De Vlieger, Jan 26 2016 *)

PROG

(PARI) a088978(n) = my(p=prime(n)); if(p==2, 0, if((p-1)%4==0, 2, 1))

for(i=1, 105, print1(a088978(i), ", ")) \\ Chris Boyd, Jan 25 2016

(MAGMA) [0] cat [(4-NthPrime(n) mod 4+1)/2: n in [2..100]]; // Vincenzo Librandi, Jan 26 2016

CROSSREFS

Cf. A046081.

Sequence in context: A264840 A308188 A046219 * A276948 A160245 A154351

Adjacent sequences:  A088975 A088976 A088977 * A088979 A088980 A088981

KEYWORD

nonn

AUTHOR

Lekraj Beedassy, Oct 31 2003

EXTENSIONS

Corrected and extended by Ray Chandler, Nov 01 2003

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 23 14:40 EDT 2021. Contains 347618 sequences. (Running on oeis4.)