C
Programming and Technical
Programming
Program
write a logic for following series 2,6,15,35,143,221,323,437,..........
Read Solution (Total 6)
-
- the sequence comprises of products of consecutive prime numbers
2=1*2
6=2*3
15=3*5
35=5*7
there should be a number in this series 77=7*11 (i dont know y this number is missing, otherwise my logic stands true)
143=11*13
221=13*17
323=17*19 and so on...
the logic is
for(int i=0;i - 8 years agoHelpfull: Yes(20) No(2)
- #include
int main() {
int count=0;
int j;
int a;
int b;
int limit=15; //change how many no. you want to print
int prime(int n)
{
int flag=0;
int i;
if(n==2)
{flag=1;
a=2;}
else
for(i=2;i - 7 years agoHelpfull: Yes(2) No(2)
- I dont know whether my logic is correct or not. i cant bring the logic in several steps
1*2=2
3*2=6
8*2=16-1=15
72*2=144-1=143
111*2=222-1=221
219*2=438-1=437
Please tell me the correct sequence
- 8 years agoHelpfull: Yes(0) No(5)
- the sequence comprises of products of consecutive prime numbers
2=1*2
6=2*3
15=3*5
35=5*7
- 8 years agoHelpfull: Yes(0) No(2)
- num= prime+num*2;
num starting from 2 and prime number starting from 2
num=2*2+2=6
num=6*2+3=15
num=15*2+5=35
num=35*2+7=77 and so on.... - 7 years agoHelpfull: Yes(0) No(0)
- 2*3=6
3*5=15
5*7=35
7*11=77
11*13=143
13*17=221
17*19=323
19*23=437
23*29=667
ANS: 667 - 2 years agoHelpfull: Yes(0) No(0)
C Other Question