Prime numbers whose neighboring pairs are tetraprimes: Difference between revisions

m
(→‎{{header|C}}: Fixed a potential boundary problem, though output unaffected.)
m (→‎{{header|Wren}}: Minor tidy)
Line 368:
Fmt.tprint("$5d ", tetras, 10)
}
Fmt.print("\nof which $,d have a neighboring pair one of whose factors is 7.\n", sevens)
var gaps = List.filled(c-1, 0)
Fmt.print("of which $,d have a neighboring pair one of whose factors is 7.\n", sevens)
varfor gaps(k =in List0.filled(tetras.count.c-1, 0) gaps[k] = tetras[k+1] - tetras[k]
for (k in 0...tetras.count-1) gaps[k] = tetras[k+1] - tetras[k]
gaps.sort()
var min = gaps[0]
var max = gaps[-1]
var med = Nums.median(gaps)
Fmt.print("Minimum gap between those $,d primes : $,d", c, min)
Fmt.print("Median gap between those $,d primes : $,d", c, med)
9,486

edits