Support our Blind Hand Charity by donating at 9818291723. Your contribution has the potential to bring about significant positive change for humanity.

Search This Blog

MY PROGRAMMES

Sunday, April 30, 2023

MATHEMATICAL SERIES AND THER SUM

PATTERN-1

n=int(input("Enter the range of the pattern = "))
s=0
x=1
for i in range(1,n+1):
    if i==n:
        print(i,"!",end="",sep="")
    elif i!=0:
        print(i,"!",end="+",sep="")
    for j in range (1,i+1):
        x=x*j
    s=s+x
    x=1
print("\n","The sum of factorials =",s)

OUTPUT

Enter the range of the pattern = 5
1!+2!+3!+4!+5!
 The sum of factorials = 153

PATTERN-2

n=int(input("Enter the range of the pattern = "))
s=0
x=1
for i in range(1,n+1):
    if i==n:
        print(i,"/",(i+1),end="",sep="")
    elif i!=0:
        print(i,"/",(i+1),end=" + ",sep="")
    for j in range (1,i+1):
        x=i/(j+1)
    s=s+x
print("\n","The sum of the pattern =",s)

OUTPUT

Enter the range of the pattern = 5
1/2 + 2/3 + 3/4 + 4/5 + 5/6
 The sum of the pattern = 3.5500000000000003

PATTERN-3

x=int(input("Enter the base of the pattern = "))
n=int(input("Enter the range of the pattern = "))
t=x
s=0
for i in range(1,n+1):
    if i==n:
        print(x,"^",i,end="",sep="")
    else:
        print(x,"^",i,end="+ ",sep="")
    x=x**i
    s+=x
    x=t
print("\n","The sum of the number =",s)

OUTPUT

Enter the base of the pattern = 5
Enter the range of the pattern = 3
5^1+ 5^2+ 5^3
 The sum of the number = 155

PATTERN-4

x=int(input("Enter the base of the pattern = "))
n=int(input("Enter the range of the pattern = "))
t=1
s=0
for i in range(1,n+1):
    if i==n:
        print(x,"^",i,"/",i,"!",sep="",end="")
    else:
        print(x,"^",i,"/",i,"!",sep="",end=" + ")
    for j in range(1,i+1):
        t=t*j
    s+=(x**i)/t
    t=1
print("\n","The sum of the numebers =",s)

OUTPUT

Enter the base of the pattern = 5
Enter the range of the pattern = 3
5^1/1! + 5^2/2! + 5^3/3!
The sum of the numbers = 38.33333333333333

PATTERN-5

n=int(input("Enter the range of the pattern = "))
x=0
s=0
print("1+(1+2)+(1+2+3)+(!+2+3+4)+.....(1+2+3+4+....+n)")
for i in range(1,n+1):
    for j in range(1,i+1):
        x=x+1
    s+=x
print("\n","The sum of numbers =",s)

OUTPUT

Enter the range of the pattern = 3
1+(1+2)+(1+2+3)+(!+2+3+4)+.....(1+2+3+4+....+n)

The sum of numbers = 10

PATTERN-6

n=int(input("Enter the range of the pattern = "))
x=0
s=0
for i in range(0,n):
    if i==n-1:
        print(i+1,"^3",end="",sep="")
    else:
        print(i+1,"^3",end=" + ",sep="")
    x=(i+1)**3
    s+=x
    x=0
print("\n","The sum of numbers =",s)

OUTPUT

Enter the range of the pattern = 5
1^3 + 2^3 + 3^3 + 4^3 + 5^3
 The sum of numbers = 225