g | x | w | all
Bytes Lang Time Link
174C gcc250205T214150Zayaan098
015APLNARS250205T164422ZRosario
004Jalapeño250204T045214ZATaco
066Desmos250202T201559ZDesmosEn
024AWK241118T203645Zxrs
008Husk240911T135516Zint 21h
056Clojure240903T145603ZNikoNyrh
023Excel240902T003953ZTaylor R
021ARBLE240902T052222ZATaco
045PowerShell Core240902T014340ZJulian
067Desmos240807T110745ZAiden Ch
021AWK240816T165950ZC K
005Japt240805T213825ZShaggy
030Wolfram Language Mathematica240816T130445Zatt
108Go240812T134950Zbigyihsu
005MathGolf240812T122351ZKevin Cr
00605AB1E240812T122020ZKevin Cr
044Python 3240805T113213ZJitse
nanJavascript V8240808T085636ZBean Sea
031JavaScript Node.js240809T093310Ztsh
038Lua240808T221837Zchunes
023Julia240805T185155ZKirill L
120Java JDK240808T172230ZDavid Co
006Stack control 1.1240805T134633ZШвеев Ал
033gnuplot240807T072811Zint 21h
015J240807T003850ZJonah
028Bash240805T233522ZDigital
033Bash240806T200247ZDonat
009Charcoal240806T184802ZNeil
054Retina240806T184613ZNeil
009Pyth240806T180054Zint 21h
041MATLAB240806T120345Zrst
007Brachylog240806T082821ZFatalize
030Ruby240806T070523ZG B
029R240805T133004Zpajonk
043Windows Batch240806T063618Zuser3141
146C++240805T110722ZRedz
041Red240805T215259Zchunes
052Kotlin 52 Bytes240805T213724Zcolmmurp
027Perl 5 MListUtil=sum ap240805T193346ZXcali
045Factor240805T171144Zchunes
004Jelly240805T115728ZJonathan
066Setanta240805T152743Zbb94
031Arturo240805T145757Zchunes
031Google Sheets240805T145357Zz..
033Haskell240805T142051ZDPD-
017K ngn/k240805T135303Zakamayu
nanUiua240805T125637Zmousetai
036Python 3240805T125107ZAlbert.L
017APL+WIN240805T122405ZGraham
032JavaScript Node.js240805T112622Zl4m2
016APL Dyalog Unicode240805T110728ZAdá
006Vyxal240805T110401Zemanresu

C (gcc), 174 bytes

char c[99];j;k;
#define F(x)atoi(x)*atoi(x)*atoi(x)
main(int a,char**v){strcpy(c,v[1]);while(k++-2)strcpy(c+(j+=strlen(v[k])),v[k+1]);exit(atoi(c)!=F(v[1])+F(v[2])+F(v[3]));}

Try it online!

APL(NARS), 15 chars

{(∊⍕¨⍵)≡⍕+/⍵*3}

test:

  {(∊⍕¨⍵)≡⍕+/⍵*3}10 0 0
1
~
  {(∊⍕¨⍵)≡⍕+/⍵*3}10 0 1
1
~
  {(∊⍕¨⍵)≡⍕+/⍵*3}¨(1 5 3)(2 2 13)(4 0 7)(828 538 472)
┌4───────┐
│ 1 1 1 1│
└~───────┘
  {(∊⍕¨⍵)≡⍕+/⍵*3}¨(1 2 3)(4 5 6)(6 0 0)(166 500 334)
┌4───────┐
│ 0 0 0 0│
└~───────┘

Jalapeño, 4 bytes

J=Σₓ³

Explained

J=Σₓ³
J      # Join (implicit input) together
 =     # Is equal to
  Σₓ   # The sum of (implicit input) mapped by
    ³  # Cubed

Hex-Dump of Bytecode

       0  1  2  3  4  5  6  7  8  9  A  B  C  D  E  F
0000: 14 59 ea 62                                     

Try it Online!

Desmos, 66 bytes

d(n)=10^{floor(log(n+0^n))+1}
f(a,b,c)=a^3+b^3+c^3-c-d(c)(b+d(b)a)

This solution evolved very close to Aiden Chow's solution, but it does improve it by one byte. 0 represents truthy outputs, any any other integer represents falsey.

Try it on Desmos!

AWK, 24 bytes

$0=$1^3+$2^3+$3^3~$1$2$3
awk '$0=$1^3+$2^3+$3^3~$1$2$3' << "1 5 3"

Prints 1 if truthy, or nothing.

Husk, 8 bytes

=dṁd¹ṁ^3

Try it online!

Takes a list of numbers and outputs 1 (truthy) "if the sum of their cubes is equal to the concatenation of those numbers", otherwise 0 (falsy).

Explanation:

     ṁ^3  # sum up the cubes
  ṁd¹     # split every number into its digits and flatten the list
 d        # join digits back into a single number
=         # check for the equality

Clojure, 56 bytes

#(=(seq(str(apply +(for[i %](* i i i)))))(mapcat str %))

TIO. This was surprisingly painless, thanks to str and mapcat. Takes the input as a list of numbers.

Excel, 23 Bytes

An anonymous workbook function that takes input from a vertical array at A1# and outputs to the calling cell

--(A1&A2&A3)=SUM(A1#^3)

Previous Version, 24 bytes

A slightly more elegant solution that uses the Concat builtin

--CONCAT(A1#)=SUM(A1#^3)

Sample Output

For the input array ={1;5;3} outputs the following

Output Example

ARBLE, 21 bytes

a^3+b^3+c^3-(a..b..c)

0 for truthy, non-zero for falsey.

Try it online!

Run all tests!

PowerShell Core, 45 bytes

-join$args-(($args|%{"$_*"*3+1})-join'+'|iex)

Try it online!

Takes 3 integers as parameters
Returns \$0\$ for true, otherwise false=

Desmos, 81 67 bytes

-14 bytes thanks to @emanresu A due to the fact that I didn't realize that it was always guaranteed to be exactly 3 numerical inputs. I was originally solving for an arbitrary amount of numerical inputs.

c(x,y)=x10^{floor(log(y+0^y))+1}+y
f(x,y,z)=c(c(x,y),z)-x^3-y^3-z^3

Returns 0 for truthy and a non-zero integer for falsey.

Try It On Desmos!

Try It On Desmos! - Prettified

AWK, 24 21 bytes

$1$2$3~$1^3+$2^3+$3^3

Try it online!

Prints the digits if true, or returns nothing.

Japt, 5 bytes

x³¥U¬

Try it here

x³¥U¬     :Implicit input of array U
x         :Sum of
 ³        :  Cubes
  ¥       :Loosely equal to
   U¬     :  U joined to a string

Wolfram Language (Mathematica), 31 30 bytes

boring wins

s[#.#^2]==s/@#<>""&
s=ToString

Try it online!

Go, 108 bytes

import."fmt"
func f(a,b,c int)bool{n:=0
Sscanf(Sprintf("%d%d%d",a,b,c),"%d",&n)
return a*a*a+b*b*b+c*c*c==n}

Attempt This Online!

MathGolf, 5 bytes

‼yⁿΣ=

Try it online.

Explanation:

‼     # Apply the next two operands separately on the (implicit) input-triplet:
 y    #  Join them together
  ⁿ   #  Take the cube of each
   Σ  # Sum the triplet of cubes
    = # Check if the two lists are the same
      # (after which the entire stack joined together is output implicitly)

05AB1E, 6 bytes

3mOIJQ

Try it online or verify all test cases.

The 3m could alternatively be ** or n* for the same byte-count; or the order could be swapped to JI3mOQ as well:
Try it online.

Explanation:

3m      # Take the cube of each value in the (implicit) input-triplet
  O     # Sum those together
   I    # Push the input-triplet again
    J   # Join them together
     Q  # Check if the two are the same
        # (after which the result is output implicitly)

Python 3, 44 bytes

lambda x:sum(map(pow,x,[3]*3))-int(3*'%d'%x)

Try it online!

-1 byte thanks to Jonathan Allan

-2 bytes thanks to xnor

Returns truthy (nonzero integers) for False cases and falsey (zero integers) for True cases.

Python 3, 45 bytes

lambda a,b,c:a**3+b**3+c**3-int(f'{a}{b}{c}')

Try it online!

Javascript (V8), 40 bytes

a=>a.reduce((x,y)=>x+y**3,0)==a.join('')

where a is number[], so it should work for any number of arguments.

Try it online!

33 bytes

Thanks @Neil and @tsh for the shorter version!

a=>a.map(x=>s-=x**3,s=a.join``)|s

JavaScript (Node.js), 31 bytes

(x,y,z)=>[x]+y+z-x**3-y**3-z**3

Try it online!

A boring trivial solution is short...

Lua, 38 bytes

x,y,z=...print(x^3+y^3+z^3==0|x..y..z)

Try it online!

Julia, 26 24 23 bytes

-n="$(n'n.^2)"==join(n)

Attempt This Online!

Thanks to ovs for -2 and further -1 by Ashlin Harris.

Java (JDK), 120 bytes

t->t.stream().mapToInt(x->x*x*x).sum()==Integer.parseInt(t.stream().map(Object::toString).collect(Collectors.joining()))

Try it online!

I'm not sure if the import of java.util.List needs to be counted. The predicate takes a List and some old advice says that all the types for lambdas need to be included, with any imports, but in JShell it is imported by default and in JDK 23 (which is currently only a preview edition) you also get it for free in a Java program that is all in one file (you can even skip declaring a class or having a full public-static-void-main), but TIO doesn't support JShell or recent versions of Java.

Stack control 1.1, 6 characters

:³+⇆◡=

Explanation

:  - duplicates original array
³  - cubes every array element
+  - sum of array elements
⇆  - swap to another array
◡  - reversed concatenates values from array
=  - check if values are equals

gnuplot, 33 bytes

f(a,b,c)=a**3+b**3+c**3=="".a.b.c

Try it online!

A function that inputs 3 integer values and outputs 1 if their sum of cubes is equal to the concatenation of those numbers, otherwise the output is 0.

J, 15 bytes

;(=1#.^&3)&:".>

Try it online!

Takes input as list of boxed strings.

Bash, 28

Sometimes the simple solution is best:

(($1**3+$2**3+$3**3^$1$2$3))

This script takes a list as command-line parameters as input. e.g. ./cubeconcat.sh 1 5 3. It returns a shell exit code: 1 for True, 0 for False.

Try it online!


Previous, overcomplicated solution:

Bash, 37

(($(eval printf %s +\$[$1**3] ^ $1)))

This script takes a single quoted brace-enclosed, comma-separated list as input. e.g. ./cubeconcat.sh "{1,5,3}". It returns a shell exit code: 1 for True, 0 for False.

Try it online!

Bash, 33 bytes

[ $1$2$3 = $[$1**3+$2**3+$3**3] ]

Try it online!

The script returns a shell exit code: 1 for True, 0 for False.

Charcoal, 9 bytes

⁼I⪫θωΣXθ³

Try it online! Link is to verbose version of code. Takes input as an array and outputs a Charcoal boolean, i.e. - if the sum of cubes equals the concatenation, nothing if not. Explanation:

   θ        Input array
  ⪫         Joined by
    ω       Predefined variable empty string
 I          Cast to integer
⁼           Equals
       θ    Input array
      X     Vectorised raised to power
        ³   Literal integer `3`
     Σ      Take the sum
            Implicitly print

Retina, 54 bytes

,(\d+),(\d+)
$1$2,$.(***_$2*$2*$2*_$`*$`*$`*
^(.+),\1$

Try it online! Link includes test cases. Explanation:

,(\d+),(\d+)

Match the first number in $`, the second number in $1 and the third number in $2.

$1$2,$.(***_$2*$2*$2*_$`*$`*$`*

Concatenate the input numbers, then compute the sum of the cube of $1 (implicitly because it's the first number in the match), the cube of $2 and the cube of $`. (Retina 1 will do this calculation using arbitrary-precision integers as it knows it will be converting the result back to decimal.)

^(.+),\1$

Check that the two results are the same.

Pyth, 9 bytes

qsjkQsm**

Try it online!

First time golfing in Pyth, so this might be not optimal.

Explanation:

sm** calculates the sum of the cubes;

jkQ joins the list elements into a string and s converts the result to a number;

q: are the values equal?

MATLAB, 41 bytes

f=@(x)sum(x.^3)==str2num(sprintf('%d',x))

An @-function that accepts input as column vector.

>> f([828;538;472])
ans =
  logical
  1
>> f([200;0;200])
ans =
  logical
  0

Brachylog, 7 bytes

^₃ᵐ+~c?

Try it online!

Explanation

^₃ᵐ        Map cube on the input list
   +       The sum of these cubes…
    ~c?    …can be deconcatenated into the original input list

Ruby, 30 bytes

->a{a.sum{|x|x**3}.to_s==a*''}

Try it online!

R, 30 29 bytes

Edit: -1 byte thanks to @Kirill L..

\(x)x^2%*%x==Reduce(paste0,x)

Attempt This Online!

Windows Batch, 43 bytes

cmd/cset/a%1*%1*%1+%2*%2*%2+%3*%3*%3-%1%2%3

Prints 0 for truthy, <>0 for falsy.

Sorry, no TIO available; save as C:\Temp\cg274690.cmd or whatever.cmd, run from cmd.exe or PowerShell:
C:\Temp\cg274690.cmd 1 5 3

Ungolfed:

cmd.exe /c set /a %1 * %1 * %1 + %2 * %2 * %2 + %3 * %3 * %3 - %1%2%3

This starts another instance of cmd.exe, as using set /a inside a batch script requires an assignment, which would then have to be echoed out, for a total of 49 bytes (using LF as EOL):

set/ax=%1*%1*%1+%2*%2*%2+%3*%3*%3-%1%2%3
echo %x%

set /a used interactively inside a cmd prompt (or passed with /c) prints the result directly.

C++, 186 165 146 bytes

#include<iostream>
using namespace std;int main(){int a,b,c;cin>>a>>b>>c;cout<<(a*a*a+b*b*b+c*c*c==stoi(to_string(a)+to_string(b)+to_string(c)));}

(-16 thanks to Mousetail) (-19 thanks to Blue)

Try it online!

Red, 41 bytes

func[a][(sum a * a * a)= do rejoin to[]a]

Try it online!

Takes input as a vector of three numbers. Vectors support arithmetic with multiple values at once, but not powers.

Explanation

func[a][         ; start function taking argument a
(sum a * a * a)  ; sum of cubes
=                ; does it equal...
to[]a            ; input converted to regular list
rejoin           ; concatenated to string
do               ; evaluated (converted to integer)
]                ; end function

Kotlin 52 Bytes

{it.map{it*it*it}.sum()-it.joinToString("").toInt()}

Accepts a List<Int> and outputs zero for true and a non-zero integer for false.

Try it online

Perl 5 -MList::Util=sum -ap, 27 bytes

$_=y/ //dr==sum map$_**3,@F

Try it online!

Factor, 46 45 bytes

[ 4 dupn v* v. swap "%d%d%d"vsprintf dec> = ]

Try it online!

Explanation

[                 ! start function
4 dupn            ! put 4 total copies of input list on stack
v*                ! multiply top two
v.                ! dot product w/ third
swap              ! put input on top
"%d%d%d"vsprintf  ! concat all three to string
dec>              ! to number
=                 ! check equality
]                 ! end function

Jelly,  5  4 bytes

-1 thanks to Unrelated String! (*3S {cube then sum} -> ḋ² {dot-product with squared values}.)

ḋ²⁼V

A monadic Link that accepts a list of non-negative integers (with or without any leading zeros*) and yields 1 if the list concatenates to the sum of the cubes of its elements or 0 if not.

Try it online! Or see the test-suite.

How?

ḋ²⁼V - Link: list, A = [a, b, c]
 ²   - square {A} -> [a², b², c²]
ḋ    - {A} dot-product {that} -> a³+b³+c³
   V - evaluate {A} as Jelly code -> concatenated integer *
  ⁼  - {SumOfCubes} equals {that}?

* Leading zeros produce a side effect of printing zeros before yielding the result.

Setanta, 84 66 bytes

gniomh(a,b,c){toradh a*a*a+b*b*b+c*c*c==go_uimh(nasc@[a,b,c](""))}

try-setanta.ie link

Arturo, 31 bytes

$->a->=do join a∑map a=>[&^3]

Try it!

Explanation

$->a->        ; a function taking a list named a
=             ; are the following two values equal?
do join a     ; concatenation of input as a number
∑             ; and sum of...
map a=>[&^3]  ; inputs cubed

Google Sheets, 31 bytes

=SUMPRODUCT(A:A^3)=--JOIN(,A:A) 

Haskell, 33 bytes

(==).show.sum.map(^3)<*>(>>=show)

Try it online!

K (ngn/k), 17 bytes

{(,/$x)~$+/x*x*x}

Try it online!

Uiua, 17 14 12 chars

-3 chars thanks to Chunes by replacing fork with on

-2 chars thanks to OVS because I missed the existance of a power operator

=/+ⁿ3⟜⍜°⋕/⍚⊂

Pad Link

Python 3, 36 bytes

lambda*I:eval(3*"%d"%I+3*"-%d**3"%I)

Try it online!

eval golf of @Jitse's answer who generously declined to include it in their post. Returns zero for True and nonzero integer for False.

APL+WIN, 17 bytes

Prompts for integers.

(⍎∊⍕¨s)=+/(s←⎕)*3

Try it online! Thanks to Dyalog Classic

JavaScript (Node.js), 32 bytes

(a,b,c)=>a**3+b**3+c**3==[a]+b+c

Try it online!

Nothing to say.

APL (Dyalog Unicode), 16 bytes

+.*∘3=∘⍎∘∊⍕¨

Try it online!

+.*∘3 sum of cubes

=∘⍎∘∊ equal to the execution of the enlisted (flattened)

⍕¨ stringification of each

Vyxal, 6 bytes

ṅ?3e∑=

Try it Online!

    ∑  # Sum
  3e   # of cubes
 ?     # of input
     = # Is equal to
ṅ      # Concatenation of input?