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.

A121086 Number of primitive Pythagorean-like triples a^2+b^2=c^2+k for k=3 with 0

This page as a plain text file.
%I A121086 #22 Dec 07 2024 19:16:06
%S A121086 1,13,119,1219,12115,121054,1210480,12101765,121011208,1210128842
%N A121086 Number of primitive Pythagorean-like triples a^2+b^2=c^2+k for k=3 with 0<c<=10^n.
%e A121086 a(1)=1 because there is one solution (a,b,c) as (4,6,7) with 0<c<=10^1.
%t A121086 (* Courtesy of Daniel Lichtblau of Wolfram Research *)
%t A121086 countTriples[m_, k_] := Module[ {c2, c2odd, total = 0, fax, g}, Do[ c2 = c^2 + k; If[c2 < 2, Continue[]]; c2odd = c2; While[EvenQ[c2odd], c2odd /= 2]; If [c2odd==1, If [OddQ[Log[2,c2]], total++ ]; Continue[]]; If[Mod[c2odd, 4] == 3, Continue[]]; g = GCD[c2odd, 100947]; If[g != 1 && g^2 != GCD[c2odd, 10190296809], Continue[]]; fax = Map[{Mod[ #[[1]],4],#[[2]]}&, FactorInteger[c2odd]]; If[Apply[Or, Map[ #[[1]] == 3 && OddQ[ #[[2]]] &, fax]], Continue []]; fax = Cases[fax, {1,aa_}:>aa+1]; fax = Ceiling[Apply[Times,fax]/2]; total += fax;, {c,m}]; total]
%Y A121086 Cf. A101931, A121082, A121083, A121084, A121085, A121087, A121088
%K A121086 more,nonn
%O A121086 1,2
%A A121086 _Tito Piezas III_, Aug 11 2006
%E A121086 First few terms found by _Tito Piezas III_, James Waldby (j-waldby(AT)pat7.com)
%E A121086 Subsequent terms found by Andrzej Kozlowski (akoz(AT)mimuw.edu.pl), Daniel Lichtblau (danl(AT)wolfram.com)
%E A121086 a(7) from _Max Alekseyev_, Jul 04 2011
%E A121086 a(8)-a(9) from _Lars Blomberg_, Dec 22 2015
%E A121086 a(10) from _Asif Ahmed_, Dec 07 2024