[Question]
  [
**This is the robbers' thread. The cops' thread goes [here](https://codegolf.stackexchange.com/questions/77419/find-the-program-that-prints-this-integer-sequence-cops-and-robbers).**
In the cops thread, the task was to write a program/function that takes a positive (or non-negative) integer and outputs/returns another number (not necessarily integer). The robbers task is to unscramble the code the cops used to produce this output.
The cracked code doesn't have to be identical, as long as it has the same length and any revealed characters are in the correct positions. The language must also be the same (version numbers can be different). The output must of course be identical.
**No-ops can be used in robber's solution.**
The winner of the robbers thread will be the user who has cracked the 
most submissions by May 7th 2016. If there's a tie, the user who has cracked submissions with the longest combined code will win.
The submission should be formatted like this:
# Language, nn characters (including link to answer), Cop's username
Code:
```
function a(n)
    if n<2 then
        return n
    else
        return a(n-1) + a(n-2)
    end
end
```
Output
```
a(0) returns 0
a(3) returns 2
```
Optional explanation and comments.
  
[Answer]
# [MATL, 5 bytes, Luis Mendo](https://codegolf.stackexchange.com/a/77454/24877)
```
H5-*|
```
This code calculates `abs((2-5)*input)` which is just `a(n)=3*n` for positive numbers, which is <http://oeis.org/A008585>
[Answer]
## [Hexagony](https://github.com/mbuettner/hexagony), [7 bytes, Adnan](https://codegolf.stackexchange.com/a/77442/8478), [A005843](https://oeis.org/A005843)
```
?{2'*!@
```
or
```
 ? {
2 ' *
 ! @
```
[Try it online!](http://hexagony.tryitonline.net/#code=P3syJyohQA&input=Mg)
Simply doubles the input (and assumes positive input). The code is (for once) simply executed in reading order. The code uses three memory edges *A*, *B*, *C* with the memory pointer starting out as shown:
[![enter image description here](https://i.stack.imgur.com/YZRA7.png)](https://i.stack.imgur.com/YZRA7.png)
```
?    Read integer from STDIN into edge A.
{    Move memory pointer forwards to edge B.
2    Set edge B to 2.
'    Move memory pointers backwards to edge C.
*    Multiply edges A and B and store result in C.
!    Print result to STDOUT.
@    Terminate program.
```
[Answer]
# [J, 7 bytes, Cᴏɴᴏʀ O'Bʀɪᴇɴ](https://codegolf.stackexchange.com/a/77425)
### Code
```
2+*:@p:
```
### Output
```
   f =: 2+*:@p:
   f 0
6
   f 2
27
```
Try it with [J.js](https://a296a8f7c5110b2ece73921ddc2abbaaa3c90d10.googledrive.com/host/0B3cbLoy-_9Dbb0NaSk9MRGE5UEU/index.html#code=(%202%2B*%3A%40p%3A%20)%202).
### How it works
Sequence [A061725](http://oeis.org/A061725) is defined as **a(n) := pn² + 2**, where **pn** is the **(n + 1)th** prime number.
```
2+*:@p:  Monadic verb. Argument: n
    @    Atop; combine the verbs to the right and to the left, applying one after
         the other.
     p:  Compute the (n+1)th prime number.
  *:     Square it.
2+       Add 2 to the result.
```
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), [5 bytes](https://codegolf.stackexchange.com/a/77459), [Adnan](https://codegolf.stackexchange.com/users/34388/adnan), [A001788](http://oeis.org/A001788)
```
Læ€OO
```
[Try it online!](http://05ab1e.tryitonline.net/#code=TMOm4oKsT08&input=NQ) This uses an alternative definition given on the page. Explanation:
```
Læ€OO
L     range;      [1..n]
 æ    powerset;   [[], [1], ..., [1..n]]
  €O  mapped sum; [0, 1, ..., T(n)]
    O sum;        [a(n)]
```
[Answer]
# JavaScript, [10 bytes](https://codegolf.stackexchange.com/a/77515/41859), [user81655](https://codegolf.stackexchange.com/users/46855/user81655), [A033999](http://oeis.org/A033999)
*~~I think~~ I got it. Yeah.* This one was really hard. I like the submission because it relies heavily on precedences.
---
It's the sequence [A033999](http://oeis.org/A033999):
> 
> a(n) = (-1)^n.
> 
> 
> 
**Source**
```
t=>~t.z**t
```
**Explanation**
If you split this code according to the [JavaScript operator precedences](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence) you get:
1. `.` (precedence *18*) gets evaluated first and `t.z` will return `undefined`.
2. `~` (precedence *15*) tries to cast `undefined`, resulting in `0`, and returns `-1` after bitwise not.
3. `**` (precedence *14*) will return `-1 ^ t`, where `t` is *odd* or *even*, resulting in `-1` or `1`.
**Demo**
```
console.log(
    (t=>~t.z**t)(0),
    (t=>~t.z**t)(1),
);
```
[Try before buy](https://jsfiddle.net/cshpjre5/)
---
I will award a 100 rep bounty on this cool Cop submission.
[Answer]
# [Element](https://github.com/PhiNotPi/Element), [7 bytes](https://codegolf.stackexchange.com/a/77437/48934), [PhiNotPi](https://codegolf.stackexchange.com/users/2867/phinotpi), [A000042](http://oeis.org/A000042)
```
_'[,1`}
```
Notes: I was misled by the `}` for soooooo long. So it also matches `[`.
[Try it online!](http://element.tryitonline.net/#code=XydbLDFgfQ&input=Mw)
---
### How it works:
```
_'[,1`}
_        main_stack.push(input());
 '       control_stack.push(main_stack.pop());
  [      Object temp = control_stack.pop();
         for(int i=0;i<temp;i++){
   ,         Object a = main_stack.pop(); //is actually zero
             main_stack.push(a.toChars()[0]);
             main_stack.push(a);
    1        main_stack.push(1);
     `       System.out.println(main_stack.pop());
      }  }
```
[Answer]
# PHP, [41 bytes](https://codegolf.stackexchange.com/a/77448), [insertusernamehere](https://codegolf.stackexchange.com/users/41859/insertusernamehere), [A079978](http://oeis.org/A079978)
```
echo/* does n%3=0 */$argv[1]%3<1?1:0    ;
```
Returns 1 if its argument is a multiple of 3, and 0 otherwise. Not much beyond that.
[Answer]
# [MATL](http://github.com/lmendo/MATL), [9 bytes, beaker](https://codegolf.stackexchange.com/a/77493/34388), [A022844](https://oeis.org/A022844)
Code (with a whitespace at the end):
```
3x2xYP*k 
```
[Try it online!](http://matl.tryitonline.net/#code=M3gyeFlQKmsg&input=MTI)
Found the following three matches with a script I wrote:
```
Found match: A022844
info: "name": "Floor(n*Pi).",
Found match: A073934
info: "name": "Sum of terms in n-th row of triangle in A073932.",
Found match: A120068
info: "name": "Numbers n such that n-th prime + 1 is squarefree.",
```
I tried to do the first one, which is basically done with `YP*k`:
```
3x2x       # Push 3, delete it, push 2 and delete that too
    YP     # Push pi
      *    # Multiply by implicit input
       k   # Floor function
```
[Answer]
# Jolf, [3 bytes](https://codegolf.stackexchange.com/a/77482), [Easterly Irk](https://codegolf.stackexchange.com/users/46271/easterly-irk), [A001477](https://oeis.org/A001477)
```
axx
```
Consists of a simple cat (`ax`) followed by a no-op. Not sure what the cop was going for here.
[Answer]
# [Java, 479 bytes](https://codegolf.stackexchange.com/a/77487/52921), [Daniel M.](https://codegolf.stackexchange.com/u/41505/), [A000073](https://oeis.org/A000073)
Code:
```
import java.util.*;
public class A{
    public static int i=0;
    public boolean b;
    static A a = new A();
    public static void main(String[] args){
        int input = Integer.parseInt(args[0]);
        LinkedList<Integer> l = new LinkedList<>();
        l.add(1);
        l.add(0);
        l.add(0);
        for(int ix = 0; ix<=input; ix++)if(ix>2){
            l.add(0,l//d
            .get(1)+l.peekFirst()+     l.get(2));
        }
        System.out.println(input<2?0:l.pop()
              +(A.i        +(/*( 5*/ 0 )));
    }
}
```
If you miss non-revealed characters, they are replaced with spaces.
[Answer]
# Ruby, [38 bytes, histocrat](https://codegolf.stackexchange.com/a/77588/45268), [A008592](http://oeis.org/A008592)
```
->o{(s="+o++o"*5).sum==03333&&eval(s)}
```
Could be different from the intended solution as I found this by hand.
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), [4 bytes, Paul Picard](https://codegolf.stackexchange.com/a/77443/34388), [A001317](https://oeis.org/A001317)
Code:
```
$Fx^
```
[Try it online!](http://05ab1e.tryitonline.net/#code=JEZ4Xg&input=OA)
Explanation:
```
$      # Pushes 1 and input
 F     # Pops x, creates a for-loop in range(0, x)
  x    # Pops x, pushes x and 2x
   ^   # Bitwise XOR on the last two elements
       # Implicit, ends the for-loop
       # Implicit, nothing has printed so the last element is printed automatically
```
The sequence basically is a binary Sierpinski triangle:
```
f(0)=      1                    =1
f(1)=     1 1                   =3
f(2)=    1 0 1                  =5
f(3)=   1 1 1 1                 =15
f(4)=  1 0 0 0 1                =17
```
And translates to the formula **a(n) = a(n - 1) XOR (2 × a(n - 1))**
Luckily, I remembered [this one](https://codegolf.stackexchange.com/a/67503/34388) :)
[Answer]
# [S.I.L.O.S](http://github.com/rjhunjhunwala/S.I.L.O.S), [betseg](https://codegolf.stackexchange.com/a/96814/47066), [A001844](http://oeis.org/A001844)
```
readIO
a=i
a+1
i*2
i*a
i+1
printInt i
```
[Try it online!](http://silos.tryitonline.net/#code=cmVhZElPCmE9aQphKzEKaSoyCmkqYQppKzEKcHJpbnRJbnQgaQ&input=&args=NQ)
[Answer]
# Jolf, [5 characters](https://codegolf.stackexchange.com/a/77421/48934), [Cᴏɴᴏʀ O'Bʀɪᴇɴ](https://codegolf.stackexchange.com/users/31957/c%e1%b4%8f%c9%b4%e1%b4%8f%ca%80-ob%ca%80%c9%aa%e1%b4%87%c9%b4), [A033536](http://oeis.org/A033536)
Code:
```
!K!8x
```
Output:
```
a(2) = 8
a(10) = 4738245926336
```
[Answer]
# [Reng v3.3](https://jsfiddle.net/Conor_OBrien/avnLdwtq/), [36 bytes](https://codegolf.stackexchange.com/a/77427/48934), [Cᴏɴᴏʀ O'Bʀɪᴇɴ](https://codegolf.stackexchange.com/users/31957/c%e1%b4%8f%c9%b4%e1%b4%8f%ca%80-ob%ca%80%c9%aa%e1%b4%87%c9%b4), [A005449](http://oeis.org/A005449)
```
iv:#+##->>)2%æ~¡#~
#>:3*1+*^##</div>
```
## Output
```
a(1) = 2
a(3) = 15
```
## Explanation
I completely ignored the prespecified commands, except the `)` because I did not have enough space.
The actually useful commands are here:
```
iv      >>)2%æ~
 >:3*1+*^
```
Stretched to a straight line:
```
i:3*1+*)2%æ~
```
With explanation:
```
i:3*1+*)2%æ~ stack
i            [1]      takes input
 :           [1,1]    duplicates
  3          [1,1,3]  pushes 3
   *         [1,3]    multiplies
    1        [1,3,1]  pushes 1
     +       [1,4]    adds
      *      [4]      multiplies
       )     [4]      shifts (does nothing)
        2    [4,2]    pushes 2
         %   [2]      divides
          æ  []       prints
           ~ []       halts
```
The formula is `a(n) = n(3n+1)/2`.
[Answer]
# 05AB1E, [3 bytes](https://codegolf.stackexchange.com/a/77441/48934), [Adnan](https://codegolf.stackexchange.com/users/34388/adnan), [A000292](http://oeis.org/A000292)
```
LLO
```
### Output
```
a(9) = 165
a(10) = 220
```
### How it works
```
LLO Stack
L   [1,2,3,4,5,6,7,8,9]                         range
 L  [1,1,2,1,2,3,1,2,3,4,...,1,2,3,4,5,6,7,8,9] range of range
  O sum all of them
```
The mathematical equivalent is `sum(sum(n))`, where `sum` is `summation`.
[Answer]
# Jolf, 11 bytes, [QPaysTaxes](https://codegolf.stackexchange.com/a/77429/31957), [A000005](http://oeis.org/A000005)
```
aσ0xxdxxxxx
```
Simple enough: `a`lert the `σ0` (number of divisors of) `x`, then put useless stuff at the end.
[Try it online!](http://conorobrien-foxx.github.io/Jolf/#code=Yc-DMHh4ZHh4eHh4&input=MTAKCjIwCgozMA) The test suite button's a bit broke, but still shows proper results.
(You could've golfed it down to two bytes! Just `σ0` would've done nicely.)
[Answer]
# Python 2, [87 bytes](https://codegolf.stackexchange.com/a/77451), [Sp3000](https://codegolf.stackexchange.com/users/21487/sp3000), [A083054](http://oeis.org/A083054)
```
n=input()
_=int(3**.5*n)-3*int(n/3**.5)########################################
print _
```
Not that hard, actually. Just searched for sequences that met the constraints until I found one that could be generated in the given space.
[Answer]
# [Jolf](https://github.com/ConorOBrien-Foxx/Jolf), [11 bytes, RikerW](https://codegolf.stackexchange.com/a/77486/34388), [A011551](https://oeis.org/A011551)
Code:
```
c*mf^+91x~P
```
Explanation:
```
     +91     # add(9, 1) = 10
    ^   x    # 10 ** input
  mf         # floor function (no-op)
 *       ~P  # multiply by phi
c            # ¯\_(ツ)_/¯
```
[Try it here](http://conorobrien-foxx.github.io/Jolf/#code=YyptZl4rOTF4flA&input=MTI).
[Answer]
# JavaScript (ES6), [119 bytes, Cᴏɴᴏʀ O'Bʀɪᴇɴ](https://codegolf.stackexchange.com/a/77461/46855), [A178501](http://oeis.org/A178501)
```
x=>(n="=>[[["|x|"##r(###f#n###;##")|n?Math.pow("#<1##].c####t.##pl##[####nc#"|10,"y([###(###(#]###)"|x-1|``):0|`#h####`
```
I'm sure the actual code generates a trickier sequence than this, but with just the two outputs, this OEIS sequence is simple and matches them.
Without all the ignored characters, the algorithm is just `x=>x?Math.pow(10,x-1):0`.
[Answer]
# [05AB1E](http://github.com/Adriandmen/05AB1E), [5 bytes, Luis Mendo](https://codegolf.stackexchange.com/a/77502/34388), [A051696](https://oeis.org/A051696)
Code:
```
Ðms!¿
```
Explanation:
```
Ð      # Triplicate input.
 m     # Power function, which calculates input ** input.
  s    # Swap two top elements of the stack.
   !   # Calculate the factorial of input.
    ¿  # Compute the greatest common divisor of the top two elements.
```
So, basically this calculates **gcd(n!, nn)**, which is [A051696](https://oeis.org/A051696).
[Try it online!](http://05ab1e.tryitonline.net/#code=w5BtcyHCvw&input=Ng).
[Answer]
# PHP, [18 bytes, insertusernamehere](https://codegolf.stackexchange.com/a/77508/25180), [A023443](http://oeis.org/A023443)
Code:
```
echo$argv[1]+0+~0;
```
Output:
```
a(0) = -1
a(1) = 0
```
[Answer]
# [Octave (34 bytes) by Stewie Griffin](https://codegolf.stackexchange.com/a/77490/30688)
The sequence is [A066911](http://oeis.org/A066911).
```
@(m)(mod(m,u=1:m  )&isprime(u))*u'
```
[Answer]
# PHP, [137 bytes, insertusernamehere](https://codegolf.stackexchange.com/a/77524/25180), [A000959](http://oeis.org/A000959)
Code:
```
for($s=range(1,303);$i<($t=count($s));$s=array_merge($s))for($j=($k=++$i==1?2:$s[$i-1])-1;$j<$t;$j+=$k )unset($s[$j]);echo$s[$argv[1]-1];
```
Output:
```
a(3)  =   7
a(7)  =  21
a(23) =  99
```
[Answer]
## 05AB1E, [10 bytes, George Gibson](https://codegolf.stackexchange.com/a/79936/47066), [A003215](http://oeis.org/A003215)
**Code:**
```
Ds3*s1+*1+
```
**Explanation:**
Computes 3\*n\*(n+1)+1 which is the oeis sequence A003215.
[Answer]
# [Element](https://github.com/PhiNotPi/Element), [10 bytes](https://codegolf.stackexchange.com/a/77430/48934), [PhiNotPi](https://codegolf.stackexchange.com/users/2867/phinotpi), [A097547](http://oeis.org/A097547)
```
2_4:/2@^^`
```
[Try it online!](http://element.tryitonline.net/#code=Ml80Oi8yQF5eYA&input=NA)
## Output
```
a(3) = 6561
a(4) = 4294967296
```
[Answer]
# Pyke, [6 bytes](https://codegolf.stackexchange.com/a/77476), [muddyfish](https://codegolf.stackexchange.com/users/32686/muddyfish), [A005563](http://oeis.org/A005563)
```
0QhXts
```
Yay hacks! The `0Qh` and `s` are no-ops. `hXt` just computes `(n + 1) ^ 2 - 1`.
[Answer]
# J, [8 bytes, Kenny Lau](https://codegolf.stackexchange.com/a/77506/25180), [A057427](https://oeis.org/A057427)
Code:
```
(-%- )\.
```
Output:
```
a(0) = 0
a(1..29) = 1
```
I don't think this is intended. And I don't know why J had this behavior. But it works.
[Answer]
# [Pyth](https://github.com/isaacg1/pyth), [70 bytes, FliiFe](https://codegolf.stackexchange.com/a/77528/34388), [A070650](https://oeis.org/A070650)
Code (with obfuscated version below):
```
DhbI|qb"#"qb"#"R!1Iqb"#";=^Q6+""s ]%Q27  ;.qlY+Q1Ih+""Z##;.q)=Z+Z1;@YQ
DhbI|qb"#"qb"#"R!1Iqb"#"#####+""s####2###;##lY+Q1Ih+""Z#####)=Z+Z1;@YQ (obfuscated)
```
This basically does:
```
=^Q6%Q27
```
It calculates **a(n) = n6 % 27**, which is [A070650](https://oeis.org/A070650). Explanation:
```
=^Q6       # Assign Q to Q ** 6
    %Q27   # Compute Q % 27
           # Implicit output
```
[Try it here](https://pyth.herokuapp.com/?code=DhbI%7Cqb%22%23%22qb%22%23%22R%211Iqb%22%23%22%3B%3D%5EQ6%2B%22%22s+%5D%25Q27++%3B.qlY%2BQ1Ih%2B%22%22Z%23%23%3B.q%29%3DZ%2BZ1%3B%40YQ&input=2&test_suite=1&test_suite_input=2%0A4&debug=0)
[Answer]
## Python, 108, [CAD97](https://codegolf.stackexchange.com/a/77534/38368), [A005132](https://oeis.org/A005132)
```
def a(n):
 if n == 0: return 0
 f=a(n-1)-n
 return f if f>0 and not f in(a(i)for i in range(n))else a(n-1)+n
```
Obfuscated code : 
```
def a(n):
 ###n####0######n#0
 f=a#######
 return f #f#####a###### f ####a(##f###i#i###a####n##else a#######
```
Outputs: 
```
>>> a(0)
0
>>> a(4)
2
>>> a(16)
8
>>> a(20)
42
```
]