public class TwistedPrime { public static void main(int n)//Enter a number { int num,s=0,c=0,d; num=n; while(n>0) { d=n%10; s=s*10+d; n=n/10; { for(int i=1;i<s;i++) { if(s%i==0) c++; } } } if(c==1) System.out.print("Number is Twisted Prime"); else System.out.print("Number is not T.P."); } }
121 is not a prime number because it has more factors than 1 and itself.
for s being prime find all s so that s² < 50 { 4 , 25 , 49...and one more }
Not everyone is agreed on this but Peano's axioms, which are the basis for the axiomatic structure of numbers defines 0 as a natural number and then all other natural numbers in terms of successors.0 is not a successor of any natural number.1 is the successor of 0 is 1 = S(0)2 = S(S(0))3 = S(S(S(0))) and so on.Accordingly, the first natural number is 0.
0,1,3,5,7,
No numbers, because 2 is the smallest prime number 0 and 1 aren't prime #'s.
9 0's so50,000,000,000
composite. prime #s can only be divided by 1 and itself
public class TwistedPrime { public static void main(int n)//Enter a number { int num,s=0,c=0,d; num=n; while(n>0) { d=n%10; s=s*10+d; n=n/10; { for(int i=1;i<s;i++) { if(s%i==0) c++; } } } if(c==1) System.out.print("Number is Twisted Prime"); else System.out.print("Number is not T.P."); } }
A prime number has only 2 factors which are 1 and itself. Composite numbers are everything else except 1 and 0. 1 and 0 are neither prime, nor composite.
Begin Read num for(i=2; i<num; i++) if(num%2==0) then print "the number is not a prime no."; else if print "the number is prime"; end if Stop
121 is not a prime number because it has more factors than 1 and itself.
for s being prime find all s so that s² < 50 { 4 , 25 , 49...and one more }
#include <iostream> void main() { using namespace std; int num, rem, sum=0; //Declaring variables cout<<"Enter a number :"<<endl; cin>>num; //Loop to calculate the sum of the digits of the given number. while(num!=0) { rem=num%10; num=num/10; sum=sum+rem; } cout<<"Sum of the digits is "<<sum<<endl; cin.get(); }
2 x 5 x 5 = 50
Prime 9 - 2009 Players of the 50's 4-2 was released on: USA: 2011
/** * @author BHARGAV MODI * */ class prime { public static void main(String p[]) { int i,j,s=0,d=0; for(i=1;i<100;i++) { s=0; for(j=1;j<=i;j++) { if(i%j==0) s=s+1; } if(s==2) { System.out.println(i); d=d+1; } } System.out.println("the no. of prime no. are = "+d); } }