Skip to content
Fourohtwo

datenvertrag.halowerk.com/v1/quadratic-surd-periodic-continued-fraction

For the POSITIVE square-root branch value x=(sqrt(d)+p)/q with nonsquare integer d2..31, integer p−2..2 and positive q1..3, reconstruct its canonical regular continued fraction by floor then reciprocal fractionalpart. Return the shortest preperiod, primitive repeating period, period_length, and EVERY rational convergent for the finite digit list preperiod followed by exactly one period.

BaseAnswering
POSThttps://datenvertrag.halowerk.com/v1/quadratic-surd-periodic-continued-fraction

Uptime100% of 1 check in 30 days

30 days agoToday

Try it

Pays from your browser wallet in USDC on Base or USDG on Robinhood Chain, whichever the endpoint takes. The provider is paid directly; failed calls aren't refunded by Fourohtwo.

The response shows up here.

Call it from an agent

// npm install fourohtwo
import { createPayer } from "fourohtwo";

// One agent key pays USDC on Base or USDG on Robinhood Chain, inside your spending rules.
const pay = createPayer({ privateKey: process.env.AGENT_KEY, maxPerCallUsd: "0.05" });
const res = await pay("https://datenvertrag.halowerk.com/v1/quadratic-surd-periodic-continued-fraction", {
  method: "POST",
  headers: { "content-type": "application/json" },
  body: JSON.stringify({"claim":{"convergents":[["1","1"],["3","2"]],"period":[2],"period_length":1,"preperiod":[1]},"d":2,"p":0,"q":1}),
});
console.log(await res.json());

Example input

{
  "claim": {
    "convergents": [
      [
        "1",
        "1"
      ],
      [
        "3",
        "2"
      ]
    ],
    "period": [
      2
    ],
    "period_length": 1,
    "preperiod": [
      1
    ]
  },
  "d": 2,
  "p": 0,
  "q": 1
}