• Content count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About andreis

  • Rank
  1. Palindromes by multiplication

    Hm, still no solution. It's supposed to be a school problem.
  2. Palindromes by multiplication

    The Python code returns the smallest palindrome P given an integer p (num in the code). import sys def is_palindrome(num): if (num % 10 == 0): return False; r = 0; while (r < num) : r = 10 * r + num % 10; num /= 10; return (num == r) or (num == r / 10); num = input("Enter a positive integer:"); k=0; multiple=12;#initialisation: any non-palindrome while (not is_palindrome(multiple)): k+=1; multiple=k*num; print(str(num)+"*"+str(k)+"="+str(multiple)); Hi Function, Your formula doesn't work for odd numbers. The digit in the middle will have the number (n+1)/2, and you will have a sum member 2*x_i*10^{(n-1)/2} instead of x_i*10^{(n-1)/2}. I made a similar decomposition, but could not get any conclusion from it.
  3. Palindromes by multiplication

    Let's be more specific, palindromicity is checked in decimal system. Corrected above.
  4. A palindrome is a number which reads the same backward or forward (e.g. 434, 87678, etc.). Could you prove that for any integer n (not divisible by 10) there is a palindrome (in decimal representation) divisible by n? *** I've checked for all numbers up to 162, it's true: 81* 12345679= 999999999 162*172839506=27999999972 Is there any simple proof for any integer?