Add disarium-number module: loop, String and stream approaches, dry run, counts to 10^8
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b4VQVEJWetTT1dYzyJ
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
89 -> Disarium
|
||||
135 -> Disarium
|
||||
175 -> Disarium
|
||||
518 -> Disarium
|
||||
598 -> Disarium
|
||||
24 -> NOT Disarium
|
||||
100 -> NOT Disarium
|
||||
|
||||
Disarium numbers up to 1000: 1 2 3 4 5 6 7 8 9 89 135 175 518 598
|
||||
@@ -0,0 +1,2 @@
|
||||
count=14
|
||||
1 2 3 4 5 6 7 8 9 89 135 175 518 598
|
||||
@@ -0,0 +1,5 @@
|
||||
175 = 1^1 + 7^2 + 5^3 = 1 + 49 + 125 = 175 -> Disarium
|
||||
89 = 8^1 + 9^2 = 8 + 81 = 89 -> Disarium
|
||||
135 = 1^1 + 3^2 + 5^3 = 1 + 9 + 125 = 135 -> Disarium
|
||||
24 = 2^1 + 4^2 = 2 + 16 = 18 -> NOT Disarium (18 != 24)
|
||||
100 = 1^1 + 0^2 + 0^3 = 1 + 0 + 0 = 1 -> NOT Disarium (1 != 100)
|
||||
@@ -0,0 +1 @@
|
||||
compared original, loop, String, stream, log10 for 1..1000000: disagreements=0
|
||||
@@ -0,0 +1 @@
|
||||
log10 vs loop digit count around every power of ten: mismatches=0
|
||||
@@ -0,0 +1,9 @@
|
||||
up to 10^1: 9
|
||||
up to 10^2: 10
|
||||
up to 10^3: 14
|
||||
up to 10^4: 17
|
||||
up to 10^5: 17
|
||||
up to 10^6: 17
|
||||
up to 10^7: 18
|
||||
up to 10^8: 18
|
||||
found at or above 1000: 1306 1676 2427 2646798
|
||||
@@ -0,0 +1,7 @@
|
||||
PASS DisariumTest.allApproachesAgreeUpTo200000
|
||||
PASS DisariumTest.dryRunOf175
|
||||
PASS DisariumTest.dryRunOf24
|
||||
PASS DisariumTest.zeroAndNegativesAreNotDisarium
|
||||
PASS DisariumTest.biggerKnownOnes
|
||||
PASS DisariumTest.listUpTo1000
|
||||
6 tests, 0 failures
|
||||
Reference in New Issue
Block a user