g | x | w | all
Bytes Lang Time Link
028Perl 5 pl250219T151930ZXcali
005Vyxal220129T204110Zemanresu
007Vyxal 3250219T104219ZThemooni
009Japt250218T172812ZShaggy
010Uiua250218T184833Znoodle p
00805AB1E250218T161603ZGlory2Uk
015Ly220224T071315Zcnamejj
014J220222T153628Zsinvec
070GeoGebra220201T054115ZAiden Ch
056Julia 1.0220201T233013ZSundar R
076tinylisp220201T062342ZRazetime
033Haskell220131T163903ZAZTECCO
031TSQL220131T154733Zt-clause
007MathGolf220131T125521ZKevin Cr
031Python 2220130T025011ZDialFros
033Ruby220130T200333ZG B
014Burlesque220130T191951ZDeathInc
079PHP220130T145137ZFmbalbue
055C gcc220130T111430ZNoodle9
041Retina220130T110407ZNeil
009APL Dyalog Unicode220130T101924ZAdá
020APL+WIN220130T092500ZGraham
022BQN220130T095531Zzoomlogo
006Jelly220130T013710ZJonathan
039Factor220129T213407Zchunes
008Brachylog220130T001628ZFatalize
041JavaScript ES6220129T235653ZArnauld
040Pari/GP220129T234846Zalephalp
045Red220129T231542Zchunes
013Charcoal220129T221216ZNeil
055Retina 0.8.2220129T220850ZNeil
037Python 3220129T220138ZAnttiP
009Jelly220129T204509Zhyperneu

Perl 5 -pl, 28 bytes

$_=($_*=$b=<>)==reverse$_-$b

Try it online!

Vyxal, 7 5 bytes

*~εṘ=

Try it Online!

*     # Does a * b
    = # equal
   Ṙ  # the reverse of
 ~    # a * b
  ε   # - b

Vyxal 3, 7 bytes

Vyxal 3.5 port of Emanresu's answer

‹⁰W×⍨⇄=

Vyxal It Online!

explanation:

‹⁰W×⍨⇄=­⁡​‎‎⁡⁠⁣‏⁠‎⁡⁠⁤‏⁠‎⁡⁠⁢⁡‏‏​⁡⁠⁡‌⁢​‎‎⁡⁠⁡‏‏​⁡⁠⁡‌⁣​‎‎⁡⁠⁢‏⁠‏​⁡⁠⁡‌⁤​‎‎⁡⁠⁢⁢‏⁠‎⁡⁠⁢⁣‏‏​⁡⁠⁡‌­
  W×⍨    # ‎⁡multiply by the second input...
‹        # ‎⁢first input, decremented
 ⁰       # ‎⁣and first input unchanged
     ⇄=  # ‎⁤is the reverse of one equal to the other?
💎

Created with the help of Luminespire.

Japt, 9 bytes

Take input as an array.

×¶UvÉ ×sÔ

Try it (includes all test cases)

×¶UvÉ ×sÔ     :Implicit input of array U=[a,b]
×             :Product
 ¶            :Is equal to
  Uv          :  Modify first element of U
    É         :    Subtract 1
      ×       :  Product
       s      :  To string
        Ô     :  Reverse

Uiua, 10 bytes

=⍜°⋕⇌∩×◡-₁

Try it: Uiua pad

This relies on the deprecated behavior of ◡ below for functions with <2 arguments. If you are experiencing errors running this in the future, try replacing with ⊸₂.

05AB1E, 8 bytes

н<*θR¹På

Try it online!

Outputs 1 if two numbers are a reversed multiple pair, 0 - otherwise.

Commented:

н         take the first element of the pair
 <        decrement by 1
  *       multiply the pair by this value
   θ      take the last element
    R     reverse the digits;
     ¹    input again
      P   calculate the product of the pair
       å  check the result

Ly, 15 bytes

nn&s*SrJlf,*=u;

Try it online!

nn               - read two numbers from STDIN
  &s             - save the entries to the backup cell
    *            - multiple the two numbers passed in
     S           - convert integer to individual digits on stack
      r          - reverse stack
       J         - re-compose digits on stack into a integer
        l        - restore saved numbers
         f       - flip top two entries
          ,      - decrement the top of stack
           *     - multiple top two entries
            =    - compare the two entries on the stack
             u   - print "1|0" from comparison
              ;  - exit the program

J, 20 14 bytes

*=|.&.":@(*<:)

-6 bytes, thanks @Jonah

Try it online!

GeoGebra, 86 77 70 bytes

a=6
b=9
s=Text(ab-b)
o=Sum(Zip(Take(s,c,c),c,Length(s)…1))==Text(ab)

Try It On GeoGebra!

Input is a and b, output is o as true if a and b are a reversed multiple pair, false otherwise.

The example input shown in the code is a=6 and b=9, but you can change these values to whatever you want.

Julia 1.0, 56 bytes

(a,b,d=digits,s=string)->s(d(a*b))==s(reverse(d(a*b-b)))

Try it online!

Pretty straightforward answer, with nothing particularly clever to it (unfortunately).

tinylisp, 76 bytes

(load library
(d f(q((a b)(e(to-base 10(*(- a 1)b))(reverse(to-base 10(* a b

Try it online!

Haskell, 43 33 bytes

a?b=a*b==read(reverse$show$a*b-b)

Try it online!

T-SQL, 31 bytes

Using bitwise operators

PRINT-1/~(@*@b^reverse(@b*~-@))

Try it online

MathGolf, 7 bytes

`(*x¬*=

Try it online.

Explanation:

`        # Duplicate the top two items, using the implicit inputs
         #  STACK: b,a,b,a
 (       # Decrease the top item
         #  STACK: b,a,b,a-1
  *      # Multiply the top two together
         #  STACK: b,a,b*(a-1)
   x     # Reverse the top integer
         #  STACK: b,a,reverse(b*(a-1))
    ¬    # Reverse rotate the stack:
         #  STACK: reverse(b*a(-1)),b,a
     *   # Multiply the top two again
         #  STACK: reverse(b*a(-1)),b*a
      =  # Check if the two are equal
         #  STACK: reverse(b*a(-1))==b*a
         # (after which the entire stack joined together is output implicitly)

Python 2, 31 bytes

lambda a,b:`a*b`==`a*b-b`[::-1]

Using the logic that $$ ab = \operatorname{rev}( (a-1)b ) \iff ab = \operatorname{rev}(ab-b) $$ -2 thx to @dingledooper

Try it online!

Other solutions:

Python 2, 31 bytes

lambda a,b:`a*b`[::-1]==`a*b-b`

Using the logic that $$ \operatorname{rev}(ab) = (a-1)b \iff \operatorname{rev}(ab) = ab-b $$ -2 thx to @dingledooper

Try it online!

Python 2, 34 bytes

lambda a,b:a*b-int(`a*b`[::-1])==b

Using the logic that $$ ab - \operatorname{rev}(ab) =b $$

Try it online!

^Credits to @ovs for the equations!

Ruby, 33 bytes

->a,b{"#{a*=b}"==(a-b).digits*''}

Try it online!

Burlesque, 14 bytes

Jpdjp^-..*<-==

Try it online!

Takes input as array of pairs {a b}

J   # Duplicate
pd  # Product of array
j   # Swap
p^  # Push elements to stack (b, a)
-.  # Decrement
.*  # Product
<-  # Reverse digits
==  # Equal

PHP, 79 bytes

$a=trim(fgets(STDIN));$b=trim(fgets(STDIN));echo $a*$b==(int)strrev($b*($a-1));

Try it online!

With the help of Github Copilot

C (gcc), 55 bytes

c;r;f(a,b){for(r=0,c=~-a*b;c;c/=10)r+=9*r+c%10;r-=a*b;}

Try it online!

Inputs two integers \$a\$ and \$b\$.
Returns a falsy value if these two numbers are a reversed multiple pair or a truthy value otherwise.

Retina, 41 bytes

L$`.+,
*$'*_,$($^$.(*$'*))*_$'*
^(_+),\1$

Try it online! Link includes test cases. Explanation: Based on @ovs' 05AB1E answer.

L$`.+,

Match a as $& (Retina ignores the trailing comma when performing arithmetic) and b as $' and replace the whole input with the result.

*$'*_,$($^$.(*$'*))*_$'*

Calculate a*b and also rev(a*b)+b in unary.

^(_+),\1$

See whether they are the same.

APL (Dyalog Unicode), 9 bytes

Anonymous tacit infix function, taking \$a\$ as left argument and \$b\$ as right argument.

×≡∘⌽⍥⍕×-⊢

Try it online! (Uses Extended because TIO hasn't updated to 18.0)

× [Does] the product

≡∘ match the…

⌽⍥ reversed, when both are…

   stringified

× product

- minus

 the right argument[?]

APL+WIN, 22 20 bytes

Prompts for a then b. Minus 2 bytes using rearrangement logic

(⍎⌽⍕n-b)=n←(b←⎕)×a←⎕

Try it online! Thanks to Dyalog Classic

BQN, 33 22 Bytes

This seems too long.

A little better.

{(𝕨×𝕩)=•BQN⌽•Fmt𝕩×𝕨-1}

Try it!

¯11 bytes thanks to @Razetime

Jelly, 6 bytes

’×ṚḌ⁼×

A dyadic Link accepting \$a\$ and \$b\$ that yields 1 if \$a\times b = \text{reversed}( (a - 1)\times b )\$, 0 if not.

Try it online! Or see the test-suite.

How?

’×ṚḌ⁼× - Link: a, b
’      - a-1
 ×     - (a-1) times b
  Ṛ    - reverse the digits of (a-1)×b
   Ḍ   - convert back to an integer
     × - a×b
    ⁼  - equal?

Factor, 47 39 bytes

[ over * dup present reverse dec> - = ]

Try it online!

Saved 8 bytes thanks to @ovs' observations.

Explanation

Takes input as b a.

         ! 9 6
over     ! 9 6 9
*        ! 9 54
dup      ! 9 54 54
present  ! 9 54 "54"
reverse  ! 9 54 "45"
dec>     ! 9 54 45
-        ! 9 9
=        ! t

Brachylog, 8 bytes

-₁ʰ×↔~×?

Try it online!

Explanation

           Input = [A, B]
-₁ʰ        Compute [A-1, B]
   ×       Compute (A-1) × B
    ↔      Reverse digits
     ~×?   It can be unmultiplied into [A,B]

JavaScript (ES6), 41 bytes

Expects (a)(b). Returns a Boolean value.

a=>b=>[...a*b+''].reverse().join``==a*b-b

Try it online!

Pari/GP, 40 bytes

f(a,b)=d=digits;d(a*b)==Vecrev(d(a--*b))

Try it online!

Red, 47 45 bytes

func[a b][(to""a * b)= reverse to""a - 1 * b]

Try it online!

Charcoal, 13 bytes

NθNη⁼×θη⮌×⊖θη

Try it online! Link is to verbose version of code. Outputs a Charcoal boolean, i.e. - for a reversed pair, nothing if not. Explanation:

Nθ              First input as a number
  Nη            Second input as a number
      θ         First input
     ×          Multiplied by
       η        Second input
    ⁼           Equals
           θ    First input
          ⊖     Decremented
         ×      Multiplied by
            η   Second input
        ⮌       Reversed
                Implicitly print

Retina 0.8.2, 55 bytes

\d+
$*
1,
,
1(?=.*,(1+))
$1
,
,$`
1+
$.&
+`(.),\1
,
^,$

Try it online! Link includes test cases. Explanation:

\d+
$*

Convert to unary.

1,
,

Decrement a.

1(?=.*,(1+))
$1

Multiply a-1 by b.

,
,$`

Add that to b giving (a-1)b,ab.

1+
$.&

Convert to decimal.

+`(.),\1
,
^,$

Test whether the results are mirror images of each other.

Python 3, 37 bytes

lambda a,b:str(a*b)==str(~-a*b)[::-1]

Try it online!

Jelly, 9 bytes

,’$×DU⁼¥/

Try It Online!

,’$×DU⁼¥/    Main Link; dyad accepting a, b
,’$          pair: [a, a - 1]
   ×         multiply: [ab, (a - 1)b]
    D        to digit list
        /    reduce between the two:
     U       is the reverse of the former
      ⁼      equal to the latter?