g | x | w | all
Bytes Lang Time Link
017Juby250510T023532ZJordan
031Arturo230811T152333Zchunes
004Thunno 2 s230811T133200ZThe Thon
079Python 3210512T180041Zdrmosley
059Factor210512T054633Zchunes
005Vyxal s210511T063524Zhyperneu
010Pushy170203T175216ZFlipTack
024QBIC170203T163928Zsteenber
00505AB1E170203T111252ZOkx
017Dyalog APL160222T233032ZAdá
048Haskell160521T034523ZRyan McC
013MATL160222T224839ZLuis Men
036Perl160309T173233ZTon Hosp
025Perl 6160309T200858ZHotkeys
009Jelly160224T200739Zlynn
037Perl 5160223T080057Zmsh210
112Groovy160223T190116ZXgongive
064JavaScript ES6160222T214033ZMwr247
039Groovy160223T133329Zmanatwor
014CJam160222T213226ZGamrCorp
126C#160223T122715ZLegionMa
040Ruby160223T105803Zmanatwor
024Brachylog160223T101457ZFatalize
099JavaScript ES6160222T222716Zedc65
066JavaScript ES6160222T225724ZNeil
053Lua160223T073742ZKatenkyo
057Lua160223T073958ZMoop
1215𝔼𝕊𝕄𝕚𝕟160223T033015ZMama Fun
064R160222T214212Zmnel
009Jolf160223T015344ZConor O&
071Retina160222T223101ZDigital
008Pyth160222T225442ZMaltysen
025Perl 6160222T225416ZBrad Gil
nanRetina160222T224115Zdaavko
064Mathematica160222T223016ZCalculat
035PowerShell160222T213431ZAdmBorkB
00705AB1E160222T212332Za spaghe
074Python 3160222T212426ZMorgan T
039Bash + coreutils160222T214347ZDigital
010Pyth160222T211602ZDoorknob
012Seriously160222T211250Zuser4594

J-uby, 17 bytes

:+|:join|Z**:+%:~

Attempt This Online! (Uses the ** operator from an older version of J-uby.)

Arturo, 31 bytes

$->n[+do join@n..1do join@1..n]

Try it!

$->n[          ; a function taking an argument n
    1..n       ; the range [1..n]
    @          ; reify to block of integers
    join       ; convert [1 2 3] to "123", for instance
    do         ; eval -- convert numeric string to integer
    n..1       ; the range [n..1]
    @          ; reify to block of integers
    join       ; convert [1 2 3] to "123", for instance
    do         ; eval -- convert numeric string to integer
    +          ; add
]              ; end function

Thunno 2 s, 4 bytes

RJNḲ

Try it online!

Explanation

RJNḲ  # Implicit input
R     # Push [1..input]
 J    # Join into a string
  N   # Convert to integer
   Ḳ  # Duplicate and reverse
      # Sum the stack
      # Implicit output

Python 3, 79 bytes

a=''.join([str(i+1) for i in range(int(input()))])
print(int(a)+(int(a[::-1])))

Try it online!

Factor, 59 bytes

[ [1,b] dup reverse [ [ present ] map concat dec> ] bi@ + ]

Try it online!

Vyxal s, 5 bytes

ɾḂWvṅ

Try it Online!

ɾ         range: [1 .. x]
 Ḃ        pop x, push x, reversed(x) [bifurcate]
  W       wrap the stack
   v      for each
    ṅ     join on ""

s (flag)  sum

-2 bytes thanks to Razetime

Pushy, 10 bytes

RV@KjOjv+#

Try it online!

RV    \ Push the range to both stacks.
@Kj   \ Reverse and join the first stack
Oj    \ Join the second stack
v+    \ Sum the two resulting integers
#     \ Print result

QBIC, 24 bytes, nc

:[a|B=B+!b$]_FB|?!A!+!B!

Explanation

:       Read command line argument as 'a'
        Generate the sequence 1 ... a
[a|     For b = 1 to a step 1
B=B+!b$ Add b cast to string to the end of B$ (starts out empty)
]       Ends the FOR loop
_FB|    Reverse (Flip) B$ and assign the result to A$
?       Show on screen
!A!+!B! A$ cast to num + B$ cast to num

Non-competing, the _F was implemented way after this challenge was posted.

05AB1E, 5 bytes

LJDR+

Explanation:

L     # Pushes an array containing 1 .. [implicit] input
 J    # Join the array to a string (eg. [1, 2, 3] -> 123)
  D   # Duplicate the array
   R  # Reverse the duplicate
    + # Add them together

Try it online!

Dyalog APL, 17 bytes

+/⍎¨∊¨⍕¨¨x(⌽x←⍳⎕)

prompt for input
' enumerate until input
x← store list in x
reverse x
x() prepend reversed list with original list
⍕¨¨ convert each number of each list into character string
∊¨ make each list of character strings into single character strings
⍎¨ convert each character string into a number
+/ sum the two numbers.

Haskell, 57 56 48 bytes

This could probably be golfed a bit more, but here it goes:

f x=read y+(read.reverse$y)where y=[1..x]>>=show

Edit: shaved off a space before the where.

MATL, 13 bytes

:tP2:"wVXvU]+

EDIT (May 20, 2016) The code in the link uses Xz instead of Xv, owing to recent changes in the language.

Try it online!

:                % range [1,2,...,n], where n is input
 tP              % duplicate and flip
   2:"     ]     % do this twice
      w          % swap
       V         % convert array of numbers to string with numbers and spaces
        Xv       % remove spaces
          U      % convert to number
            +    % add the two numbers

Perl, 36 bytes

Includes +1 for -p

Run with on STDIN

perl -p reverse.pl <<< 6

reverse.pl

$_=eval join"",map{abs||"+"}-$_..$_

Perl 6, 25 bytes

Either one works

{([~] 1..$^n)+[R~] 1..$n}
{([~] 1..$^n)+[~] $n...1}

Jelly, 9 bytes

R,U$DF€ḌS

livecoding 

Perl 5, 37 bytes

25 bytes, plus 1 for -p and 11 for -MList::Gen

$_=<[.]1..$_>+<[R.]1..$_>

Previous solution, 40 bytes: 39, plus one for -p

@a=reverse@_=1..$_;$"=$\;$_="@a"+"@_"

Groovy, 112 characters

def r(n){if(n==1){return n;};return n+''+r(n-1)};n=6;s=r(args[0].toLong());print s.toLong()+s.reverse().toLong()

run with:

groovy filename.groovy *input*

JavaScript (ES6), 70 67 64 bytes

a=>(z=[...Array(a)].map((b,c)=>c+1)).join``- -z.reverse().join``

Fixed to meet requirement, as old code was made under misunderstanding of the input.

Groovy, 42 39 characters

{[1..it,it..1]*.join()*.toLong().sum()}

Sample run:

groovy:000> ({[1..it,it..1]*.join()*.toLong().sum()})(11)
===> 2345555545332

groovy:000> ({[1..it,it..1]*.join()*.toLong().sum()})(6)
===> 777777

CJam, 15 14 bytes

Thanks to Martin for shaving a byte!

ri,:)_W%si\si+

Try it online!

C#, 126 bytes

using System.Linq;a=>{var b=Enumerable.Range(1,a);return long.Parse(string.Concat(b))+long.Parse(string.Concat(b.Reverse()));}

Could possibly be golfed further. Not really sure.

Ruby, 40 characters

->n{eval (l=[*1..n])*''+?++l.reverse*''}

Sample run:

irb(main):001:0> ->n{eval (l=[*1..n])*''+?++l.reverse*''}[11]
=> 2345555545332

irb(main):002:0> ->n{eval (l=[*1..n])*''+?++l.reverse*''}[6]
=> 777777

Brachylog, 24 bytes

:1fLrcC,Lc+C=.,{,.:1re?}

JavaScript (ES6), 99

This adds digit by digit, so it can handle numbers well above the 53 bits of precision of javascript

n=>eval("for(a=b=c=r='';n;a+=n--)b=n+b;for(i=a.length;i--;r=c%10+r)c=(c>9)-(-a[i]-b[i]);c>9?1+r:r")

Test

f=n=>eval("for(a=b=c=r='';n;a+=n--)b=n+b;for(i=a.length;i--;r=c%10+r)c=(c>9)-(-a[i]-b[i]);c>9?1+r:r")

// Less golfed
U=n=>{
  for(a=b=c=r=''; n; --n)
      b=n+b, a+=n;
  for(i=a.length; i--; r = c%10+r) 
      c=(c>9)-(-a[i]-b[i]);
  return c>9? 1+r : r;
}

function test() {
  var n=+I.value
  R.textContent=f(n)
}  

test()
N: <input id=I value=11 oninput="test()"> -> <span id=R></span>

JavaScript (ES6), 67 66 bytes

n=>(a=[...Array(n+1).keys()].slice(1)).join``- -a.reverse().join``

Yes, that's a space. Ugh. At least @Downgoat helped me save a byte.

Lua, 53 Bytes

This program takes n as a command-line argument.

s=""r=s for i=1,arg[1]do r,s=i..r,s..i end print(s+r)

I assumed that outputing a number with a decimal part of 0 was okay (in the form 777777.0 because this is the default way to output a number in lua (there's no distinction between integer and float)

Lua, 57

a=''b=''for i=1,...do a=a..i b=b.. ...-i+1 end return a+b

𝔼𝕊𝕄𝕚𝕟, 12 chars / 15 bytes

⨭⟮⩤⁽1ï⟯⨝,Ⅰᴚ⨝

Try it here (Firefox only).

Meh.

Explanation

Takes a range [1,input], joins it; takes that same range, reverses it, then joins it; the sum of both ranges is the result.

R, 34 60 64 bytes

f=pryr::f;g=f(as.numeric(paste(x,collapse='')));f(g(1:n)+g(n:1))

Assumes pryr package is installed. this gives f as a shorthand for creating functions.

Edit added 26 bytes but returns a function that works, not something entirely wrong.

Edit added another 4 bytes to handle cases above n=10 where strtoi (previously used) was returning NA

Jolf, 9 bytes

Try it here! Replace with \x10.

+P►γzjP_γ
    zj    range 1...j
   γ      γ = ^
  ►        ^ .join("")
 P         as a number
+     P_γ  and γ reversed

I may be able to golf it by moving around the type casting.

Retina, 71

Because its blatantly the wrong tool for the job.

.+
$*a:$&$*
+`^(a+)a\b(.*)\b1(1+)$
$1 $& $3
 ?(\w)+ ?
$#1
\d+:?
$&$*c
c

Try it online.

Works for inputs up to 6, but the online interpreter times out after that.

Pyth - 8 bytes

siRT_BSQ

Try it online here.

Perl 6, 25 bytes

{([~] @_=1..$^n)+[R~] @_}
{
  (
    [~]           # reduce with the string concatenation infix op:
    @_ = 1 .. $^n # the range 1 to input ( also stored in @_ )
  )
  +               # add that to
  [R~] @_         # @_ reduced in reverse
}

Usage:

for 6, 11, 12 -> $n {
  say {([~] @_=1..$^n)+[R~] @_}( $n )
}
777777
2345555545332
244567776755433

Retina, 80 bytes (ISO 8859-1 encoding)

'+
$0¶$0
+`^(('+)')
$2 $1
+`('('+))$
$1 $2
(')+( |$)?
$#1
(\d+)¶(\d+)
$1$*'$2$*'

IO is in unary with ' as the counting character. In theory supports any integer you throw at it, in practice...online interpreter refuses to process anything larger than 6 (unary '''''').

Try it online!
Try it online! (decimal IO - 91 bytes)

Mathematica, 64 bytes

Plus@@FromDigits/@#&[""<>ToString/@#&/@{#,Reverse@#}&[Range@#]]&

PowerShell, 35 bytes

param($a)+-join(1..$a)+-join($a..1)

Converts the input to ranges with .., then -joins them together, and adds 'em up.

Will work for input numbers up to 138, while 139 will give Infinity, and 140 and above will barf out an awesomely verbose casting error:

Cannot convert value "12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413
5136137138139140" to type "System.Int32". Error: "Value was either too large or too small for an Int32."

05AB1E, 7 bytes

LDRJsJ+

Try it online.

Explanation

LDRJsJ+

L        range from 1 .. input
 D       duplicate
  R      reverse
   JsJ   convert both arrays to strings
      +  add (coerces both strings to ints)

Python 3, 74

Saved 6 bytes thanks to DSM.

Nothing too exciting, join the ranges and then convert to ints and add them.

lambda x:sum(int(''.join(list(map(str,range(1,x+1)))[::i]))for i in(1,-1))

Bash + coreutils, 39

eval echo {1..$1} + {$1..1}|tr -d \ |bc

Or:

bc<<<`eval printf %s {1..$1} + {$1..1}`

Ideone.

Pyth, 12 10 bytes

ssMjLk_BSQ

Thanks to @FryAmTheEggman for 2 bytes!

Q is the input, S turns it into [1, 2, ..., input()], _B bifurcates it over _ (reverse) to create [rng, rev(rng)], jLk maps it over join by k (which is the "empty string" variable), sM maps int over this resulting array, and s finally calculates the sum.

Seriously, 12 bytes

,R;Rεj≈@εj≈+

Try it online!

Explanation:

,R;Rεj≈@εj≈+
,R;           push two copies of range(1, input()+1)
   R          reverse one copy
    εj≈@εj≈   concatenate both and cast both to ints
           +  add