Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
39
Task/Tau-function/FutureBasic/tau-function.basic
Normal file
39
Task/Tau-function/FutureBasic/tau-function.basic
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
//
|
||||
// Tau Function
|
||||
//
|
||||
// FutureBasic 7.0.34, August 2025 R.W
|
||||
//
|
||||
// Given a positive integer, count the
|
||||
// number of its positive divisors.
|
||||
//---------------------------------------
|
||||
|
||||
// Given an integer, returns the
|
||||
// Tau positive integer
|
||||
|
||||
local fn Tau( n as Int) as Int
|
||||
int x, result
|
||||
if n < 3
|
||||
result = n
|
||||
else
|
||||
result = 2
|
||||
for x = 2 to fix((n + 1) / 2)
|
||||
if n % x == 0 then result++
|
||||
next x
|
||||
end if
|
||||
end fn = result
|
||||
|
||||
|
||||
Window 1,@"Tau Function"
|
||||
|
||||
print
|
||||
print "First 100 positive integer Tau numbers:"
|
||||
print
|
||||
|
||||
int x
|
||||
|
||||
for x = 1 to 100
|
||||
print using "####";fn Tau(x);
|
||||
if x % 10 == 0 then print
|
||||
next x
|
||||
|
||||
handleEvents
|
||||
Loading…
Add table
Add a link
Reference in a new issue