RosettaCodeData/Task/Harmonic-series/Craft-Basic/harmonic-series.basic

35 lines
370 B
Plaintext

precision 5
print "the first twenty harmonic numbers are:"
for n = 1 to 20
let h = h + 1 / n
print n, tab, h
next n
print newline, "the nth index of the first harmonic number that exceeds the nth integer:"
let h = 1
let n = 2
for i = 2 to 10
do
if h < i then
let h = h + 1 / n
let n = n + 1
endif
wait
loop h < i
print tab, n - 1,
next i