About me

I am a engineer by training. I am planning to switch my career from non-IT industry to the IT after 7 years of non-IT experience. I am hard-working, responsible, diligent, and friendly person with a good sense of humor. I try to treat other people so as I want them to treat me.

Web Development is my favorite hobby. In my free time I study JavaScript. I am particularly interested in React, Redux and other technologies. Also I devote time to learnĀ­ing English every day.

Code example

Given a positive integer n written as abcd... (a, b, c, d... being digits) and a positive integer p we want to find a positive integer k, if it exists, such as the sum of the digits of n taken to the successive powers of p is equal to k * n.

Is there an integer k such as : (a ^ p + b ^ (p+1) + c ^(p+2) + d ^ (p+3) + ...) = n * k. If it is the case we will return k, if not return -1.

  
  const digPow = (n, p) => {
    const numbersArray = n.toString().split('')
    let pow = p
    let sum = 0
    for (let i = 0; i < numbersArray.length; i++) {
      sum += Math.pow(+numbersArray[i], pow++)
    }
    if (sum % n !== 0) {
      return -1
    }
    return sum / n
  }
  
        

Courses

Last completed and current courses: