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.

A165260 Short legs of primitive Pythagorean triples which have a perimeter which is the average of a twin prime pair.

This page as a plain text file.
%I A165260 #12 May 10 2019 21:51:52
%S A165260 3,5,15,21,24,28,36,41,59,64,89,100,101,120,131,132,141,153,155,168,
%T A165260 180,203,204,208,209,215,220,231,244,280,288,300,309,315,336,341,348,
%U A165260 351,395,405,408,429,448,453,455,495,520,540,551,567,568,580,592,636,648
%N A165260 Short legs of primitive Pythagorean triples which have a perimeter which is the average of a twin prime pair.
%e A165260 Triples (a,b,c) which satisfy the rules are (3,4,5), (5,12,13), (15,112,113), (21,220,221), (24,143,145), (28,195,197), (36,77,85), (41,840,841), (59,1740,1741), (64,1023,1025), (89,3960,3961), (100,2499,2501), ... 3+4+5=12 -> 11 and 13 are primes, 5+12+13=30 -> 29 and 31 are primes, ...
%p A165260 isA014574 := proc(n)
%p A165260         return ( isprime(n-1) and isprime(n+1) ) ;
%p A165260 end proc:
%p A165260 isA165260 := proc(n)
%p A165260         local d,bplc,b,c ;
%p A165260         for d in numtheory[divisors](n^2) do
%p A165260                 bplc := n^2/d ;
%p A165260                 c := (d+bplc)/2 ;
%p A165260                 b := (bplc-d)/2 ;
%p A165260                 if type(c,'integer') and type(b,'integer') then
%p A165260                 if c > b and b >= n then
%p A165260                         if igcd(n,b,c) = 1 and  isA014574(n+b+c) then
%p A165260                                 return true;
%p A165260                         end if;
%p A165260                 end if;
%p A165260                 end if;
%p A165260         end do:
%p A165260         return false;
%p A165260 end proc:
%p A165260 for n from 3 to 600 do
%p A165260         if isA165260(n) then
%p A165260                 printf("%d,",n);
%p A165260         end if;
%p A165260 end do: # _R. J. Mathar_, Oct 29 2011
%t A165260 amax=10^4;lst={};k=0;q=12!;Do[If[(e=((n+1)^2-n^2))>amax,Break[]];Do[If[GCD[m,n]==1,a=m^2-n^2;b=2*m*n;If[GCD[a,b]==1,If[a>b,{a,b}={b,a}];If[a>amax,Break[]];c=m^2+n^2;x=a+b+c;If[PrimeQ[x-1]&&PrimeQ[x+1],k++;AppendTo[lst,a]]]],{m,n+1,12!,2}],{n,1,q,1}];Union@lst
%Y A165260 Cf. A020884, A014574, A009004, A165261, A165262.
%K A165260 nonn
%O A165260 1,1
%A A165260 _Vladimir Joseph Stephan Orlovsky_, Sep 11 2009