g | x | w | all
Bytes Lang Time Link
049AWK250910T140442Zxrs
051Javascript160527T104310Zuser9023
058Zsh*230126T055254Zroblogic
047JavaScript230125T235546ZEzioMerc
018Thunno230125T184955ZThe Thon
055Arturo230125T192826Zchunes
033Scratch160524T165228Zweatherm
052Python 3201113T094029ZJitse
014MathGolf201113T103626ZKevin Cr
067PHP170908T223851Zhalfmang
033Emotinomicon 99 bytes160526T191230ZBál
060PHP170531T111516ZJör
059Axiom170531T062702Zuser5898
027Cheddar160524T050621ZDowngoat
080Java160524T125754Zuser9023
129C++0x160524T233621ZInitiali
369MarioLANG160524T105202ZEther Fr
085Java160524T012248Zuser8397
021CJam160527T164449ZThe_Bass
037Desmos160526T181400Zweatherm
033Dyalog APL160526T075258ZAdá
051Mathematica160525T165158ZLLlAMnYP
011Pyke160524T125853ZBlue
017Jolf160524T224449ZConor O&
075Java 8 lambda160524T112048ZFrozn
01505AB1E160524T084634ZAdnan
020Pyth160524T163217ZRK.
064Java160524T143558ZMarv
nanMathcad160524T134201ZStuart B
046Erlang160524T100023ZDominik
014MATL160524T002603ZDavid
080Erlang160524T080536Zfxk8y
021Actually160524T044001Zuser4594
052Lua160524T070603ZKatenkyo
045Python 3160524T062328ZByte Com
021Mathematica160524T012746ZMaltysen

AWK, 49 bytes

$0=$0FS int($0*4/3+.5)FS (x=int($0*8/9+.5))FS x+1

Attempt This Online!

Javascript, 51 bytes

I convert my java solution to JavaScript and skimmed it down little bit.

var r=Math.round,g=a=>[a,a=r(a+a/3),a=r(a*2/3),++a]

Zsh*, 58 bytes

r()<<<${$(($1+.5))%.*}
r $1;r $[_+_/3];r $[2*_/3];r $[_+1]

Try it online!

(*) Using force_float and extendedglob options.

JavaScript, 47 bytes

(a,r=Math.round)=>[a,a=r(a*4/3),a=r(a*2/3),++a]

Try it:

f=(a,r=Math.round)=>[a,a=r(a*4/3),a=r(a*2/3),++a]

console.log(JSON.stringify(f(9)));
console.log(JSON.stringify(f(8)));
console.log(JSON.stringify(f(6)));
console.log(JSON.stringify(f(23)));
console.log(JSON.stringify(f(159)));

Thunno, 18 chars

D4*3/D2*3/D1+ZMrZv

Attempt This Online!

(This is actually a bit less in bytes but the challenge asks for chars, not bytes.)

This is a full program since Thunno doesn't have functions.

Explanation

D4*3/D2*3/D1+ZMrZv  # Implicit input
D                   # Duplicate
 4*3/               # Push x*(4/3)
     D              # Duplicate
      2*3/          # Push y*(2/3)
          D         # Duplicate
           1+       # Push z+1
             ZMr    # Push the stack
                Zv  # Round each number
                    # Implicit output

Arturo, 55 bytes

$[x][map@[x,y:round x+x//3y,1+dup round 2*y//3]=>floor]

Try it

Scratch, 33 bytes

Script
(source: cubeupload.com)

Asks for input, sets a to input rounded, sets b and c to their respective changes, then says all four numbers, seperated by commas.

Python 3, 52 bytes

f=lambda n,i=4:1//i*[n+1]or[n]+f(round(i*n/3),i%3+1)

Try it online!

Contrary to the previous Python answer, this one rounds in between cycles.

Every next value can be calculated using i*n/3, where n is the current value and i is taken from [4,2,3]. To complete the sequence, 1 is added to the result of the final iteration.

MathGolf, 14 bytes

3/+_∞3/_)Γ2∩+i

Try it online.

Explanation:

3/             # Divide the (implicit) input by 3
  +            # Add it to the (implicit) input
   _           # Duplicate this
    ∞          # Double the copy
     3/        # Divide it by 3
       _       # Duplicate this
        )      # Increase the copy by 1
         Γ     # Wrap four values into a list (since the stack only contains three, it
               # will use the implicit input as fourth):
          2∩+  # Add 1/2 to each
             i # And cast each float to an integer, removing any decimal values
               # [int(i+1/2),int(i+i/3+1/2),int((i+i/3)*2/3+1/2),int((i+i/3)*2/3+1+1/2)]
               # (after which the entire stack joined together is output implicitly)

PHP, 67 bytes

function f($x){return [$x,$y=round($x*4/3),$z=round($y*2/3),$z+1];}

Emotinomicon 99 bytes, 33 characters

😷😭,😲🆙🆙😼🆙😨😎⏬😎🆙😍➗➕🆙😨😎⏬😎😉✖😍➗🆙😨😎⏬😎😅➕😨

Explanation:

😷                                 clear output
 😭                                begin quote string
  ,                               
   😲                              end quote string
    🆙                             duplicate top of stack
     🆙                            duplicate top of stack
      😼                           take numeric input
       🆙                          duplicate top of stack
        😨                         pop N and output as a number
         😎                        reverse stack
          ⏬                       pops and outputs top of stack as character
           😎                      reverse stack
            🆙                     duplicate top of stack
             😍                    push 3 to the stack
              ➗                   divide top two elements on stack
               ➕                  add top two elements on stack
                🆙                 duplicate top of stack
                 😨                pop N and output as a number
                  😎               reverse stack
                   ⏬              pops and outputs top of stack as character
                    😎             reverse stack
                     😉            push 2 to the stack
                      ✖           multiply top two elements on stack
                       😍          push 3 to the stack
                        ➗         divide top two elements on stack
                         🆙        duplicate top of stack
                          😨       pop N and output as a number
                           😎      reverse stack
                            ⏬     pops and outputs top of stack as character
                             😎    reverse stack
                              😅   push 1 to the stack
                               ➕  add top two elements on stack
                                😨 pop N and output as a number

PHP, 60 Bytes

print_r([$a=$argn,$b=round($a+$a/3),$c=round($b*2/3),$c+1]);

Try it online!

Axiom, 59 bytes

g(x)==round(x)::INT;f(x)==[x,a:=g(x+x/3.),b:=g(a*2./3),b+1]

test

(3) -> [[i,f(i)] for i in [9,8,6,23,159]]
   (3)
   [[9,[9,12,8,9]], [8,[8,11,7,8]], [6,[6,8,5,6]], [23,[23,31,21,22]],
    [159,[159,212,141,142]]]
                                                      Type: List List Any

Cheddar, 27 bytes

b=8/9*$0
[$0,$0+$0/3,b,b+1]

$0 is variable with input. Cheddar just isn't a golfy language ¯\_(ツ)_/¯ , also this is non-competing because Cheddar's input functionality was made after this challenge.

Ungolfed:

IterationB := 8 / 9 * $0  // 8/9ths of the Input
[ $0,                     // The input
  $0 + $0 / 3,            // Input + (Input/3)
  IterationB,             // (see above)
  IterationB + 1          // above + 1
]

Java, 56 80 Bytes

As some users pointed out, this solution (as some others in java) does not round data properly. So now I'm presenting slightly longer solution which should return correct result

int[]h(int a){int[]b={a,Math.round(a+a/3f),a=Math.round(a*8f/9),++a};return b;}

or 60 bytes lamda version

a->new int[]{a,Math.round(a+a/3f),a=Math.round(a*8f/9),++a}

Golfed version

int[]g(int a){int[]b={a,a+a/3,a*8/9,a*8/9+1};return b;}

and ungolfed

int[] g(int a) {
        int[] b = { a, a + a / 3, a * 8 / 9, a * 8 / 9 + 1 };
        return b;
    }

or 36 bytes defined as lambda

a->new int[]{a,a+a/3,a*8/9,a*8/9+1}

C++0x - 95 102 185 189 109 129 chars

int * n(int p){static int a[3];a[0]=p;a[1]=round(p+(p/3));a[2]=round((a[1]/3)*2);a[3]=a[2]+1;return a;}

Degolfed

#include <cmath>
int * ninePattern(int p) {
        static int a[3]; // pattern array
        a[0] = p; // sets first iteration
        a[1] = round(p + (p / 3)); // sets second iteration
        a[2] = round((a[1] / 3) * 2); // sets third iteration
        a[3] = a[2] + 1; // sets fourth iteration
        return a; // returns array
}

MarioLANG, 659 621 591 582 556 543 516 458 418 401 352 308 369 bytes

rounding is quite expensive :/

Try it online

;>>[![( [( [( [( [( [<(([!)))!+(((-<>( >((+
:"==#================"===#== #=====""[ "==
)(  -[!)>>[![)  [)[<(!>)[<)) >))) [!!-[!((
 (  )"#="==#======="=#==="=<="=====##==#==<
 +  +>) )-+<>+)[!)+! +))![-[)>[ [([-[![<<:
 +  )-+ )(=""===#==#  ==#===)"=======#=====
 +  >!>)!>  !(- < !:+:))<  ))!((++)))< 
 )  "#"=#===#===" ======" ===#======="
 !
=#========================

Well this was more fun than expected, this is probably not optimal but I guess i'm getting there.

Explanation time:

(for the 352 bytes version)

first we get the argument and print it :

;
:

simple enough

we then move to the bulk of the program : the division input / 3

;>>[![              [( [( [<result
:"==#======================"======
)   -[!)>>[![        [<((((!   
)   )"#="==#=========="====#
+(  +>) )  +>(+)[!)+))!
+(  )-+ )  -"====#====#
+   >!>)!  >! -  <
    "#"=#  "#===="
 !
=#

which is a slightly modified conversion of the brainfuck division

[->+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]

which take for input

n 0 d 0 0 

and give you back

0 n d-n%d n%d n/d 

once we got the division we use it to get the sum of n and n/d and print it

;>>[![              [( [( [<    !+(((-<
:"==#======================"===)#====="
)   -[!)>>[![        [<((((!    >))) [!(((
)   )"#="==#=========="====#   ="=====#==:
+(  +>) )  +>(+)[!)+))!
+(  )-+ )  -"====#====#
+   >!>)!  >! -  <
    "#"=#  "#===="
 !
=#

we then need to do another division : ( 2 * ( n + n / d ) ) / 3

so we get ( 2 * ( n + n / d )

;>>[![              [( [( [<    !+(((-<
:"==#======================"===)#====="
)   -[!)>>[![        [<((((!    >))) [!(((
)   )"#="==#=========="====#   ="=====#==:
+(  +>) )  +>(+)[!)+))! 2*2n/d>[   -[![  <
+(  )-+ )  -"====#====# ======"======#====
+   >!>)!  >! -  <            !((++))<
    "#"=#  "#===="            #======"
 !
=#

and put it with 3 back into the division

;>>[![              [( [( [<    !+(((-<
:"==#======================"===)#====="
)   -[!)>>[![        [<((((!    >))) [!(((
)   )"#="==#=========="====#   ="=====#==:
+(  +>) )  +>(+)[!)+))!      )>[   -[![  <
+(  )-+ )  -"====#====#      )"======#====
+   >!>)!  >! -  <       +++))!((++))<
    "#"=#  "#====" ===========#======"
 !
=#=================

at that point everything explose, mario is stuck in an infinite loop doing division on bigger and bigger number, forever.

and to fix that we need a way to diferenciate between the first and the second division, it end up that, oh joy, we do have a way

;>>[![              [( [( [<([!)!+(((-<
:"==#======================"==#)#====="
)   -[!)>>[![        [<((((!))< >))) [!(((
)   )"#="==#=========="====#)="="=====#==:
+(  +>) )  +>(+)[!)+))!!:+:)))>[   -[![  <
+(  )-+ )  -"====#====#======)"======#====
+   >!>)!  >! -  <       +++))!((++))<
    "#"=#  "#====" ===========#======"
 !
=#=================

basically we look if the x in

x 0 n d-n%d n%d n/d 

is 0, if it is it mean we are on the first division

else we are on the second division, and we just print the result of the division, add 1 then print it again

and voilà easy as pie.

Java, 86 82 84 85 characters

class c{int[]i(int I){int a=I+(I/3),b=(int)(a*(2d/3d));return new int[]{I,a,b,b+1};}}

The letter d placed right after an integer makes the integer a double.

Ungolfed:

class c{
    int[] i(int I) {
        int a = I + (I / 3),
            b = (int)(a * (2d / 3d));
        return new int[]{I, a, b, b + 1};
    }
}

Without the class (class c{} is 8 chars long), it downsizes to 76 characters:

int[]i(int I){int a=I+(I/3),b=(int)(a*(2d/3d));return new int[]{I,a,b,b+1};}

More accurate version in 110 chars (118 with the enum) - it uses floats because ain't nobody got space for casting Math#round(double):

int[]i(int I){float a=I+(I/3f),b=(a*(2f/3f));return new int[]{I,Math.round(a),Math.round(b),Math.round(b+1)};}

CJam, 21 bytes

qi__3d/+mo_2d3/*i_)]`

Feedback is welcome

Explanation

Edit: Forgot to make the first three a double, so the program was broken. Fixed.

Desmos, 37 bytes

a=9
b=a+\frac{a}{3}
c=\frac{2}{3}b
d=c+1

Try it online
Yay for unconventional languages!

Dyalog APL, 33 bytes

(⌽,{1+⊃⍵})∘{⍵,⍨3÷⍨2×⊃⍵}(3÷⍨4∘×),⊢

Mathematica, 51 bytes

FoldList[#2@#&,{#,Round[4#/3]&,Round[2#/3]&,#+1&}]&

Anonymous function that conforms to the current (at time of posting) version of post, which implies rounding at every step.

FoldList is a typical operation in programming. It is invoked as FoldList[f, list] and applies the two-argument function f repeatedly to the result (or the first element of the list in the first iteration), taking the next element of the list as its second argument.

Ungolfed: #2 @ # & is an anonymous functions that applies its second argument to the first. Therefore, the list argument of FoldList consists of the successive functions to be applied to the input.

FoldList[#2 @ # &,
  {#, (* note the absence of '&' here, 
         this '#' stands for the argument
         of the complete function and is 
         covered by the & at the end      *)
   Round[4 # / 3] &, (* anonymous function that rounds 4/3 of its input *)
   Round[2 # / 3] &, (* ditto, 2/3 *)
   # + 1 &           (* add one function *)
  }] &               (* and the '&' makes the entire 
                        thing an anonymous function,
                        whose argument is the '#' up
                        at the top.                  *)

Because input is integer and the divisions are by 3, there will never be a result like 4.5, therefore there's no need to worry about rules of rounding when the last digit is a 5: it will always be clearly closer to one integer, or another.

Pyke, 11 bytes

D}[}3/bD)[h

Try it here!

            - implicit input()
D           - a,b = ^
 }          - b*=2
  [}3/bD)   - macro:
   }        -   tos*=2
    3/      -   tos/=3
      b     -   tos = round(tos)
       D    -   old_tos = tos = tos
            - macro
         [  - macro
          h - d +=1

Jolf, 17 bytes

Ώ‘Hγ+H/H3Βώ/γ3hΒ’

Defines a function Ώ. It takes input implicitly, so it also doubles as a full program. Try it here!

Java 8 lambda, 109 81 79 75 characters

Because... you know... even Java can be golfed...

a->{int b=(int)(.5+a*4./3),c=(int)(.5+b*2./3);return new int[]{a,b,c,++c};}

Lambda ungolfed into class:

class C {  
   static int[] a(int a) {
        int b = (int) (.5 + a * 4. / 3),
            c = (int) (.5 + b * 2. / 3);
        return new int[]{a, b, c, ++c};
    }
}

I assume I'm allowed to use longs as they are also an integer type. Sadly one needs to correctly round integers and thus a "short" cast doesn't work. By using longs we don't need to cast the rounding results back to ints.

Update

Using the nice little + 0.5 and casting afterwards trick we keep the correct rounding and save 2 chars!

Also this trick doesn't require the use of long any longer thus we can switch back to ints shaving of 4 more chars.

05AB1E, 15 bytes

Code:

Ð3/+D·3/D>)1;+ï

Uses CP-1252 encoding. Try it online!.

Pyth, 20 bytes

m.RdZ[Jc*4Q3Kc*2J3hK

Explanation:

            (Implicit print)
m           For each d in array, d =
.RdZ        Round d to zero decimal places
[           The array of
  J         The result of setting J to
    c       The float division of
      *4Q   Input * 4
      3     and 3
            ,
  K         The result of setting K to
    c       The float division of
      *2J   J * 2
      3     and 3
            , and
  hK        K + 1.
            (Implicit end array)

Test here

Java, 64 bytes

int[]f(int i){return new int[]{i,i+=i/3+0.5,i-=i/3-0.5,i+=1.5};}

Notes

Ungolfed

int[] f(int i) {
    return new int[]{
            i, 
            i += i / 3 + 0.5, 
            i -= i / 3 - 0.5, 
            i += 1.5};
}

Output with i=9

[9, 12, 8, 9]

Mathcad, [tbd] bytes

enter image description here


Mathcad codegolf byte equivalance is yet to be determined. Taking a keyboard count as a rough equivalent, the solution is approx 40 bytes.

Erlang, 46 bytes

Answer inspired by @fxk8y (I couldn't post a comment to his answer)

F=fun(X)->Z=round(X*4/9),[X,Z*3,Z*2,Z*2+1]end.

Also you can see the results with:

2> io:fwrite("~w~n", [F(9)]).                         
[9,12,8,9]
ok

MATL, 14 bytes

Xot4*3/tE3/tQv

Try it Online

Pretty simple, v concatenates the stack into an array. Xo converts to an integer data-type, and all operations thereafter are integer operations.

Erlang, 80 bytes

-module(f).
-export([f/1]).
f(X)->Y=X+(X/3),Z=trunc(Y*(2/3)),[X,trunc(Y),Z,Z+1].

To run, save as f.erl, compile and call the function. It will return a list of ints:

fxk8y@fxk8y:/home/fxk8y/Dokumente/erlang/pcg# erl
Erlang/OTP 18 [erts-7.0] [source] [64-bit] [smp:4:4] [async-    threads:10] [kernel-poll:false]

Eshell V7.0  (abort with ^G)
1> c(f).
{ok,f}
2> f:f(9).
"\t\f\b\t"
3>

Note that Erlang automatically converts ints to ASCII chars if you are in the ASCII value range because Erlang doesn't have a char type. Calling the function with 100 gives you the better readable [100,133,88,89].

Ungolfed:

-module(f).
-export([f/1]).

f(X) ->
  Y = X+(X/3),
  Z = trunc(Y*(2/3)),
  [X, trunc(Y), Z, Z+1].

Actually, 21 bytes

`;;3@/+;32/*;uk1½+♂≈`

This program declares a function that performs the required operations on the top stack value.

Try it online! (the extra . at the end evaluates the function and prints the result)

Explanation:

`;;3@/+;32/*;uk1½+♂≈`
 ;;                    make two copies of x
   3@/+                divide by 3, add that to x to get y
       ;32/*           make a copy of y and multiply by 2/3 to get z
            ;u         make a copy of z and add one
              k        push stack as a list
               1½+     add 0.5 to each element
                  ♂≈   apply int() to each element (make integers from floats by flooring; this is equivalent to rounding half-up because of adding 0.5)
      

Lua, 52 Bytes

This program takes a number by command-line argument and return the corresponding array. Programs in lua are technically functions, as the interpreter will always encapsulate them in a function. This is also this mechanic that is used when you "call" codes in other files (it basically uses loadfile/dofile).

m=math.floor x=...z=m(x*8/9)return{x,m(x*4/3),z,z+1}

Python 3, 45 bytes

f=lambda i:map(round,[i,i*4/3,i*8/9,i*8/9+1])

See this code running on ideone.com

Mathematica - 21 bytes

Just got Mathematica from my brothers RPi, so trying it out for fun, and what better way than a PPCG challenge.

{#,4#/3,8#/9,8#/9+1}&

Defines an anonymous function. Try it out like:

In[26]:= x:={#,4#/3,8#/9,8#/9+1}&                                             

In[27]:= x[9]                                                                 

Out[27]= {9, 12, 8, 9}