Sort by

recency

|

137 Discussions

|

  • + 0 comments

    simple code

    include

    int isPrime(int n) { if (n < 2) return 0; for (int i = 2; i*i <= n; i++) if (n % i == 0) return 0; return 1; }

    int digitSum(int n) { int s = 0; while (n) s += n % 10, n /= 10; return s; }

    int primeFactorDigitSum(int n) { int s = 0; for (int i = 2; i <= n; i++) { if (isPrime(i)) { while (n % i == 0) { s += digitSum(i); n /= i; } } } return s; }

    int main() { int n; scanf("%d", &n); printf("%d\n", (!isPrime(n) && digitSum(n) == primeFactorDigitSum(n)) ? 1 : 0); return 0; }

  • + 0 comments

    Great post on Smith Numbers! For those diving deeper into number theory, it's fascinating to see how these numbers bridge the gap between math and patterns. Have you considered how tools like Drift Boss can help visualize complex concepts like these? Utilizing games or puzzles could enhance understanding by making the learning process more interactive. Keep sharing such insightful content!

  • + 0 comments

    That sounds frustrating! Dealing with laptop issues is such a time-sink. When my old laptop started acting up, I almost lost it. I found a great resource online, though, which helped me diagnose some things myself. Speaking of things to do to unwind after a stressful tech day, maybe check out "Crazy Cattle 3D" on your phone? It's a silly, mindless game that always makes me laugh. Hope you get your Dell sorted soon!

  • + 0 comments

    Need top-notch Dell Laptop Service Center in Mumbai? Our skilled technicians are here to tackle any laptop problem, whether it's a hardware malfunction or a software glitch. We offer fast and dependable repairs to get your laptop back in action quickly. Reach out to us today for expert laptop service and support!

  • + 0 comments
    public static int solve(int nn) {
        // Write your code here
                      int ds=0;
            int temp=nn;
            int n=nn;
            List<Integer> a=new ArrayList<>();
            while(temp>0){
                ds+=temp%10;
                temp/=10;
            }
            
             while (n % 2 == 0) {
               a.add(2);
                n /= 2;
            }
            for (int i = 3; i <= Math.sqrt(n); i += 2) {
                while (n % i == 0) {
                    a.add(i);
                    n /= i;
                }
            }
     
            if (n > 2)
               a.add(n);
            
            
            int fsum=0;
            
            for(int i:a)
            {
                while(i>0){
                    fsum+=i%10;
                    i=i/10;
                }
            }
            //System.out.println(a);
            if(fsum==ds)
                return 1;
            return 0;
        }