# Print a bunch of uninteresting numbers!

An uninteresting number (which I totally didn't make up only for this challenge) is created like this:

1. Take a positive integer N
2. Create a new number O by adding the digits of N at the end of N
3. The final uninteresting number is O*N

For example for N=12:

1. O = 1212
2. O*N = 1212 * 12
3. Final number is 14544

# Input

A positive integer N (N > 0) or your language's equivalent. You don't have to catch incorrect input.

# Output

The corresponding uninteresting number.

# Test cases

  1 -> 11
2 -> 44
3 -> 99
10 -> 10100
174 -> 30306276


# Scoring

Shortest Code in Bytes wins.

• There must be a relevant OEIS entry...
– MKII
Jul 7, 2016 at 10:52
• @Seims It was a joke, based on the "uninsteresting" name
– MKII
Jul 7, 2016 at 11:10
• @MKII my bad, i don't speak joke Jul 7, 2016 at 11:13
• Is taking the number as a string argument bending the rules a bit too much? Jul 7, 2016 at 11:39
• Go ahead, bend the rules! :P Jul 7, 2016 at 11:44

# Desmos, 28 bytes

f(n)=10^{floor(logn)}10nn+nn


Try It On Desmos!

Try It On Desmos! - Prettified

# Ly, 8 bytes

nsS&:Jl*


Try it online!

Ly supports a pretty direct translation of the rules of this challenge...

n         - read in the number
s        - stash the number
S       - push the digits of the number onto the stack
&:     - append the stack to itself
J    - convert those digits to a number
l   - restore the original number
*  - multiple, stack prints as number automatically


# Zsh, 13 bytes

<<<$[$1*$1$1]

Attempt This Online!

# Ruby, 31 26 bytes

-5 bytes thanks to pxeger and Stefan

n=gets;p (n+n).to_i*n.to_i

Attempt This Online!

• You can replace puts with just p for -3 bytes Apr 9 at 12:54
• you can use just (n+n) instead of the o variable to save another -2 bytes Apr 9 at 15:51
• here's 26 bytes Apr 9 at 15:52

A pointfree function which takes and returns an integer.

(*)<*>read.(show<>show)

Attempt This Online!

# ForceLang, 54 bytes, noncompeting

set a io.readnum()
io.write a.mult number.parse a+""+a


Noncompeting, because it requires a language version published after this challenge (containing a patch for a minor parse error relating to the empty string literal).

The original answer, which doesn't require this bugfix (76 bytes):

set a io.readnum()
set b a+string.builder()
io.write a.mult number.parse b+a


# Racket, 74 62 bytes

(λ(n)(*((λ(m)(string->number(string-append m m)))(~a n))n))


I hate the length of built-in function names in Racket sometimes. Other times, I discover a really concisely named version of a function and transform a number->string into ~a.

# C, 52 50 bytes

q;f(char*v){q=atoi(v);return atoi(strcat(v,v))*q;}


### Usage

q;f(char*v){q=atoi(v);return atoi(strcat(v,v))*q;}
main(c,v)char**v;{while(*++v)printf("%d\n",f(*v));}


## Full Program 75 69 bytes

q;main(c,v)char**v;{q=atoi(*++v);printf("%d",atoi(strcat(*v,*v))*q);}


-2 & -6 thanks to Toby Speight in this comment

• Be careful with that main() loop - most implementations don't leave enough space for the strcat() in there. Jul 7, 2016 at 16:14
• BTW, in the 'full program' version, you don't need to dereference ++v, and you can move the increment over to the next statement: {q=atoi(*++v);... I think that gains you 3 bytes. Moreover strcat() returns the start of the string, so you can use atoi(strcat(v,v))*q and atoi(strcat(*v,*v))*qrespectively. Jul 7, 2016 at 16:16
• True!! I wrote the full program version in a rush... Jul 7, 2016 at 16:19

# Python 3, 43 bytes

x=int(input());print(10**len(str(x))*x+x)*x


## SAS, 32 Bytes

%macro x(a);%eval(&a&a*&a)%mend;


Macro language, so no string/numeric concept. Function style (so this doesn't return the value to the screen, that's your job, this just returns the value).

Examples:

86   %put %x(1);
11
87   %put %x(12);
14544


# Jolf, 4 bytes

Try it here!

*P+§


## Explanation

*P+§xxx
*     x   implicit input *
§x       implicit input as string
+  x      followed by implicit input
P         as a number


## Common Lisp (Lispworks), 9178 77 bytes

(defun f(n)(*(parse-integer(concatenate'string #1=(write-to-string n)#1#))n))

• I edited your answer so that it would show up as code. I don't know lisp, so I'm not sure. Is the newline is necessary? Jul 8, 2016 at 7:20
• Is the newline is necessary? not necessary Jul 8, 2016 at 7:31
• I'm not sure, that's why I'm asking you. Will this still run if you combined it into one line? Jul 8, 2016 at 7:34
• yes, lisp separative sign is parentheses or blank space (etc. tabbar\Spacebar) Jul 8, 2016 at 7:44

# T-SQL, 45 bytes

DECLARE @i INT = 12
SELECT CONCAT(@i, @i)*@i


# TI-BASIC, 22 or 24 bytes

Prompt X
X(X+X10^(1+int(log(X


Or, 22 bytes stored as a Y-var (basically a function).

# Python, 46 bytes

i=input("N:")           # Standard input
y=i+(i[-2:])            # Using strip method to take last two chars from input
print(int(y)*int(i))    # Temp convert strings into integers for maths and print the result.


# JavaScript, 25 bytes

### Golfed:

_=prompt();alert((_+_)*_)


### Ungolfed:

_=prompt();


### Explanation:

_=prompt();    - set variable to prompt
alert((_+_)*_) - alert output, which is the number plus itself, times itself


This code was originally written by TùxCräftîñg. Their original comment with the code can be found here.

# PHP, 32 bytes

function f($n){print($n.$n)*$n;}


Try it online!