How many numbes (Self-made )

For discussing Olympiad Level Combinatorics problems
MATHPRITOM
Posts:190
Joined:Sat Apr 23, 2011 8:55 am
Location:Khulna
How many numbes (Self-made )

Unread post by MATHPRITOM » Tue Apr 10, 2012 1:25 pm

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$.
Last edited by sourav das on Tue Apr 10, 2012 8:48 pm, edited 2 times in total.
Reason: \[L^AT_EXed\]

User avatar
nafistiham
Posts:829
Joined:Mon Oct 17, 2011 3:56 pm
Location:24.758613,90.400161
Contact:

Re: How many numbes (Self-made )

Unread post by nafistiham » Tue Apr 10, 2012 8:53 pm

I could not do nothing but, being brutal :? :cry: . so, the answer is $68 - x$ where $\pm x$ is calculation error. :lol:
\[\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.
Introduction:
Nafis Tiham
CSE Dept. SUST -HSC 14'
http://www.facebook.com/nafistiham
nafistiham@gmail

User avatar
sm.joty
Posts:327
Joined:Thu Aug 18, 2011 12:42 am
Location:Dhaka

Re: How many numbes (Self-made )

Unread post by sm.joty » Tue Apr 10, 2012 10:34 pm

$2^k*3^m$ আকারের সংখ্যা তাই আমিও $k$ এর মান ০ থেকে ধরে brute force দিয়ে দেখলাম ৩১ উত্তর :o
হার জিত চিরদিন থাকবেই
তবুও এগিয়ে যেতে হবে.........
বাধা-বিঘ্ন না পেরিয়ে
বড় হয়েছে কে কবে.........

User avatar
*Mahi*
Posts:1175
Joined:Wed Dec 29, 2010 12:46 pm
Location:23.786228,90.354974
Contact:

Re: How many numbes (Self-made )

Unread post by *Mahi* » Tue Apr 10, 2012 10:49 pm

উত্তর ৬৭।
এইরকম একটা প্রব্লেম 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

User avatar
nafistiham
Posts:829
Joined:Mon Oct 17, 2011 3:56 pm
Location:24.758613,90.400161
Contact:

Re: How many numbes (Self-made )

Unread post by nafistiham » Wed Apr 11, 2012 12:08 am

@ 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 :?
from my older post......$x=1$
\[\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.
Introduction:
Nafis Tiham
CSE Dept. SUST -HSC 14'
http://www.facebook.com/nafistiham
nafistiham@gmail

User avatar
*Mahi*
Posts:1175
Joined:Wed Dec 29, 2010 12:46 pm
Location:23.786228,90.354974
Contact:

Re: How many numbes (Self-made )

Unread post by *Mahi* » Wed Apr 11, 2012 12:13 am

Please read Forum Guide and Rules before you post.

Use $L^AT_EX$, It makes our work a lot easier!

Nur Muhammad Shafiullah | Mahi

Post Reply