Create your own mathematical mysteries: Appendix

Share this page

BASIC code to find the Humble Numbers and their variations

10 CLS
20 DIM P(100)
30 FOR N = 2 TO 100
40 M = N
50 I = 1
60 T = 0
70 FOR B = 1 TO 100: P(B) = 0: NEXT B
80 FOR F = 2 TO SQR(N) + .1
90 S = 0
100 IF M / F <> INT(M / F) THEN GOTO 150
110 IF S = 0 THEN P(I) = F: I = I + 1
120 M = M / F
130 S = 1
140 GOTO 100
150 IF F * F > M THEN F = SQR(N) + .1
160 NEXT F
170 IF P(1) <> 0 THEN T = 1 / P(1)
180 FOR A = 1 TO I - 1:
190 IF (P(A) <> 0 AND P(A + 1) <> 0) THEN T = T + P(A) / P(A + 1)
200 IF (P(A) <> 0 AND P(A + 1) = 0) THEN T = T + P(A) / M
210 NEXT A
220 T = T + (M / N) - ((I + 2) / N)
230 IF T = 1 THEN PRINT T; "N"; N
240 NEXT N

What are the Humble numbers?

The first few number that satisfy this criteria are: 6, 10, 14, 15, 22, 26, 34, 35, 38, 46, 58, 62, 74, 82, 86, 94,106, 118, 122, 134, 142, 143, 146, 158, 166, 178, 194,…..

Back to the article