You are working on abundant function
 
search
 


Contents:


swap function:
Swapping two values to change their addresses.
a

max function:

The largest number among two.
a

absolute value function:

The positive value of a number.
a

sorting function:

How to sort an array.
a

bisection function:

Bissection method used to solve equations by computing, example of cable strung ..
a

Newton-Raphson function:

To solve equations numerically, example of free fall motion ..
a

Secant function:

To solve equations numerically, example of free fall motion ..
a

isPrime function:

This function tests whether an integer is prime..
a

abundant function:

This function tests whether an integer is abundant..
a

factorial function:

Factorial of an integer..
a

quadratic function:

solving a quadratic equation ..
a

even_odd function:

To know if an integer is even or odd ..
a

mean value function:

To calculate the arithmetic mean of some values..
a

reverse function:

To reverse an integer and to know whether a string is palindrome..
a

least squares function :

To calculate the slope and the y_intercept of a linear equation ..
a

Monte Carlo method:

To calculate integrales or probabilities using Monte Carlo technique ..
a

2 and 3 equations systems solving :

To solve the 2 and 3 equations systems with 2 and 3 variables ..
a

Interpolation and Extrapolation :

To solve for lacking values in graphs or tables ..
a

Integer divisors :

Gives the divisors fo an integer and tests whether it is prime ..
a

Amicable pair :

Gives, if it exists, the amicable number of a given integer ..
a

Perfect numbers :

Tests whether a positive integer is perfect, and more ..
a

Periodic table of elements:

Periodic table of elements in C language, and more ..
a

Playing TicTacToe

Using some Fortran90 language funtionalities, and more ..
a


a
home

   Abundant numbers
abundant function



	1. Definition

	An integer is called abundant if the sum of all its divisors 
	including 1 but excluding itself,  is greater than this number. When 
	this sum is equal to this number, the letter is called perfect. 
	If this sum is less then this number, it is called deficient. 

	Example:
	--------
	12 is abundant, and 8 is not abundant.
	
	

	2. Example in F90 language:
	
!This program tells whether a number is abundant
!-----------------------------------------------

PROGRAM abundant
IMPLICIT NONE
INTEGER :: i,n, sum
PRINT*,"Enter an integer : --> n"
READ*, n

sum = 0
do i = 1, n-1
if (mod(n,i) == 0) THEN
sum = sum + i
end IF
continue

end do


if (sum. le. n) then
PRINT*,"The number", n," is  not abundant "

else
PRINT*,"The number", n," is  abundant "
endif

END PROGRAM abundant


	Results:
	--------
C:\Fortran90>abundant
 Enter an integer : -->

8
 The number is not abundant 

C:\Fortran90>abundant
 Enter an integer : -->

24
 The number 24 is  abundant 
 

 
 
!This program gives all the odd abundant integers less than a given one:
!------------------------------------------------------------------------

PROGRAM abundant_odd
IMPLICIT NONE
INTEGER :: j,i,n, sum
PRINT*,"Enter an integer : --> n"
READ*, n

! To choose the numbers from 1 to n
do j =1,n
! To be odd
if (mod(j,2) /= 0) THEN

sum = 0
do i = 1, j
if (mod(j,i) == 0) THEN
sum = sum + i
end IF
continue

end do


if (sum -j. ge. j) then
PRINT*,"The number", j ," is abundantn"
!else
!PRINT*,"The number", j," is  not abundantn"

endif


! end first if
end if
! end first do
end do

END PROGRAM abundant_odd



	Results:
	--------
C:\Fortran90>abundant
 Enter an integer : -->

8
 The number is not abundant 

C:\Fortran90>abundant
 Enter an integer : -->

24
 The number 24 is  abundant 

C:\Fortran90>abundant_odd
 Enter an integer : -->

5000
 The number 945 is abundant

 The number 1575 is abundant

 The number 2205 is abundant

 The number 2835 is abundant

 The number 3465 is abundant

 The number 4095 is abundant

 The number 4725 is abundant


C:\Fortran90>



	


Custom Search


© 2007. The scientificsentence . All rights reserved.