🇵🇸 We stand with Palestine

Ethical Capital
  • About
  • Process
  • Strategies
  • Insights
  • Get In Touch
  • Login

On this page

  • Ethical Capital Labs · Prime Factor Demo

Timestamp Prime Factors

Factor the current epoch time into primes using a playful Ethical Capital demo.

Ethical Capital Labs · Prime Factor Demo

A quick, brand-friendly puzzle

We usually model portfolios with thousands of Monte Carlo paths. When the engines cool down, we like to remind ourselves that every number hides a clean, deterministic structure. Tap the button to factor the current Unix timestamp into primes.

Inputs = await import("https://cdn.jsdelivr.net/npm/@observablehq/inputs@0.12.0/+esm")
viewof refresh = Inputs.button("Factor current time", {icon: "clock"})
unixTimeSeconds = {
  refresh;
  return Math.floor(Date.now() / 1000);
}
primeFactors = value => {
  const factors = [];
  let n = value;
  if (n < 0) {
    factors.push(-1);
    n = -n;
  }
  while (n % 2 === 0) {
    factors.push(2);
    n /= 2;
  }
  let divisor = 3;
  const limit = Math.floor(Math.sqrt(n));
  while (divisor <= limit && n > 1) {
    while (n % divisor === 0) {
      factors.push(divisor);
      n /= divisor;
    }
    divisor += 2;
  }
  if (n > 1) factors.push(n);
  return factors;
}
factors = primeFactors(unixTimeSeconds)
view = html`<div style="font-family: 'Raleway', system-ui; border: 1px solid #e5e7eb; border-radius: 16px; padding: 24px 28px; box-shadow: 0 20px 45px -28px rgba(88,28,135,0.45); background: linear-gradient(165deg, #ffffff 0%, #f5f3ff 55%, #ede9fe 100%); max-width: 640px;">
  <h3 style="margin-top:0; color:#581c87; font-family: 'Outfit', sans-serif;">Prime factor snapshot</h3>
  <p style="margin:0 0 0.75rem 0; color:#4b5563;">Taken at <strong>${unixTimeSeconds}</strong> seconds past the Unix epoch.</p>
  <p style="margin:0; font-size:1.05rem; color:#111827;">
    <strong>Factorisation:</strong> ${factors.join(' × ')}
  </p>
</div>`
What to do next
  • Return to the withdrawal simulator
  • Browse the latest Ethical Capital research
  • Schedule a consultation with the team

Ethical Capital Labs — finding order in chaotic markets, one prime at a time.

 

Invest Vegan LLC DBA Ethical Capital - Utah Registered Investment Adviser Disclosures | Privacy Policy | Terms of Use | GitHub 90 N 400 E, Provo, UT 84606 | hello@ethicic.com | Get In Touch

This website is for informational purposes only and does not constitute investment advice. Past performance does not guarantee future results.