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.

Original entry on oeis.org

10, 20, 34, 52, 65, 73, 74, 130, 148, 160, 164, 202, 226, 241, 244, 265, 281, 290, 340, 394, 416, 436, 450, 452, 505, 514, 569, 577, 580, 586, 601, 641, 650, 720, 724, 745, 801, 802, 820, 848, 865, 884, 898, 916, 929, 970, 976, 1044, 1060, 1073, 1098, 1105, 1152, 1154, 1226, 1252, 1280, 1305, 1321, 1345
Offset: 1

Views

Author

Xianwen Wang, Aug 05 2025

Keywords

Comments

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.
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)]

Crossrefs

Subsequence of A000404 and A000037.

Programs

  • Mathematica
    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]