Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,12 @@
#lang racket
(require "hs.rkt")
(define N 100000)
(define t (make-hasheq))
(define best
(for/fold ([best #f]) ([i (in-range 1 (add1 N))])
(define len (length (hailstone i)))
(define freq (add1 (hash-ref t len 0)))
(hash-set! t len freq)
(if (and best (> (car best) freq)) best (cons freq len))))
(printf "Most frequent sequence length for x<=~s: ~s, appearing ~s times\n" N
(cdr best) (car best))