How to check if some number, say a, can be expressed as a = b + reverse(b) ? Where b is some natural...

Is there a reason to prefer HFS+ over APFS for disk images in High Sierra and/or Mojave?

Why does a 97 / 92 key piano exist by Bösendorfer?

Pre-Employment Background Check With Consent For Future Checks

How to leave product feedback on macOS?

ContourPlot — How do I color by contour curvature?

Make a Bowl of Alphabet Soup

When is "ei" a diphthong?

How to preserve electronics (computers, iPads and phones) for hundreds of years

Giving feedback to someone without sounding prejudiced

Would this string work as string?

What should be the ideal length of sentences in a blog post for ease of reading?

How would a solely written language work mechanically

How to make money from a browser who sees 5 seconds into the future of any web page?

How can I safely use "Thalidomide" in my novel while respecting the trademark?

El Dorado Word Puzzle II: Videogame Edition

Review your own paper in Mathematics

What does "tick" mean in this sentence?

Sound waves in different octaves

How do I Interface a PS/2 Keyboard without Modern Techniques?

Personal or impersonal in a technical resume

Has the laser at Magurele, Romania reached a tenth of the Sun's power?

Why the "ls" command is showing the permissions of files in a FAT32 partition?

Unable to disable Microsoft Store in domain environment

Do I have to know the General Relativity theory to understand the concept of inertial frame?



How to check if some number, say a, can be expressed as a = b + reverse(b) ? Where b is some natural number.


In how many ways can a number be expressed as a sum of consecutive numbers?How Many Natural Numbers Can Get Expressed as the Sum of Consecutive Natural Numbers in only One Way?What is the significance of the mirror numbers?Are numbers that are already palindromes Lychrel numbers?How to prove that every natural number not of the form $4^n(8m+7)$ can be written as $x^2 + y^2 + z^2$?Number of ways in which a natural number can be expressed as a sum of natural numbers?Natural number which can be expressed as sum of two perfect squares in two different ways?How to prove Prime numbers can be expressed as $6kpm 1$How do I show that any natural number of this expression is a natural linear combination?Proving every natural number can be expressed as $2^{x} cdot {y}$













1












$begingroup$


How to check if some number, say $a$, can be expressed as $a = b + mathrm{reverse}(b)$ ? Where $a$ and $b$ are some natural numbers.



Some examples:





  1. $22 = 11 + mathrm{rev}(11) = 11 + 11$;
    That is, $22$ can be expressed as sum of "another natural number and its reverse".


  2. $121 = 29 + mathrm{rev}(29) = 29 + 92$;
    $9$ can't be expressed as sum of "a number and its reverse".










share|cite|improve this question











$endgroup$












  • $begingroup$
    It's also not necessary, if we always assume that the reverse of a number takes its smallest decimal representation. e.g. 8 = 4 + rev(4).
    $endgroup$
    – ConMan
    Mar 12 at 22:50










  • $begingroup$
    @DonThousand Divisibility by $11$ only works if the number of digits in the seed number is even, or if the seed number is divisible by $11$. $123+321=444$.
    $endgroup$
    – Mark Bennet
    Mar 12 at 22:54












  • $begingroup$
    @DonThousand It isn't a necessary condition. $444$ is not divisible by $11$
    $endgroup$
    – Mark Bennet
    Mar 12 at 22:57










  • $begingroup$
    Check all natural numbers $0<b<a$ of which there are only a finite number of them.
    $endgroup$
    – Somos
    Mar 12 at 22:59






  • 1




    $begingroup$
    Relevant oeis
    $endgroup$
    – Don Thousand
    Mar 12 at 23:02
















1












$begingroup$


How to check if some number, say $a$, can be expressed as $a = b + mathrm{reverse}(b)$ ? Where $a$ and $b$ are some natural numbers.



Some examples:





  1. $22 = 11 + mathrm{rev}(11) = 11 + 11$;
    That is, $22$ can be expressed as sum of "another natural number and its reverse".


  2. $121 = 29 + mathrm{rev}(29) = 29 + 92$;
    $9$ can't be expressed as sum of "a number and its reverse".










share|cite|improve this question











$endgroup$












  • $begingroup$
    It's also not necessary, if we always assume that the reverse of a number takes its smallest decimal representation. e.g. 8 = 4 + rev(4).
    $endgroup$
    – ConMan
    Mar 12 at 22:50










  • $begingroup$
    @DonThousand Divisibility by $11$ only works if the number of digits in the seed number is even, or if the seed number is divisible by $11$. $123+321=444$.
    $endgroup$
    – Mark Bennet
    Mar 12 at 22:54












  • $begingroup$
    @DonThousand It isn't a necessary condition. $444$ is not divisible by $11$
    $endgroup$
    – Mark Bennet
    Mar 12 at 22:57










  • $begingroup$
    Check all natural numbers $0<b<a$ of which there are only a finite number of them.
    $endgroup$
    – Somos
    Mar 12 at 22:59






  • 1




    $begingroup$
    Relevant oeis
    $endgroup$
    – Don Thousand
    Mar 12 at 23:02














1












1








1


1



$begingroup$


How to check if some number, say $a$, can be expressed as $a = b + mathrm{reverse}(b)$ ? Where $a$ and $b$ are some natural numbers.



Some examples:





  1. $22 = 11 + mathrm{rev}(11) = 11 + 11$;
    That is, $22$ can be expressed as sum of "another natural number and its reverse".


  2. $121 = 29 + mathrm{rev}(29) = 29 + 92$;
    $9$ can't be expressed as sum of "a number and its reverse".










share|cite|improve this question











$endgroup$




How to check if some number, say $a$, can be expressed as $a = b + mathrm{reverse}(b)$ ? Where $a$ and $b$ are some natural numbers.



Some examples:





  1. $22 = 11 + mathrm{rev}(11) = 11 + 11$;
    That is, $22$ can be expressed as sum of "another natural number and its reverse".


  2. $121 = 29 + mathrm{rev}(29) = 29 + 92$;
    $9$ can't be expressed as sum of "a number and its reverse".







number-theory elementary-number-theory recreational-mathematics






share|cite|improve this question















share|cite|improve this question













share|cite|improve this question




share|cite|improve this question








edited Mar 13 at 2:01









Brian

758116




758116










asked Mar 12 at 22:42









kapilkapil

112




112












  • $begingroup$
    It's also not necessary, if we always assume that the reverse of a number takes its smallest decimal representation. e.g. 8 = 4 + rev(4).
    $endgroup$
    – ConMan
    Mar 12 at 22:50










  • $begingroup$
    @DonThousand Divisibility by $11$ only works if the number of digits in the seed number is even, or if the seed number is divisible by $11$. $123+321=444$.
    $endgroup$
    – Mark Bennet
    Mar 12 at 22:54












  • $begingroup$
    @DonThousand It isn't a necessary condition. $444$ is not divisible by $11$
    $endgroup$
    – Mark Bennet
    Mar 12 at 22:57










  • $begingroup$
    Check all natural numbers $0<b<a$ of which there are only a finite number of them.
    $endgroup$
    – Somos
    Mar 12 at 22:59






  • 1




    $begingroup$
    Relevant oeis
    $endgroup$
    – Don Thousand
    Mar 12 at 23:02


















  • $begingroup$
    It's also not necessary, if we always assume that the reverse of a number takes its smallest decimal representation. e.g. 8 = 4 + rev(4).
    $endgroup$
    – ConMan
    Mar 12 at 22:50










  • $begingroup$
    @DonThousand Divisibility by $11$ only works if the number of digits in the seed number is even, or if the seed number is divisible by $11$. $123+321=444$.
    $endgroup$
    – Mark Bennet
    Mar 12 at 22:54












  • $begingroup$
    @DonThousand It isn't a necessary condition. $444$ is not divisible by $11$
    $endgroup$
    – Mark Bennet
    Mar 12 at 22:57










  • $begingroup$
    Check all natural numbers $0<b<a$ of which there are only a finite number of them.
    $endgroup$
    – Somos
    Mar 12 at 22:59






  • 1




    $begingroup$
    Relevant oeis
    $endgroup$
    – Don Thousand
    Mar 12 at 23:02
















$begingroup$
It's also not necessary, if we always assume that the reverse of a number takes its smallest decimal representation. e.g. 8 = 4 + rev(4).
$endgroup$
– ConMan
Mar 12 at 22:50




$begingroup$
It's also not necessary, if we always assume that the reverse of a number takes its smallest decimal representation. e.g. 8 = 4 + rev(4).
$endgroup$
– ConMan
Mar 12 at 22:50












$begingroup$
@DonThousand Divisibility by $11$ only works if the number of digits in the seed number is even, or if the seed number is divisible by $11$. $123+321=444$.
$endgroup$
– Mark Bennet
Mar 12 at 22:54






$begingroup$
@DonThousand Divisibility by $11$ only works if the number of digits in the seed number is even, or if the seed number is divisible by $11$. $123+321=444$.
$endgroup$
– Mark Bennet
Mar 12 at 22:54














$begingroup$
@DonThousand It isn't a necessary condition. $444$ is not divisible by $11$
$endgroup$
– Mark Bennet
Mar 12 at 22:57




$begingroup$
@DonThousand It isn't a necessary condition. $444$ is not divisible by $11$
$endgroup$
– Mark Bennet
Mar 12 at 22:57












$begingroup$
Check all natural numbers $0<b<a$ of which there are only a finite number of them.
$endgroup$
– Somos
Mar 12 at 22:59




$begingroup$
Check all natural numbers $0<b<a$ of which there are only a finite number of them.
$endgroup$
– Somos
Mar 12 at 22:59




1




1




$begingroup$
Relevant oeis
$endgroup$
– Don Thousand
Mar 12 at 23:02




$begingroup$
Relevant oeis
$endgroup$
– Don Thousand
Mar 12 at 23:02










1 Answer
1






active

oldest

votes


















1












$begingroup$

Let $b = sumlimits_{k=0}^n b_k 10^k$



$b + rev(b) = sumlimits_{k=0}^{n}(b_k + b_{n-k})10^k < 2*10^{k+1}$.



Suppose $a$ is an $n+1$ digit number.



Case 1: The first digit of $a$ is not equal to $1$. Then if $a = b + rev(b)$ then $b$ is also an digit number and $b_0 + b_k < 10$. So the first digit and last digit of $a$ are are $b_0 + b_k$ and equal.



If the first digit and last digit of $a$ are not equal then $a $ is not is not $b+ rev(b)$. If the first digit and last digit or then remove the first digit and last digit, divide by $10$ and repeat the process.



Case 1a: The first and last digit are $1$. To see if $b_0 + b_k = 1$ and $a = b + rev(b)$, revert to case 1. If it fails, continue to case 2.



Case 2: The first digit of $a$ is $1$. If $b_0 + b_k ge 10+ $ last digit of $a = m$ and $a = b + rev (b)$ then subtract $m$ and $m*10^{n-1}$ from $a$. Divide by $10$. Repeat the process.



Either the process will end at a single digit and $a = b+ rev(b)$ or the process will fail and $a ne b + rev (b)$ for any $b$.



Example: $59406 + 60495=119901$ so



so subtract $100001$ to get $19900$ and divide by $10$ to get $1990$. Subtract $10$ and $1000$ to get $980$ and divide by $10$ to get $98$ and that was a failure.



So go back to $119901$ and subtract $11$ and $110000$ so get $9890$ and divide by $10$ to get $989$. Subtract $909$ and get $80$ and divid by $10$ to get $8$. That's a success.






share|cite|improve this answer









$endgroup$













    Your Answer





    StackExchange.ifUsing("editor", function () {
    return StackExchange.using("mathjaxEditing", function () {
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix) {
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    });
    });
    }, "mathjax-editing");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "69"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    noCode: true, onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3145808%2fhow-to-check-if-some-number-say-a-can-be-expressed-as-a-b-reverseb-whe%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1












    $begingroup$

    Let $b = sumlimits_{k=0}^n b_k 10^k$



    $b + rev(b) = sumlimits_{k=0}^{n}(b_k + b_{n-k})10^k < 2*10^{k+1}$.



    Suppose $a$ is an $n+1$ digit number.



    Case 1: The first digit of $a$ is not equal to $1$. Then if $a = b + rev(b)$ then $b$ is also an digit number and $b_0 + b_k < 10$. So the first digit and last digit of $a$ are are $b_0 + b_k$ and equal.



    If the first digit and last digit of $a$ are not equal then $a $ is not is not $b+ rev(b)$. If the first digit and last digit or then remove the first digit and last digit, divide by $10$ and repeat the process.



    Case 1a: The first and last digit are $1$. To see if $b_0 + b_k = 1$ and $a = b + rev(b)$, revert to case 1. If it fails, continue to case 2.



    Case 2: The first digit of $a$ is $1$. If $b_0 + b_k ge 10+ $ last digit of $a = m$ and $a = b + rev (b)$ then subtract $m$ and $m*10^{n-1}$ from $a$. Divide by $10$. Repeat the process.



    Either the process will end at a single digit and $a = b+ rev(b)$ or the process will fail and $a ne b + rev (b)$ for any $b$.



    Example: $59406 + 60495=119901$ so



    so subtract $100001$ to get $19900$ and divide by $10$ to get $1990$. Subtract $10$ and $1000$ to get $980$ and divide by $10$ to get $98$ and that was a failure.



    So go back to $119901$ and subtract $11$ and $110000$ so get $9890$ and divide by $10$ to get $989$. Subtract $909$ and get $80$ and divid by $10$ to get $8$. That's a success.






    share|cite|improve this answer









    $endgroup$


















      1












      $begingroup$

      Let $b = sumlimits_{k=0}^n b_k 10^k$



      $b + rev(b) = sumlimits_{k=0}^{n}(b_k + b_{n-k})10^k < 2*10^{k+1}$.



      Suppose $a$ is an $n+1$ digit number.



      Case 1: The first digit of $a$ is not equal to $1$. Then if $a = b + rev(b)$ then $b$ is also an digit number and $b_0 + b_k < 10$. So the first digit and last digit of $a$ are are $b_0 + b_k$ and equal.



      If the first digit and last digit of $a$ are not equal then $a $ is not is not $b+ rev(b)$. If the first digit and last digit or then remove the first digit and last digit, divide by $10$ and repeat the process.



      Case 1a: The first and last digit are $1$. To see if $b_0 + b_k = 1$ and $a = b + rev(b)$, revert to case 1. If it fails, continue to case 2.



      Case 2: The first digit of $a$ is $1$. If $b_0 + b_k ge 10+ $ last digit of $a = m$ and $a = b + rev (b)$ then subtract $m$ and $m*10^{n-1}$ from $a$. Divide by $10$. Repeat the process.



      Either the process will end at a single digit and $a = b+ rev(b)$ or the process will fail and $a ne b + rev (b)$ for any $b$.



      Example: $59406 + 60495=119901$ so



      so subtract $100001$ to get $19900$ and divide by $10$ to get $1990$. Subtract $10$ and $1000$ to get $980$ and divide by $10$ to get $98$ and that was a failure.



      So go back to $119901$ and subtract $11$ and $110000$ so get $9890$ and divide by $10$ to get $989$. Subtract $909$ and get $80$ and divid by $10$ to get $8$. That's a success.






      share|cite|improve this answer









      $endgroup$
















        1












        1








        1





        $begingroup$

        Let $b = sumlimits_{k=0}^n b_k 10^k$



        $b + rev(b) = sumlimits_{k=0}^{n}(b_k + b_{n-k})10^k < 2*10^{k+1}$.



        Suppose $a$ is an $n+1$ digit number.



        Case 1: The first digit of $a$ is not equal to $1$. Then if $a = b + rev(b)$ then $b$ is also an digit number and $b_0 + b_k < 10$. So the first digit and last digit of $a$ are are $b_0 + b_k$ and equal.



        If the first digit and last digit of $a$ are not equal then $a $ is not is not $b+ rev(b)$. If the first digit and last digit or then remove the first digit and last digit, divide by $10$ and repeat the process.



        Case 1a: The first and last digit are $1$. To see if $b_0 + b_k = 1$ and $a = b + rev(b)$, revert to case 1. If it fails, continue to case 2.



        Case 2: The first digit of $a$ is $1$. If $b_0 + b_k ge 10+ $ last digit of $a = m$ and $a = b + rev (b)$ then subtract $m$ and $m*10^{n-1}$ from $a$. Divide by $10$. Repeat the process.



        Either the process will end at a single digit and $a = b+ rev(b)$ or the process will fail and $a ne b + rev (b)$ for any $b$.



        Example: $59406 + 60495=119901$ so



        so subtract $100001$ to get $19900$ and divide by $10$ to get $1990$. Subtract $10$ and $1000$ to get $980$ and divide by $10$ to get $98$ and that was a failure.



        So go back to $119901$ and subtract $11$ and $110000$ so get $9890$ and divide by $10$ to get $989$. Subtract $909$ and get $80$ and divid by $10$ to get $8$. That's a success.






        share|cite|improve this answer









        $endgroup$



        Let $b = sumlimits_{k=0}^n b_k 10^k$



        $b + rev(b) = sumlimits_{k=0}^{n}(b_k + b_{n-k})10^k < 2*10^{k+1}$.



        Suppose $a$ is an $n+1$ digit number.



        Case 1: The first digit of $a$ is not equal to $1$. Then if $a = b + rev(b)$ then $b$ is also an digit number and $b_0 + b_k < 10$. So the first digit and last digit of $a$ are are $b_0 + b_k$ and equal.



        If the first digit and last digit of $a$ are not equal then $a $ is not is not $b+ rev(b)$. If the first digit and last digit or then remove the first digit and last digit, divide by $10$ and repeat the process.



        Case 1a: The first and last digit are $1$. To see if $b_0 + b_k = 1$ and $a = b + rev(b)$, revert to case 1. If it fails, continue to case 2.



        Case 2: The first digit of $a$ is $1$. If $b_0 + b_k ge 10+ $ last digit of $a = m$ and $a = b + rev (b)$ then subtract $m$ and $m*10^{n-1}$ from $a$. Divide by $10$. Repeat the process.



        Either the process will end at a single digit and $a = b+ rev(b)$ or the process will fail and $a ne b + rev (b)$ for any $b$.



        Example: $59406 + 60495=119901$ so



        so subtract $100001$ to get $19900$ and divide by $10$ to get $1990$. Subtract $10$ and $1000$ to get $980$ and divide by $10$ to get $98$ and that was a failure.



        So go back to $119901$ and subtract $11$ and $110000$ so get $9890$ and divide by $10$ to get $989$. Subtract $909$ and get $80$ and divid by $10$ to get $8$. That's a success.







        share|cite|improve this answer












        share|cite|improve this answer



        share|cite|improve this answer










        answered Mar 12 at 23:46









        fleabloodfleablood

        72.8k22788




        72.8k22788






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Mathematics Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            Use MathJax to format equations. MathJax reference.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3145808%2fhow-to-check-if-some-number-say-a-can-be-expressed-as-a-b-reverseb-whe%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Magento 2 - Add success message with knockout Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Announcing the arrival of Valued Associate #679: Cesar Manara Unicorn Meta Zoo #1: Why another podcast?Success / Error message on ajax request$.widget is not a function when loading a homepage after add custom jQuery on custom themeHow can bind jQuery to current document in Magento 2 When template load by ajaxRedirect page using plugin in Magento 2Magento 2 - Update quantity and totals of cart page without page reload?Magento 2: Quote data not loaded on knockout checkoutMagento 2 : I need to change add to cart success message after adding product into cart through pluginMagento 2.2.5 How to add additional products to cart from new checkout step?Magento 2 Add error/success message with knockoutCan't validate Post Code on checkout page

            Fil:Tokke komm.svg

            Where did Arya get these scars? Unicorn Meta Zoo #1: Why another podcast? Announcing the arrival of Valued Associate #679: Cesar Manara Favourite questions and answers from the 1st quarter of 2019Why did Arya refuse to end it?Has the pronunciation of Arya Stark's name changed?Has Arya forgiven people?Why did Arya Stark lose her vision?Why can Arya still use the faces?Has the Narrow Sea become narrower?Does Arya Stark know how to make poisons outside of the House of Black and White?Why did Nymeria leave Arya?Why did Arya not kill the Lannister soldiers she encountered in the Riverlands?What is the current canonical age of Sansa, Bran and Arya Stark?