“The Doubler” is an educational web application that demonstrates the power of exponential growth through real-time visualization. Starting with 1 meter at its creation date, the number doubles every day, creating a dramatic demonstration of exponential mathematics. The application provides an astronomical perspective by comparing the growing distance to the observable universe’s diameter, making abstract mathematical concepts tangible and visually engaging.
double/
├── index.html # Complete application with embedded styling and logic
└── peakpx.jpg # Background image (referenced but not analyzed)
// Core exponential calculation
const timeDiffInSeconds = Math.floor((currentDate - creationDate) / 1000);
const updatedNumber = 1 * Math.pow(2, timeDiffInSeconds / 86400);
// Day-based doubling calculation
const doublingsCount = Math.floor(timeDiffInSeconds / 86400); // Days elapsed
distance = 1 × 2^(days_elapsed)// Observable universe diameter reference
const moonDistanceKm = 44000000000000000000000000; // ~4.4 × 10^26 meters
const moonLengths = (updatedNumber / moonDistanceKm) * 100; // Percentage calculation
// Result display with extreme precision
moonLengths.toFixed(20) // 20 decimal places for astronomical accuracy
function updateNumberAndResult() {
const currentDate = new Date();
const timeDiffInSeconds = Math.floor((currentDate - creationDate) / 1000);
const updatedNumber = 1 * Math.pow(2, timeDiffInSeconds / 86400);
// Update display elements
numberTitleElement.textContent = numberValue.toLocaleString() + ' Meters';
// Calculate cosmic perspective
const moonLengths = (updatedNumber / moonDistanceKm) * 100;
// Comprehensive result text
resultTextElement.innerHTML = `Starting with 1 Meter at this page's creation on ${formattedCreationDate}, this number has doubled ${Math.floor(timeDiffInSeconds / 86400).toLocaleString()} times (once per day).<br>Our original meter now stretches ${moonLengths.toFixed(20)}% of the total diameter of the observable universe.`;
}
// Real-time updates every second
setInterval(updateNumberAndResult, 1000);
// Creation timestamp with millisecond precision
const creationDate = new Date("2023-07-28T20:40:21");
// Formatted date display without timezone confusion
const formattedCreationDate = creationDate.toLocaleString(undefined, {
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit"
});
body {
font-family: Helvetica, Arial, sans-serif;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
margin: 0;
background-image: url('peakpx.jpg'); /* Cosmic/space theme background */
background-size: cover;
background-repeat: no-repeat;
}
.content-wrapper {
background-color: rgba(128, 128, 128, 0.25); /* Semi-transparent overlay */
padding: 20px;
border-radius: 50px; /* Rounded modern container */
max-width: 600px;
text-align: center;
}
h1 {
font-weight: bold;
margin-bottom: 5vh; /* Viewport-based spacing */
font-size: 69px; /* Large, prominent number display */
color: white;
}
p {
font-size: 25px; /* Readable explanation text */
color: white;
}
The application demonstrates several key mathematical concepts:
f(x) = 2^x where x is days elapsed// After just 30 days: 1 × 2^30 = 1,073,741,824 meters (~1 billion meters)
// After 60 days: 1 × 2^60 = 1,152,921,504,606,846,976 meters (~1.15 quintillion meters)
// After 90 days: The number becomes astronomically large
// Observable universe diameter: ~8.8 × 10^26 meters
// Reference constant appears to be approximately half this value
const moonDistanceKm = 44000000000000000000000000; // 4.4 × 10^25 meters
// Percentage calculation provides intuitive scale understanding
const universalPercentage = (exponentialDistance / universeReference) * 100;
// Fixed creation timestamp ensures consistent calculations
const creationDate = new Date("2023-07-28T20:40:21");
// July 28, 2023, 8:40:21 PM (appears to be UTC/local time)
// All calculations reference this fixed point in time
/* Responsive text sizing and spacing */
h1 {
font-size: 69px; /* Large but scales with zoom */
margin-bottom: 5vh; /* Viewport height-based spacing */
}
.content-wrapper {
max-width: 600px; /* Constrained width for readability */
padding: 20px; /* Adequate spacing */
}
// Number formatting with locale-appropriate separators
numberValue.toLocaleString() + ' Meters'
// Multi-line explanation with HTML formatting
resultTextElement.innerHTML = `...content...<br>...more content...`;
// High-precision display for scientific accuracy
moonLengths.toFixed(20) // 20 decimal places
// Comprehensive usage analytics
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'G-WPNF0DNSMX');
The application uses a reference value that appears to be approximately half the actual observable universe diameter:
// High precision display with 20 decimal places
moonLengths.toFixed(20)
// Example progression:
// Day 1: 2 meters (0.000000000000000000045% of universe)
// Day 10: 1,024 meters
// Day 20: 1,048,576 meters
// Day 30: 1,073,741,824 meters (over 1 billion meters)
The Doubler successfully demonstrates the extraordinary power of exponential growth through an engaging, real-time mathematical visualization. By combining precise calculations with cosmic scale comparisons, it transforms abstract mathematical concepts into an intuitive and visually compelling experience.
Technical Rating: 8.1/10
The application serves as an excellent educational tool for demonstrating exponential mathematics while providing an engaging way to appreciate both the power of mathematical growth and the scale of our universe.