Data update

This commit is contained in:
Ingy döt Net 2023-12-16 21:33:55 -08:00
parent 35bcdeebf8
commit 74c69a0df6
2427 changed files with 31826 additions and 3468 deletions

View file

@ -12,7 +12,7 @@ while num < limit
if n mod tau = 0 then
num += 1
if num mod 10 = 1 then print
print n; " ";
print rjust(string(n), 6);
end if
end while
end

View file

@ -0,0 +1,21 @@
func cntdiv n .
i = 1
while i <= sqrt n
if n mod i = 0
cnt += 1
if i <> n div i
cnt += 1
.
.
i += 1
.
return cnt
.
i = 1
while n < 100
if i mod cntdiv i = 0
write i & " "
n += 1
.
i += 1
.

View file

@ -0,0 +1,32 @@
Public Sub Main()
Dim c As Integer = 0, i As Integer = 1
Print "The first 100 tau numbers are:\n"
While c < 100
If isTau(i) Then
Print Format$(i, "######");
c += 1
If c Mod 10 = 0 Then Print
End If
i += 1
Wend
End
Function numdiv(n As Integer) As Integer
Dim c As Integer = 2
For i As Integer = 2 To (n + 1) \ 2
If n Mod i = 0 Then c += 1
Next
Return c
End Function
Function isTau(n As Integer) As Boolean
If n = 1 Then Return True
Return IIf(n Mod numdiv(n) = 0, True, False)
End Function

View file

@ -0,0 +1,12 @@
100 PROGRAM "TauNr.bas"
110 LET LIMIT=100
120 LET N,NUM=0
130 PRINT "The first";LIMIT;"tau numbers are:"
140 DO WHILE NUM<LIMIT
150 LET N=N+1
160 LET TAU=0
170 FOR M=1 TO N
180 IF MOD(N,M)=0 THEN LET TAU=TAU+1
190 NEXT
200 IF MOD(N,TAU)=0 THEN LET NUM=NUM+1:PRINT N,
210 LOOP

View file

@ -0,0 +1,22 @@
isTauNumber = function(n)
ans = 0
i = 1
while i * i <= n
if n % i == 0 then
ans += 1
j = floor(n / i)
if j != i then ans += 1
end if
i += 1
end while
return (n % ans) == 0
end function
tauNums = []
i = 1
while tauNums.len < 100
if isTauNumber(i) then tauNums.push(i)
i += 1
end while
print tauNums.join(", ")

View file

@ -0,0 +1,22 @@
REM Rosetta Code problem: https://rosettacode.org/wiki/Tau_number
REM by Jjuanhdez, 11/2023
REM Tau number
LET C = 0
LET N = 0
LET X = 100
LET T = 0
10 LET C = C + 1
LET T = 0
LET M = 1
20 IF C - (C / M) * M <> 0 THEN GOTO 30
LET T = T + 1
30 LET M = M + 1
IF M < C + 1 THEN GOTO 20
IF C - (C / T) * T <> 0 THEN GOTO 40
LET N = N + 1
PRINT C
40 IF N < X THEN GOTO 10
END

View file

@ -0,0 +1,25 @@
PROGRAM "Tau number"
VERSION "0.0000"
DECLARE FUNCTION Entry ()
FUNCTION Entry ()
PRINT "The first 100 tau numbers are:"
n = 0
num = 0
limit = 100
DO WHILE num < limit
INC n
tau = 0
FOR m = 1 TO n
IF n MOD m = 0 THEN INC tau
NEXT m
IF n MOD tau = 0 THEN
INC num
IF num MOD 10 = 1 THEN PRINT
PRINT FORMAT$("######", n);
END IF
LOOP
END FUNCTION
END PROGRAM