How many numbers are there from $1$ to $10000$ which are perfect powers of only $2$ & $3$.
Example: form $1$ to $10$ the number is $7$. They are $1,2,3,4,6,8,9$.
How many numbes (Self-made )
-
- Posts:190
- Joined:Sat Apr 23, 2011 8:55 am
- Location:Khulna
Last edited by sourav das on Tue Apr 10, 2012 8:48 pm, edited 2 times in total.
Reason: \[L^AT_EXed\]
Reason: \[L^AT_EXed\]
- nafistiham
- Posts:829
- Joined:Mon Oct 17, 2011 3:56 pm
- Location:24.758613,90.400161
- Contact:
Re: How many numbes (Self-made )
\[\sum_{k=0}^{n-1}e^{\frac{2 \pi i k}{n}}=0\]
Using $L^AT_EX$ and following the rules of the forum are very easy but really important, too.Please co-operate.
Using $L^AT_EX$ and following the rules of the forum are very easy but really important, too.Please co-operate.
Re: How many numbes (Self-made )
$2^k*3^m$ আকারের সংখ্যা তাই আমিও $k$ এর মান ০ থেকে ধরে brute force দিয়ে দেখলাম ৩১ উত্তর
হার জিত চিরদিন থাকবেই
তবুও এগিয়ে যেতে হবে.........
বাধা-বিঘ্ন না পেরিয়ে
বড় হয়েছে কে কবে.........
তবুও এগিয়ে যেতে হবে.........
বাধা-বিঘ্ন না পেরিয়ে
বড় হয়েছে কে কবে.........
Re: How many numbes (Self-made )
উত্তর ৬৭।
এইরকম একটা প্রব্লেম viewtopic.php?f=34&t=226 এইখানে ছিল। এইটা যতটা না অঙ্কের সমস্যা তার চেয়ে বেশি প্রোগ্রামিং সমস্যা। এর brute বাদে তেমন সংক্ষিপ্ত সমাধান নাই (নিচে যে সমাধান সেইটা অনেক আগের লেখা, একটু পালটায় দিসি, এর চেয়ে অপটিমাইজ করা যায়, তবে এইখানে তার দরকার নাই )
এইরকম একটা প্রব্লেম viewtopic.php?f=34&t=226 এইখানে ছিল। এইটা যতটা না অঙ্কের সমস্যা তার চেয়ে বেশি প্রোগ্রামিং সমস্যা। এর brute বাদে তেমন সংক্ষিপ্ত সমাধান নাই (নিচে যে সমাধান সেইটা অনেক আগের লেখা, একটু পালটায় দিসি, এর চেয়ে অপটিমাইজ করা যায়, তবে এইখানে তার দরকার নাই )
Code: Select all
#include<stdio.h>
#include<conio.h>
int main()
{
long int p,i,j,a,b,m,k;long int array[10];
m=0;
p=2;
array[0]=2;
array[1]=3;
a=1;
b=10000;
for(j=a;j<=b;j++)
{
k=j;
for(i=0;i<p;i++)
{
while((k/array[i])*array[i]==k)
{
k=k/array[i];
}
}
if(k==1)
m=m+1;
}
printf("%ld",m);
getch();
return 0;
}
Please read Forum Guide and Rules before you post.
Use $L^AT_EX$, It makes our work a lot easier!
Nur Muhammad Shafiullah | Mahi
Use $L^AT_EX$, It makes our work a lot easier!
Nur Muhammad Shafiullah | Mahi
- nafistiham
- Posts:829
- Joined:Mon Oct 17, 2011 3:56 pm
- Location:24.758613,90.400161
- Contact:
Re: How many numbes (Self-made )
@ mahi,
pardon me, being a know nothing about programming, could I know where can I put this code to get results ?
I guess C++ command prompt or codeblocks
pardon me, being a know nothing about programming, could I know where can I put this code to get results ?
I guess C++ command prompt or codeblocks
\[\sum_{k=0}^{n-1}e^{\frac{2 \pi i k}{n}}=0\]
Using $L^AT_EX$ and following the rules of the forum are very easy but really important, too.Please co-operate.
Using $L^AT_EX$ and following the rules of the forum are very easy but really important, too.Please co-operate.
Re: How many numbes (Self-made )
Here... http://ideone.com/CxpBJ
Please read Forum Guide and Rules before you post.
Use $L^AT_EX$, It makes our work a lot easier!
Nur Muhammad Shafiullah | Mahi
Use $L^AT_EX$, It makes our work a lot easier!
Nur Muhammad Shafiullah | Mahi