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.

A386855 Positive nonsquare integers of the form (r^2+s^2) / (1+r*s) for rational numbers r and s.

This page as a plain text file.
%I A386855 #28 Aug 18 2025 20:16:15
%S A386855 10,20,34,52,65,73,74,130,148,160,164,202,226,241,244,265,281,290,340,
%T A386855 394,416,436,450,452,505,514,569,577,580,586,601,641,650,720,724,745,
%U A386855 801,802,820,848,865,884,898,916,929,970,976,1044,1060,1073,1098,1105,1152,1154,1226,1252,1280,1305,1321,1345
%N A386855 Positive nonsquare integers of the form (r^2+s^2) / (1+r*s) for rational numbers r and s.
%C A386855 We exclude perfect square cases, since Problem 6 of the 1988 International Mathematical Olympiad (IMO) proves that the expression (r^2+s^2) / (1+r*s) for integral numbers r and s yields a positive integer iff it is a perfect square.
%C A386855 Take a(10)=160 for example, the parametric solution is [r,s]=[(-4*U^2-296*U+23684)/(27*U^2-4320*U+27), (-788*U^2+8*U+148)/(27*U^2-4320*U+27)]
%H A386855 Xianwen Wang, <a href="/A386855/a386855.txt">Table of n, a(n) for n = 1..10000</a>
%H A386855 Encyclopedia of Mathematics, <a href="https://encyclopediaofmath.org/wiki/Legendre_theorem">Legendre theorem</a>
%t A386855 pool=Association[];mSize=100;Block[{bc,y},Monitor[Do[bc=Table[Times@@(Select[FactorInteger[d],Mod[#[[2]],2]==1&][[All,1]]),{d,{y^2-4,y}}];If[AllTrue[bc,#>1&],If[AllTrue[{Length@Solve[x^2==bc[[1]],x,Modulus->bc[[2]]],Length@Solve[x^2==bc[[2]],x,Modulus->bc[[1]]]},#>0&],pool[y]=Lookup[pool,y,0]+1];If[Length[pool]==mSize,Break[]]],{y,1,10^10}],{y}]];Keys[pool]
%Y A386855 Subsequence of A000404 and A000037.
%K A386855 nonn
%O A386855 1,1
%A A386855 _Xianwen Wang_, Aug 05 2025