text:
Formerly Composite Numbers
Sequence Definition
Construct a sequence of positive integers a(n) as follows:

a(0) = 4
Each term a(n), other than the first, is the smallest number that satisfies the following:
a) a(n) is a composite number,
b) a(n) > a(n-1), and
c) a(n) + a(k) + 1 is a composite number for each 0 <= k < n.

So we start with a(0) = 4. The next entry, a(1) must be 9. It can't be 5 or 7 since those aren't composite, and it can't be 6 or 8 because 6+4+1=11 is not composite and 8+4+1=13 is not composite. Finally, 9+4+1=14, which is composite, so a(1) = 9.
The next entry, a(2) must be 10, since it's the smallest number larger than 9 with 10+9+1=20 and 10+4+1=15 both composite.
For the next entry, 11 and 13 are both out because they're not composite. 12 is out because 12+4+1=17 which is not composite. 14 is out because 14+4+1=19 which is not composite. Thus, 15 is the next term of the sequence because 15 is composite and 15+4+1=20, 15+9+1=25, and 15+10+1=26 are all each composite, so a(3) = 15.
Here are the first 30 terms in this sequence:
4, 9, 10, 15, 16, 22, 28, 34, 35, 39, 40, 46, 52, 58, 64, 70, 75, 76, 82, 88, 94, 100, 106, 112, 118, 119, 124, 125, 130, 136

This is OEIS A133764.
Challenge
Given an input integer n, output the nth term in this sequence.
Rules

You can choose either 0- or 1-based indexing. Please state which in your submission.
The input and output can be assumed to fit in your language's native integer type.
The input and output can be given by any convenient method.
Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
Standard loopholes are forbidden.
This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.

Title: The number formerly known as composite.

@MagicOctopusUrn If this had something to do with art or music, I'd go with it. But, I'll stick with the title I currently have.

Was more of a joke ;).

Husk, 11 bytes
!üȯṗ→+fotpN

1-indexed.
Try it online!
Explanation
!üȯṗ→+fotpN  Implicit input, a number n.
          N  The list of positive integers [1,2,3,4,..
      f      Keep those
         p   whose list of prime factors
       ot    has a nonempty tail: [4,6,8,9,10,12,..
 ü           De-duplicate wrt this equality predicate:
     +       sum
    →        plus 1
  ȯṗ         is a prime number.
             Result is [4,9,10,15,16,..
!            Get n'th element.

JavaScript (ES6), 83 bytes
1-indexed
f=(n,a=[-1,p=4])=>a[n]||f(n,a.some(x=>(P=n=>n%--x?P(n):x<2)(x-=~p),p++)?a:[...a,p])

Demo

f=(n,a=[-1,p=4])=>a[n]||f(n,a.some(x=>(P=n=>n%--x?P(n):x<2)(x-=~p),p++)?a:[...a,p])

for(n = 1; n <= 30; n++) {
  console.log('a(' + n + ') = ' + f(n))
}

Commented
Helper function P(), returning true if n is prime, or false otherwise:
P = n => n % --x ? P(n) : x < 2

NB: It must be called with x = n.
Main function f():
f = (               // given:
  n,                //   n = target index
  a = [-1, p = 4]   //   a = computed sequence with an extra -1 at the beginning
) =>                //   p = last appended value
  a[n] ||           // if a[n] exists, stop recursion and return it
  f(                // otherwise, do a recursive call to f() with:
    n,              //   n unchanged
    a.some(x =>     //   for each value x in a[]:
      P(x -= ~p),   //     rule c: check whether x + p + 1 is prime
                    //     rule a: because a[0] = -1, this will first compute P(p)
      p++           //     rule b: increment p before the some() loop starts
    ) ?             //   end of some(); if truthy:
      a             //     p is invalid: use a[] unchanged
    :               //   else:
      [...a, p]     //     p is valid: append it to a[]
  )                 // end of recursive call

Perl 6, 70 bytes
{(4,->+_{first {none($^a X+0,|(_ X+1)).is-prime},_.tail^..*}...*)[$_]}

Try it 0-indexed
Expanded:
{  # bare block lambda with implicit parameter $_

  (  # generate the sequence

    4, # seed the sequence

    -> +_ { # pointy block that has a slurpy list parameter _ (all previous values)

      first

      {  # bare block with placeholder parameter $a

        none(                 # none junction
            $^a               # placeholder parameter for this inner block
          X+
            0,                # make sure $a isn't prime
            |( _ X+ 1 )       # check all a(k)+1
        ).is-prime            # make sure none are prime
      },

      _.tail ^.. *            # start looking after the previous value
    }

    ...                       # keep generating values until

    *                         # never stop

  )[$_]                       # index into the sequence
}

Python 2, 112 107 bytes
thanks to Mr. Xcoder for a byte.
n=-1,4;v=5
exec"while any(all((v-~k)%i for i in range(2,v))for k in n):v+=1\nn+=v,;v+=1\n"*input()
print~-v

Try it online!

Python 2, 115 109 bytes
n=-1,4;v=4;x=input()
while x:v+=1;k=1^any(all((v-~k)%i for i in range(2,v))for k in n);n+=(v,)*k;x-=k
print v

Try it online!

05AB1E, 21 bytes
0-indexed
®4Iµ)˜D¤N‹sN+>p_P*iN¼

Try it online!

C (gcc),  140  138 bytes
Thanks to @Jonathan Frech for saving two bytes!
c(n,i){for(i=1;++i<n;)i=n%i?i:n;i=i>n;}f(n){int s[n],k,j,i=0;for(*s=k=4;i++-n;i[s]=k)for(j=!++k;j-i;)2-c(k)-c(k-~s[j++])?j=!++k:f;n=n[s];}

0-indexed
Try it online!

++k,j=0 can twice be j=!++k, 138 bytes.

Ruby + -rprime, 85 75 bytes
->n{*a=x=4
n.times{x+=1;!x.prime?&&a.none?{|k|(x+k+1).prime?}?a<<x:redo}
x}

Try it online!
A lambda returning the 0-indexed nth element.
-10 bytes: Use redo and a ternary operator instead of loop...break and a conditional chain
Ungolfed:
->n{
  *a=x=4                         # x is the most recent value: 4
                                 # a is the list of values so far: [4]
  n.times{                       # Repeat n times:
    x += 1                       # Increment x
    !x.prime? &&                 # If x is composite, and
      a.none?{|k|(x+k+1).prime?} #   for all k, a(n)+x+1 is composite,
      ? a<<x                     # Add x to a
      : redo                     # Else, restart the block (go to x+=1)
  }
  x                              # Return the most recent value
}

Wolfram Language (Mathematica), 65 bytes
±0=-1;±1=4;±n_:=±(n-1)+1//.a_/;PrimeQ/@Array[a+1+±#&,n,0,Or]:>a+1

Uses CP-1252 (default Windows) encoding. 1-indexed.
Try it online!

Java 8, 186 173 bytes
n->{int a[]=new int[n+1],r=a[n]=4;a:for(;n>0;)if(c(++r)<2){for(int x:a)if(x>0&c(r-~x)>1)continue a;a[--n]=r;}return r;}int c(int n){for(int i=2;i<n;n=n%i++<1?0:n);return n;}

0-indexed.
Unfortunately prime-checks (or anti-prime/composite checks in this case) aren't that cheap in Java..
Explanation:
Try it online.
n->{                     // Method with integer as both parameter and return-type
  int a[]=new int[n+1],  //  Integer-array of size `n+1`
      r=a[n]=4;          //  Start the result and last item at 4
  a:for(;n>0;)           //  Loop as long as `n` is larger than 0
    if(c(++r)<2){        //   Raise `r` by 1, and if it's a composite:
      for(int x:a)       //    Inner loop over the array
        if(x>0           //     If the item in the array is filled in (non-zero),
           &c(r-~x)>1)   //     and if `r+x+1` is a prime (not a composite number):
          continue a;}   //      Continue the outer loop
      a[--n]=r;}         //    Decrease `n` by 1, and put `r` in the array
  return r;}             //  Return the result

// Separated method to check if a given number is a composite number
// (It's a composite number if 0 or 1 is returned, otherwise it's a prime.)
int c(int n){for(int i=2;i<n;n=n%i++<1?0:n);return n;}

C (gcc), 170 bytes
P(n,d,b){for(b=d=n>1;++d<n;)b=b&&n%d;n=b;}h(n,N,b,k){if(!n)return 4;for(b=N=h(n-1);b;)for(b=k=!N++;k<n;b|=P(h(k++)-~N));n=N;}f(n,j){for(j=0;n--;)if(P(h(++j)))j++;n=h(j);}

Try it online!


text:
Is there a bump?
Given a list of positive integers determine if there is an element that is either greater than its two neighbors or less than its two neighbors (a "bump").  To be clear a bump can never be the first or last item of the list because they only have one neighbor.
Your program should output one of two consistent values each corresponding to either a list with no bumps or a list with bumps.  What the values are is unimportant you may choose them yourself.
This is code-golf so answers will be scored in bytes with fewer bytes being better.
Test cases
[] -> False
[1] -> False
[1,2] -> False
[1,2,1] -> True
[1,2,2] -> False
[1,2,3] -> False
[1,2,2,1] -> False
[1,2,2,3] -> False
[1,2,1,2] -> True
[1,3,2] -> True
[3,1,2] -> True
[2,2,2] -> False

Test Case Request: Numbers other than 0-1-2-3, also negatives allowed/disallowed?

Suggested test case: [1,3,3] (ensures that answers using Dennis's algorithm take the sign of the increments rather than just using the increments themselves)

@ETHproductions Isn't that already covered by [1,2,2]? Or am I missing something?

@NicHartley, the deltas of [1,2,2] are the same as the signs of those deltas but that's not the case with [1,3,3].

Jelly, 5 bytes
IṠIỊẠ

Returns 0 if there's a bump, 1 if not.
Try it online!
How it works
IṠIỊẠ  Main link. Argument: A (integer array)

I      Increments; take all forward differences of A.
 Ṡ     Take the signs.
       The signs indicate whether the array is increasing (1), decreasing (-1), or
       constant at the corresponding point. A 1 followed by a -1 indicates a local
       maximum, a -1 followed by a 1 a local minimum.
  I    Increments; take the forward differences again.
       Note that 1 - (-1) = 2 and (-1) - 1 = -2. All other seven combinations of
       signs map to -1, 0, or 1.
   Ị   Insignificant; map each difference d to (-1 ≤ d ≤ 1).
    Ạ  All; return 1 if all differences are insignificant, 0 if not.

What is "Increments?".  What is being incremented and what does that do?

@WheatWizard I think that this is the equivalent of 05AB1E's deltas (¥) command: an array [n0, n1, n2, n3] is poped and the array [n1-n0, n2-n1, n3-n2] is pushed.

JavaScript (ES6), 38 bytes
Returns a boolean.
a=>a.some(x=n=>x*(x=a<n|-(a>(a=n)))<0)

Test cases

let f =

a=>a.some(x=n=>x*(x=a<n|-(a>(a=n)))<0)

console.log(f([]))              // False
console.log(f([1]))             // False
console.log(f([1,2]))           // False
console.log(f([1,2,1]))         // True
console.log(f([1,2,2]))         // False
console.log(f([1,2,3]))         // False
console.log(f([1,2,2,1]))       // False
console.log(f([1,2,2,3]))       // False
console.log(f([1,2,1,2]))       // True
console.log(f([1,3,2]))         // True
console.log(f([2,0,1]))         // True
console.log(f([2,2,2]))         // False
console.log(f([-4,100000,89]))  // True

How?
We use a to store the previous value of n. We set x to 1 if a < n, -1 if a > n or 0 if a = n. And we test whether old_x * x < 0, which is only possible if (old_x = 1 and x = -1) or (old_x = -1 and x = 1).
Because x is initialized to the anonymous callback function of some(), it is coerced to NaN during the first iteration, which makes the test falsy.

This will throw in strict mode.

@AluanHaddad Well, 99% of JS golfed code will throw in strict mode just because of undeclared variables. PPCG and codereview doesn't mix well. :P

That's fair, I'm not really much for golf.

Then why comment on it lol

Haskell, 42 bytes
any(<0).f(*).f(-)
f a b=zipWith a b$tail b

Try it online!
Explanation
First we have the function f that takes a binary function and a list and applies the binary function to every adjacent pair in the list.
Then our main function applies f(-) to the input list.  This calculates the difference list.  We then apply f(*) to the list to multiply every adjacent pair.  Lastly we ask if any pair is less than zero.
A number in the end list can only be negative if it is the product of a negative and positive number from the difference list.  Thus in order to produce a negative entry (and then return true) the original list must switch from increasing to decreasing or vice versa, that is it must have a bump.

Nice way to deal with the empty list!

Python 2, 43 bytes
f=lambda x,y,z,*t:0>(y-x)*(z-y)or f(y,z,*t)

Returns True if there's a bump, errors if there isn't. (allowed by default)
Try it online!

Octave with Image Package, 34 32 bytes
2 bytes saved thanks to @StewieGriffin!
@(x)0||prod(im2col(diff(x),2))<0

Try it online!
Explanation
Computes consecutive differences, arranges them in sliding blocks of length 2, obtains the product of each block, and tests if any such product is negative.

0||prod(...) saves 2 bytes. You could also skip the entire any part, and use the default truthy/falsy definition to save 5 bytes.

Darn, saving 5 bytes will make your solution shorter than mine :( Nice use of the image package. I didn't know it was on TIO.

@StewieGriffin Since the challenge requires two consistent values I cannot remove any. Thanks for the 0|| idea!

Haskell, 33 bytes
f(p:r@(c:n:_))=(c-p)*(c-n)>0||f r

Try it online!
True if there's a bump, errors if there's not.

l`zip3`tail l$drop 2l is just a hair shorter. I wonder if pattern matching is somehow even shorter?

Perl 6, 39 bytes
{so~(.[1..*]Zcmp$_)~~/'re L'|'s M'/}

Try it online!
$_ is the list argument to this anonymous function.  .[1..*] is the same list, but with the first element dropped.  Zcmp zips the two lists together with the cmp operator, resulting in a list of Order values.  For example, for an input list 1, 2, 2, 2, 1 this would result in the list More, Same, Same, Less.
Now we just need to know whether that list contains two adjacent elements More, Less or Less, More.  The trick I used is to convert the list to a space-delimited string with ~, then test whether it contains either substring re L or s M.  (The first one can't be just e L because Same also ends with an "e".)
The smart match operator returns either a Match object (if the match succeeded) or Nil (if it didn't), so so converts whatever it is into a boolean value.

You can replace .[1..*] with .skip and the regex with /re.L|s.M/. You can then replace the smartmatch with function composition with o. Also, your byte count is wrong? 28 bytes

R, 48 bytes
function(x)any(apply(embed(diff(x),2),1,prod)<0)

Try it online!
How it works step-by-step using c(1,4,1,4) as example:
> x=c(1,4,1,4)
> diff(x)
[1]  3 -3  3
> embed(diff(x),2)
     [,1] [,2]
[1,]   -3    3
[2,]    3   -3
> apply(embed(diff(x),2),1,prod)
[1] -9 -9
> any(apply(embed(diff(x),2),1,prod)<0)
[1] TRUE

As a bonus, here is a solution of similar length and concept using package zoo:
function(x)any(zoo::rollapply(diff(x),2,prod)<0)

neat! Note to self: remember embed exists. It's too bad that rowProds and colProds doesn't exist as aliases in R.

@Giuseppe out of desperation i actually checked if they existed :) but indeed just rowSums and rowMeans...

well, at least looking through the docs, .colSums will reshape the input into a matrix based on additional inputs which probably has a golfing application somewhere....now I just have to find one!

@Guiseppe: Have a look at the functions in matrixStats package.

@MichaelM Unfortunately because of the length of the package name it doesn't make it competitive (57 bytes: function(x)any(matrixStats::colProds(embed(diff(x),2)))<0). But for anything other than code golf, this package is indeed a treasure trove.

@plannapus: My comment was purely unrelated of playing golf - my bad.

Ruby, 55 46 bytes
->a{a.each_cons(3).any?{|x,y,z|(y-x)*(y-z)>0}}

Try it online!
A lambda accepting an array and returning boolean.
-9 bytes: Replace (x<y&&y>z)||(x>y&&y<z) with (y-x)*(y-z)>0 (thanks to GolfWolf)
->a{
  a.each_cons(3)              # Take each consecutive triplet
    .any?{ |x,y,z|            # Destructure to x, y, z
      (y-x)*(y-z) > 0         # Check if y is a bump
    }
}

I think you can use | instead of ||, saving you 1 byte.

46 bytes

Save 1 byte with '0<(y-x)*y-=z'

Wolfram Language (Mathematica), 40 bytes
MatchQ[{___,x_,y_,z_,___}/;x<y>z||x>y<z]

Try it online!

R, 58 56 bytes
function(x)any(abs(diff(sign(diff(c(NA,x)))))>1,na.rm=T)

Try it online!
Saved 2 bytes thanks to Giuseppe

You can get rid of the braces {} for -2 bytes.

additionally, I think that you can port Stewie Griffin's approach for 42 bytes

@Giuseppe, I think Stewie ported my method, with the difference that mine can properly handle the empty vector as listed in the test cases. Matlab is a bit more lenient with empty vectors compared to R.

c() is NULL which is not the same as the empty vector of integers, integer(0), whereas in MATLAB [] is a double by default, but if you want to keep it this way, that's perfectly reasonable.

Husk, 8 bytes
±V<0Ẋ*Ẋ-

Try it online!
Explanation
±V<0Ẋ*Ẋ-  Implicit input, say [2,5,5,1,4,5,3]
      Ẋ-  Consecutive differences: [3,0,-4,3,1,-2]
    Ẋ*    Consecutive products: [0,0,-12,3,-2]
 V<0      Is any of them negative? Return 1-based index: 3
±         Sign (to make output consistent): 1

J, 16 15 bytes
-1 byte thanks to FrownyFrog
1 e.0>2*/\2-/\]

Try it online!
Original:  16 bytes
0>[:<./2*/\2-/\]

2-/\] - differences of each adjacent items
2*/\  -  products of each adjacent items
[:<./  - the minimum
0>     - is negative?
Try it online!

Hello ! Could this not be shortened to this simpler explicit form  0><./2*/\2-/\ (13 bytes) ?

@Mathias Dolidon This works in the interpreter but here in PPCG it's common to provide a function (J verb) if there is some input. If the verb is tacit one, we don't count the assignment f=. bytes. Please have in mind that I'm relatively new user :)

So am I, and you've clarified the rule for me. Thanks ! :)

1 e.0>2*/\2-/\]

@ FrownyFrog  Thank you! It seems that I rarely use e.  :)

Java 8, 108 104 101 86 84 79 72 bytes
a->{int i=a.length,p=0;for(;i-->1;)i|=p*(p=a[i]-a[i-1])>>-1;return-i>1;}

-2 bytes thanks to @OlivierGrégoire.
-13 bytes thanks to @Nevay.
Try it online.

84 bytes. I changed the iteration order (going down), swapped the two multiplication operands and then could remove a superfluous -1.

79 bytes: a->{int i=a.length;for(;i-->2;)i|=(a[i]-a[--i])*(a[i]-a[i-1])>>-1;return-~i|3;} (returns -1 for truthy cases, 3 for falsey cases) - or, if using the presence/absence of an exception as return value 55 bytes: a->{for(int i=0;++i>0;)i|=(a[i-1]-a[i])*(a[i]-a[i+1]);}

72 bytes: a->{int i=a.length,p=0;for(;i-->1;)i|=p*(p=a[i]-a[i-1])>>-1;return-i>1;}

PostgreSQL 173 bytes
SELECT DISTINCT ON(a)a,x>j and x>k OR x<least(j,k)FROM(SELECT a,x,lag(x,1,x)OVER(w)j,lead(x,1,x)OVER(w)k FROM d WINDOW w AS(PARTITION BY rn ORDER BY xn))d ORDER BY 1,2 DESC;
     a     | c
-----------+---
 {1}       | f
 {1,2}     | f
 {1,2,1}   | t
 {1,2,1,2} | t
 {1,2,2}   | f
 {1,2,2,1} | f
 {1,2,2,3} | f
 {1,2,3}   | f
 {1,3,2}   | t
 {2,2,2}   | f
 {3,1,2}   | t
(11 rows)

Hello and welcome to the site.  I'm not familiar with PostgreSQL but you might be able to reduce the amount of whitespace you use.  In general most languages don't require most of the kinds of spacing you use.

@WheatWizard it's the sample data into the database, it's irrelevant.

What's your code then?  We don't allow the input to be inserted directly into the code instead of the input. If that is the case here you ought to rewrite it so that it takes input via a standard method.

@WheatWizard from the link you provided, https://codegolf.meta.stackexchange.com/a/5341/23085

Ok if that's the input format you are using that's fine then.  Best of luck golfing here,  it's nice to see people golfing in less commonly used languages.

Japt, 11 bytes
-5 bytes thanks to @ETHproductions
ä- mÌäa d>1

Try it online! | Test cases
This uses Dennis's algorithm

Japt, 9 bytes
ä- ä* d<0

Try it online!
A mashup of Oliver's answer with the approach used by several other answers.

Attache, 39 bytes
Any&:&{_*~?Sum[__]}@Slices&2@Sign@Delta

Try it online!
Pretty happy with how this turned out.
Explanation
This is a composition of four functions:
Delta
Sign
Slices&2
Any&:&{_*~?Sum[__]}

Delta gets the differences between elements. =
Then, Sign is applied to each difference, giving us an array of 1s, 0s, and -1s. =
Then, Slices&2 gives all slices of length two from the array, giving all pairs of differences.
Finally, Any&:&{_*~?Sum[__]} is equivalent to, for input x:
Any[&{_*~?Sum[__]}, x]
Any[[el] -> { el[0] and not (el[0] + el[1] = 0) }, x]

This searches for elements which sum to zero but are not zero. If any such pair of elements exist, then there is a bump.

Octave, 33 bytes
@(x)0||abs(diff(sign(diff(x))))>1

Try it online!
Explanation:
@(x)                           % Anonymous function taking x as input
                  diff(x)       % Takes the difference between consecutive elements
             sign(diff(x))      % The sign of the differences
        diff(sign(diff(x)))     % The difference between the signs
    abs(diff(sign(diff(x)))>1   % Check if the absolute value is 2
@(x)abs(diff(sign(diff(x)))>1   % Output as matrices that are treated truthy or falsy

MATL, 8 bytes
dZSd|1>a

Try it online!

05AB1E, 7 bytes
¥ü‚P0‹Z

Try it online!
Explanation
¥         # calculate delta's
 ü‚       # pair each element with the next element
   P      # product of each pair
    0‹    # check each if less than 0
      Z   # max

Wasn't there a 1-byte alternative to 0‹ that basically checks the number for a negative sign?

@MagicOctopusUrn: d used to check that top of stack only contained [0-9], which is the opposite of what we want here. But now it's more intelligent and negative/floats are also counted as numbers.

Ahhhh... coulda sworn a saw the negative sign and returned true or something... But I think you're right, I'm remembering your d trick.

Brachylog, 10 bytes
s₃.¬≤₁∧¬≥₁

Try it online!
Succeeds (true.) if there is a bump, and fails (false.) if there is no bump.
Explanation
This is fairly readable already:
s₃.           There is a substring of the input…
  .¬≤₁        …which is not non-decreasing…
      ∧       …and…
       ¬≥₁    …which is not non-increasing

Brachylog, 10 bytes
s₃s₂ᶠ-ᵐ×<0

Try it online!
Not nearly as neat and elegant as @Fatalize's existing 10 byte answer, but it works!
s₃   % There exists a substring of three elements [I,J,K] in the array such that

s₂ᶠ  % When it's split into pairs [[I,J],[J,K]]

-ᵐ   % And each difference is taken [I-J, J-K]

×    % And those differences are multiplied (I-J)*(J-K)
     % (At a bump, one of those will be negative and the other positive.
     % At other places, both differences will be positive, or both negative,
     %  or one of them 0 - ultimately resulting in a non-negative product.)

<0   % The product is negative

APL (Dyalog), 15 19 20 bytes
2 bytes saved thanks to @EriktheOutgolfer
{2>≢⍵:0⋄2∊|2-/×2-/⍵}

Try it online!
1 for bump, 0 for no bump.

Unfortunately, this gives an error for ⍬, while it should return 0 instead (or throw an error for all falsy inputs).

Oh, and, if you fix the issue, 0∊2> can be 2∊ instead for -2 bytes.

@EriktheOutgolfer temporary quick fix, thanks

Still fails for singleton lists

@H.PWiz A possible fix is to replace ⍬≡ with 2>≢ for just 1 extra byte.

Python 2, 60 bytes
lambda l:any(p>c<n or p<c>n for p,c,n in zip(l,l[1:],l[2:]))

Try it online!
Pretty much the same thing, thought it would be shorter though...
Python 2, 63 bytes
f=lambda l:l[3:]and(l[0]>l[1]<l[2]or l[0]<l[1]>l[2]or f(l[1:]))

Try it online!

58 bytes using multiplication instead

Julia 0.6, 57 56 bytes
l->any(p>c<n||p<c>n for(p,c,n)=zip(l,l[2:end],l[3:end]))

Basically just totallyhuman's python answer. -1 byte from user71546
Try it online!
Julia 0.6, 39 bytes
f(x,y,z,a...)=x>y<z||x<y>z||f(y,z,a...)

Lispy recursion style, aka Dennis's python answer. Returns true when a bump exists, otherwise throws an error. This should maybe be 42 bytes since you have to splat it when calling. Eg for a=[1,2,1] you call as f(a...). f(a)=f(a...) would remove that need, but is longer. I need to get better a recursion, and I don't really like writing code that throws an error.
Try it online!

seems the space after for is not necessary ;)

Husk, 9 bytes
▼mεẊ-Ẋo±-

Try it online!
Uses Dennis's algorithm.

Perl 5, 54  + 2 (-pa) = 56 bytes
map$\|=$F[$_-1]!=(sort{$a-$b}@F[$_-2..$_])[1],2..$#F}{

Try it online!

Pyt, 11 7 bytes
₋ʁ*0<Ʃ±

Outputs 1 if there is a bump, 0 otherwise
Try it online!
Port of Wheat Wizard's Haskell answer

Old way (11 bytes):
₋±₋Å1≤ĐŁ↔Ʃ=

Try it online!
Returns False if there is a bump, True otherwise
Port of Dennis' Jelly answer

Windows Batch, 126 120 114 bytes
I was pretty excited about my first use of the shift command.
This script generally works for numbers within 9 digits(no matter positive or negative.)
:L
@if %3.==. exit/b
@if %2 gtr %1 if %3 lss %2 goto:e
@if %2 lss %1 if %3 gtr %2 goto:e
@shift
@goto:L
:e
@echo T

An empty response might count as a consistent value, otherwise I think you might be able to save a couple of bytes by moving the echo T to the end and jumping to it instead of repeating it. I'm also wondering whether you can save bytes by moving the @shift to the beginning of the loop but I'm not so sure whether that helps.

@Neil Thanks for the if-golf. I don't see any reason moving @shift forward will help save bytes. I will take a look at the possible shift movement anyways.

Wolfram Language (Mathematica), 37 36 bytes
FreeQ[(d=Differences)@Sign@d@#,-2|2]&

Gives the opposite of the test case answers (False and True reversed).  Prepend a ! to switch to the normal form.
OR
Abs@(d=Differences)@Sign@d@#~FreeQ~2&

Also reversed output, so replace FreeQ with MatchQ for normal form.
Explanation: Take the sign of the differences of the sequence.  Iff the resulting sequence includes {1,-1} or {-1,1} there is a bump.  The absolute value the differences of {1,-1} or {-1,1} is 2 in either case.
Shave off another byte by squaring the final list instead of taking the absolute value:
FreeQ[(d=Differences)@Sign@d@#^2,4]&

Try it online!

Perl, 35 bytes
Includes +3 for -p
bump.pl:
#!/usr/bin/perl -p
s%\S+ %$a*1*($a=$&-$')%eg;$_=/-/

Run as:
bump.pl <<< "3 1 2"

C (gcc), 101 97 bytes
r,i;f(a,n)int*a;{for(i=n|1;--i;a[i]-=a[i-1]);for(r=0;--n>0;r=a[n]<0&a[n-1]>0|a[n]>0&a[n-1]<0|r);}

Try it online!
Differences the list, then looks for two neighboring differences that are not zero and have opposite sign.

Welcome to PPCG!

C (gcc), 78 bytes
Variant: loop
r,i;f(a,n)int*a;{for(r=n>2,i=0;i<n-2;)r=(a[i++]-a[i])*(a[i]-a[i+1])<0&&r;i=r;}

Try it online!
Variant: recursive
f(a,n)int*a;{n=(n<3)?0:((a[--n]-a[--n])*(a[n]-a[n-1])<0&&((n<2)?1:f(a,n+1)));}

Try it online!
The criteria is that a[i]-a[i+1] and a[i+1]-a[i+2] are non-zero and have opposite sign. i=r is just a way to return the value (described here).
P. S. Additional two test cases may reveal bugs: { 1, 2, 1, 2, 2 } and { 2, 2, 1, 2, 1 }

Welcome to PPCG!

By the way, I think a[--n]-a[--n] has undefined behaviour and a[i++]-a[i] has unspecified behaviour. Doesn't matter since they seem to work with gcc in this case.

APL (Dyalog Classic), 15 bytes
0∨.>2×/2-/⊃,⊃,⊢

Try it online!

Retina 0.8.2, 43 bytes
.+
$*
1`(1+)1¶\1¶1\1|¶(1+)(?<!\2¶\2)¶(?!\2)

Try it online! Takes input on separate lines and outputs 0 or 1. Explanation:
.+
$*

Convert to unary.
1`            |

Count at most one matching regex.
  (1+)1¶\1¶1\1

Match a number that is surrounded by greater numbers on both sides.
               ¶(1+)(?<!\2¶\2)¶(?!\2)

Match a number that is not surrounded by greater or equal numbers on either side, i.e. both are less.

Python, 91 bytes
def f(a):return[i for i,j in enumerate(a[1:-1])if(j>max(a[i+2],a[i])or j<min(a[i+2],a[i]))]

An empty array is a falsey value, while a populated array is truthy

Perl 6, 50 47 bytes
{?grep {0>(.[1]-.[2])*[-] .[^2]},.rotor(3=>-2)}

Try it online!

GFORTH 71 Bytes
: B ROT 2DUP = -1 = IF DROP ROT = -1 = IF  ELSE ." TRUE " THEN THEN ;

Output:
1 2 1 B TRUE  ok
19 4 19 B TRUE  ok
5 4 6 B  ok

Elm, 102 bytes
f a b=case b of
 c::d::e->a c d::f a(d::e)
 _->[]
a g=case g of
 []->1<0
 i::k->i<0||a k
a<<f(*)<<f(-)

Explanation
This works very similar to my Haskell answer.  Except Elm is missing all of the functions that do stuff so I had to make every thing from the ground up.  You can test it by running the following here
import Html exposing (text)
f a b=case b of
 c::d::e->a c d::f a(d::e)
 _->[]
a g=case g of
 []->1<0
 i::k->i<0||a k
g=a<<f(*)<<f(-)
s x=case x of
 True->"True"
 False->"False"
main=g[1,1,1,1,1,0,1]|>s|>text

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Tips for golfing Yabasic
Yabasic, or Yet Another Basic is a dialect of basic created by Marc-Oliver Ihm that may be run on Windows, Unix and PAL versions of the Sony PlayStation 2. Development for this language is ongoing.

Helpful Resources
Yabasic Official Website
Yabasic Manual
Yabasic Wikipedia Page
Yabasic GitHub
Yabasic PS2 Documentation
Some Yabasic Programs
Try it Online

What general tips do you have for golfing in Yabasic? Any ideas that can be applied to code golf problems in general that are at least somewhat specific to Yabasic. Please post one tip per answer.

Yet Another 'Yet Another' Language

@StanStrum Yeah, there are quite a few members of the 'Yet Another' paradigm

Use Chr$(...) to Print numbers
By default, all numbers printed using Yabasic print with a space following them, and to remove this space while printing characters individually, one may use the formula below.
It is important to note that this only works for printing digits 0 - 9, meaning that this works best for iterating across numbers digit by digit.
...
?Left$(Str$(n),1);
...

Try it online!
However, if the context allows, this can be golfed down to this formula.
...
?Chr$(n+48);
...

Try it online!

You might want to specify that this only works for individual digits.

@HyperNeutrino I've modified the response to include that note - thanks for the Input :)

Use ?n,"",m to print two numbers without spaces
Given two numeric variables n and m, they may be printed directly beside one another (as if concatenated) by formatting the print statement as
?n,"",m

which is significantly shorter than direct concatenation, which would require converting the numeric to a string with something of the form of
?Str$(n)+Str$(m)

Use ? Instead Of Print
Much like many dialects of BASIC, such as VBA and uBasic, Yabasic allows for the use of the ? Character for printing to the console in place of the Print  keyword.
In addition you may use ; to print without any trailing newline or other characters.
Each use of this saves 5 bytes.

Use Fi Instead of EndIf
Much like Bash and other languages, Yabasic has the keyword Fi that allows for the termination of If(...)Then blocks.
Each use of this saves 3 bytes.

Use abbreviated Print At(x,y)"..."
Because yabasic has no string repetition or replacement function built, it is often more efficient to convert an answer to graphics mode and use the Print At() command than to deal with using for loops to determine spacing.
This may be abbreviated as
?@(x,y)"your text"

This may also be combined with the color modifier of the print statement to make statements such as
?Color("Blu")@(x,y)"your text"

it is however noted that use of this command requires that the clear screen command has been called at least one in the solution.
An example of a yabasic solution using the ?@() may be seen here

Use n/0, inf and nan
While not included in the Yabasic Manual (at present), yabasic includes some interesting edge cases for numbers, namely, allowing for division by zero, infinite values and nans.
Division by Zero
n/0

Regardless of the input value the output of the above snippet shall be exactly equivalent to 2^1024. Interestingly, this includes negative inputs, infinite inputs and nan inputs.
Infinity
9^999

If you try to use too large a value, then Yabasic will convert it to inf. As far as I am aware, the above is the shortest snippet that may be used to access inf, as inf may not be called directly. This behaves as expected.
Not a Number
n=9^999
?n-n

If you try to take an infinite number from an infinite number, Yabasic will return nan (not a number).
Try it online!

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Tips for golfing in Visual Basic

This page is not for Visual Basic .NET Tips or VBA tips
Visual Basic (VB or VB6) is an object-oriented and event-driven dialect of basic that was developed and released by Microsoft in 1991. The last release of Visual Basic came as Visual Basic 6.0 in 1998, and the language was declared a legacy language in 2008. Visual Basic .NET replaced Visual Basic in 2002.
All answers on this site that are written in Visual Basic are assumed to be written for Visual Basic 6.0 unless otherwise stated.

Some helpful links

MSDN Visual Basic 6.0 Resource Center

Visual Basic Wiki

You may compile and execute Visual Basic code using Visual Studio Community.
There is no online resource for compiling VB code.

IDK VB, but isn't this just https://codegolf.stackexchange.com/questions/5175/tips-for-golfing-in-vba?rq=1

@Pavel The short answer is no, there are several differences between VB and VBA, including, but not limited to the availability of the certain packages, data types, non-variant arrays, threading and proper graphics in VB that are not available to VBA and version specific tweaks available to VBA - such as the Cells command in Excel VBA. You can find out more about the difference here

consider using the normal [tips] format from other tips questions as the main part of your question (applies also to the other recent tip question)

@Uriel you mention a [tips] format but as far as I can see there are several that are currently in use on the site, could you please be a bit more specific about exactly what format you are referring to?

like the one on https://codegolf.stackexchange.com/questions/54/tips-for-golfing-in-python. I think that is the one I've seen the most. Language info usually goes into the showcase question, not the tips.

Use DefXXX statements when declaring multiple variables
The statement
DefDbl A-D

Defines all variables that start with A through D as being of the type Double, which means this can shorten cases such as
Dim A As Double
Dim B As Double
Dim C As Double
Dim D As Double

Similar commands exist for the following types
DefBool     ''  Boolean
DefByte     ''  byte
DefCur      ''  Currency
DefDate     ''  Date
DefDbl      ''  Double
DefDec      ''  Decimal
DefInt      ''  Integer
DefLng      ''  Long
DefObj      ''  Object
DefSng      ''  Single
DefStr      ''  String
DefVar      ''  Variant

Use Console.Write over Console.WriteLine
There is quite a large amount of overhead code necessary to get a snippet of code to execute in VB, and by default this overhead is configured to take up quite a large amount of bytes - for instance
Module M
Sub Main
Console.WriteLine("Hello, World!")
End Sub
End Module

May be golfed down by 4 bytes by the Console.Write(...) command over Console.WriteLine(...).
Module M
Sub Main
Console.Write("Hello, World!")
End Sub
End Module

Tips question are usually required not to offer whitespace and name shortening tips, as they apply for all languages and go under the generic tip question. I don't think this answer should appear here.

@Uriel - you are completely correct, I've modified the response; please continue to let me know anything I can do to improve this resource.

I still don't think that existence of Write method is worth an answer, but that's debatable. anyway, please refrain from long codes. You could make just fine with only the central line - it just clutters pages


text:
Tips for golfing in Visual Basic .NET
This page is not for Visual Basic Tips
Visual Basic .NET (VB.NET) is an multi-paradigm dialect of basic that was developed and released by Microsoft in 2002 as a replacement for Visual Basic. The current version of VB.Net as of Feb 2018 is Visual Basic .NET 15.0.
Unlike Visual Basic (VB), Visual Basic .NET (VB.NET) is fully integrated with the Microsoft .NET Framework giving it access to a far wider range of classes to access. Additionally, the bit width of integers and longs in VB.NET are 32 and 64 bits, respectively - twice that available to VB.

Some helpful links

MSDN Visual Basic .NET Guide

Visual Basic .NET Wiki

TIO - Visual Basic .NET (.NET Core)

TIO - Visual Basic .NET (Mono)

I think that the tips for golfing in uBasic, Yabasic, Visual Basic and Visual Basic.NET are all pretty similar, possibly enough to dupe close. Even if they aren't, we don't need a tips page for every dialect of a language, such as separate pages for Java 7, 8 and 9.

Caird, this issue with that is that while logically similar they have completely different syntax - for instance, uBasic requires line numbers, does not require spacing between any commands and barely has strings, let alone proper graphics and events implemented where as for VB.NET there are not required line numbers, modules are required, you have to use Console.Write instead of ?, it has proper graphics implemented events out the wazoo and the entirety of the .NET library available to it - to say that they should be treated the same is simply illogical

@cairdcoinheringaahing That said, I would agree that VB and VB.NET are very similar - I mean VB.NET is the replacement for VB, but they are completely different and distinct languages - that is, code written in VB may not run in VB.NET and code written in VB.NET may not run in VB. Further between the two there is currently 20 years worth of continuous professional development time between them, and this is reflected in the paradigms of writing in the two

Dim Variables implicitly as variants
VB.NET is capable of assuming object type at compile time - with numerics being dimmed into 32-bit spaces this means that
Module M
Sub Main
Dim i As Byte
Dim j As Short
Dim k As Integer
Dim l As Long
For i=128To 2^8-1 Step 64
For j=2^7*i To 2^15-1 Step 64^2
For k=2^16*j To 2^31-1 Step 2^24
For l=2^31*k To 2^62-1 Step 2^48
Console.Write(i & j & k & l)
Next
Next
Next
Next
End Sub
End Module

Try it online! (266 bytes)
May be trimmed down by dimming i, j, k as variants, (note that because the default numeric type of a variant is a 32 Bit Integer l must still be dimmed as a Long as it shall hold a 64 bit value)
Module M
Sub Main
Dim i,j,k,l As Long
For i=128To 2^8-1 Step 64
For j=2^7*i To 2^15-1 Step 64^2
For k=2^16*j To 2^31-1 Step 2^24
For l=2^31*k To 2^62-1 Step 2^48
Console.Write(i &j &k &l)
Next
Next
Next
Next
End Sub
End Module

Try it online! (226 bytes)
or even further to 218  bytes by combining Next statements
Module M
Sub Main
Dim i,j,k,l As Long
For i=128To 2^8-1 Step 64
For j=2^7*i To 2^15-1 Step 64^2
For k=2^16*j To 2^31-1 Step 8^8
For l=2^31*k To 2^62-1 Step 2^48
Console.Write(i &j &k &l)
Next l,k,j,i
End Sub
End Module

Try it online! (218 bytes)
For a total savings of 40 bytes without impacting the output.

2^24 is also 8^8.

Combine Dim Statements
The VB6 command
Dim i As Double
Dim j As Double
Dim k as Double
Dim l As Double

Can be rewritten as
Dim i,j,k,l as Double

Note that this is dissimilar from VB6 where only l would be defined as a double and i,j,k would be defined as variants.

Imports keyword
You can use the Imports keyword in order to save bytes when using multiple class methods or a class method multiple times
92 bytes
module e
sub main
console.write(console.readline)
console.writeline("hi")
end sub
end module

91 bytes
imports system.console
module e
sub main
write(readline)
writeline("hi")
end sub
end module


text:
Local periods of strings
Local periods
Take a non-empty string s.
The local period of s at index i is the smallest positive integer n such that for each 0 ≤ k < n, we have s[i+k] = s[i-n+k] whenever both sides are defined.
Alternatively, it is the minimal length of a nonempty string w such that if the concatenation w w is placed next to s so that the second copy of w begins at index i of s, then the two strings agree wherever they overlap.
As an example, let's compute the local period of s = "abaabbab" at (0-based) index 2.

Try n = 1: then s[2+0] ≠ s[2-1+0], so this choice is not correct.
Try n = 2: then s[2+0] = s[2-2+0] but s[2+1] ≠ s[2-2+1], so this is also not correct.
Try n = 3: then s[2+0-3] is not defined, s[2+1] = s[2-3+1] and s[2+2] = s[2-3+2]. Thus the local period is 3.

Here is a visualization of the local periods using the second definition, with semicolons added between the two copies of w for clarity:
index      a b a a b b a b      period
 0       a;a                     1
 1       b a;b a                 2
 2       a a b;a a b             3
 3             a;a               1
 4     b b a b a a;b b a b a a   6
 5                 b;b           1
 6               a b b;a b b     3
 7                   b a;b a     2

Note that w is not necessarily a substring of s.
This happens here in the index-4 case.
The task
Your input is a nonempty string s of lowercase ASCII characters.
It can be taken as a list of characters if desired.
Your output shall be the list containing the local period of s at each of its indices.
In the above example, the correct output would be [1,2,3,1,6,1,3,2].
The lowest byte count in each language wins.
Standard code-golf rules apply.
Test cases
a -> [1]
hi -> [1, 2]
www -> [1, 1, 1]
xcxccxc -> [1, 2, 2, 5, 1, 3, 2]
abcbacb -> [1, 4, 7, 7, 7, 3, 3]
nininini -> [1, 2, 2, 2, 2, 2, 2, 2]
abaabbab -> [1, 2, 3, 1, 6, 1, 3, 2]
woppwoppw -> [1, 4, 4, 1, 4, 4, 4, 1, 4]
qwertyuiop -> [1, 10, 10, 10, 10, 10, 10, 10, 10, 10]
deededeededede -> [1, 3, 1, 5, 2, 2, 5, 1, 12, 2, 2, 2, 2, 2]
abababcabababcababcabababcaba -> [1, 2, 2, 2, 2, 7, 7, 7, 7, 2, 2, 2, 19, 19, 5, 5, 2, 5, 5, 12, 12, 2, 2, 2, 7, 7, 5, 5, 2]

@Arnauld You can always find a w with the same length as s. In the case of qwertyuiop, w will be a rotated version of qwertyuiop. See also the example at index 4: w is not necessarily a substring of s.

That makes sense. I misread the challenge.

Imaginary bonus for a linear time solution! (someone else may offer a real bounty, so keep trying)

Really neat challenge, but I wonder if it would make more sense to define the local period of each position between two characters (i.e. wherever the ; is in your example). That would get rid of the leading 1.

@MartinEnder That would be conceptually cleaner, but this definition makes it easier to produce the output by looping over the string, and the output won't be empty.

@Zgarb Yeah, I guess it depends on the approach. I figured for some approaches you still couldn't loop over the input, because you might have to treat the first character as a special case anyway.

Java 8, 167 154 152 bytes
s->{int l=s.length,r[]=new int[l],i=0,n,k;for(;i<l;r[i++]=n)n:for(n=0;;){for(k=++n;k-->0;)if(i+k<l&i+k>=n&&s[i+k]!=s[i-n+k])continue n;break;}return r;}

-2 bytes thanks to @ceilingcat.
Try it online.
Explanation:
s->{                          // Method with char-array parameter and int-array return-type
  int l=s.length,             //  Length of the input-array
      r[]=new int[l],         //  Result-array of the same size
      i=0,n,k;                //  Integers `i`, `n`, and `k` as defined in the challenge
  for(;i<l;                   //  Loop `i` in the range [0, `l`):
      r[i++]=n)               //    After every iteration: Add `n` to the array
    n:for(n=0;;){             //   Inner loop `n` from 0 upwards indefinitely
      for(k=++n;k-->0;)       //    Inner loop `k` in the range [`n`, 0]:
                              //    (by first increasing `n` by 1 with `++n`)
        if(i+k<l&i+k>=n)      //     If `i+k` and `i-n+k` are both within bounds,
           &&s[i+k]!=s[i-n+k])//     and if `s[i+k]` is not equal to `s[i-n+k]`:
          continue n;         //      Continue loop `n`
                              //    If we haven't encountered the `continue n` in loop `k`:
      break;}                 //     Break loop `n`
  return r;}                  //  Return the result

136 bytes

Retina, 89 86 bytes
.
$`¶$<'¶
/(^|.+)¶.+/_(Lw$`^(.+)?(.*)(.+)?¶(?(1)|(.*))\2(?(3)$)
$2$3$4
G`.
%C`.
N`
0G`

Try it online! Edit: Saved 3 bytes thanks to @MartinEnder. Explanation:
.
$`¶$<'¶

Split the input at each character, creating a pair of lines, one for the prefix and one for the suffix of the prefix.
/(^|.+)¶.+/_(

Run the rest of the script on each resulting pair.
Lw$`^(.+)?(.*)(.+)?¶(?(1)|(.*))\2(?(3)$)
$2$3$4

Find all overlapping matches and list the results. (See below.)
G`.

Discard the empty match.
%C`.

Take the length of each match.
N`

Sort numerically.
0G`

Take the smallest.
The matching works by splitting the prefix and suffix into three parts. There are four valid cases to consider:
AB|BC   B matches B to the left and B to the right
B|ABC   AB matches [A]B to the left and AB to the right
ABC|B   BC matches BC to the left and B[C] to the right
BC|AB   ABC matches [A]BC to the left and AB[C] to the right

The regex therefore only allows A and C to match on one side at a time.

$&$' is equal to $<' and computing line lengths is shorter with %C\.`. https://tio.run/##K0otycxLNPz/X49LJeHQNhUb9UPbuPQ14mr0tDUPbdPT1o/X8ClXSYjTAPLtNfS0NMGMQ9s07DUMNWtAApoxRkCOsaaKJpeKkYqxigmXe4Iel6ozkPBL4DJwT/j/PzEpMTEpKTEJAA

JavaScript (ES6), 84 bytes
Takes input as an array of characters.
s=>s.map((_,i)=>s.some(_=>s.every(_=>k<j|!s[k]|s[k-j]==s[k++]|k-i>j,++j,k=i),j=0)*j)

Test cases

let f =

s=>s.map((_,i)=>s.some(_=>s.every(_=>k<j|!s[k]|s[k-j]==s[k++]|k-i>j,++j,k=i),j=0)*j)

console.log(JSON.stringify(f([...'a']))) // [1]
console.log(JSON.stringify(f([...'hi']))) // [1, 2]
console.log(JSON.stringify(f([...'www']))) // [1, 1, 1]
console.log(JSON.stringify(f([...'xcxccxc']))) // [1, 2, 2, 5, 1, 3, 2]
console.log(JSON.stringify(f([...'abcbacb']))) // [1, 4, 7, 7, 7, 3, 3]
console.log(JSON.stringify(f([...'nininini']))) // [1, 2, 2, 2, 2, 2, 2, 2]
console.log(JSON.stringify(f([...'abaabbab']))) // [1, 2, 3, 1, 6, 1, 3, 2]
console.log(JSON.stringify(f([...'woppwoppw']))) // [1, 4, 4, 1, 4, 4, 4, 1, 4]
console.log(JSON.stringify(f([...'qwertyuiop']))) // [1, 10, 10, 10, 10, 10, 10, 10, 10, 10]
console.log(JSON.stringify(f([...'deededeededede']))) // [1, 3, 1, 5, 2, 2, 5, 1, 12, 2, 2, 2, 2, 2]
console.log(JSON.stringify(f([...'abababcabababcababcabababcaba']))) // [1, 2, 2, 2, 2, 7, 7, 7, 7, 2, 2, 2, 19, 19, 5, 5, 2, 5, 5, 12, 12, 2, 2, 2, 7, 7, 5, 5, 2]

I'm not sure if taking an array of characters is allowed, are you sure they're not just 1-character strings?

@EriktheOutgolfer There's no character type in JS, so yes: it's technically an array of 1-character strings. My understanding is that if it quacks like a string, it's a string. (Here is a meta post about that, but a more relevant one may exist -- or one that actually contradicts my assumption.)

Or to put it in other words: this is as close as we can get to a list of characters in JS, which was explicitly allowed by the OP.

Ruby, 104 102 bytes
->s{l=s.size-1
(0..l).map{|i|n=0
loop{n+=1
(n-i..l-i).all?{|k|k<0||k>=n||s[i+k]==s[i-n+k]}&&break}
n}}

Try it online!
A lambda accepting a string and returning an array.
-2 bytes: Swap range endpoints with index bound guards
Ungolfed:

->s{
  l=s.size-1                # l is the maximum valid index into s
  (0..l).map{ |i|           # i is the current index
    n=0                     # n is the period being tested
    loop{                   # Repeat forever:
      n+=1                  # Increment n
      (n-i..l-i).all?{ |k|  # If for all k where i+k and i-n+k are valid indexes into s
        k<0 || k>=n ||      #   We need not consider k OR
          s[i+k]==s[i-n+k]  #   The characters at the relevant indexes match
      } && break            # Then stop repeating
    }
  n                         # Map this index i to the first valid n
  }
}

Japt, 33 32 bytes
Saved 1 byte thanks to @Shaggy
¬Ë@¯E f'$iUtED ú.D r."($&|^)"}aÄ

Test it online!
Explanation
¬Ë@¯E f'$iUtED ú.D r."($&|^)"}aÄ   Implicit: U = input string
¬Ë                                 Split the input into chars, and map each index E to
  @                          }aÄ     the smallest positive integer D where
   ¯E                                  the first E chars of U
      f                                matches the regex formed by
          UtED                         taking D chars of U from index E,
                ú.D                     padding to length D with periods,
                    r."($&|^)"          replacing each char C with "(C|^)",
        '$i                             and placing a '$' at the very end.

My first thought was to just compare each character in the left substring with the corresponding char in the right substring, as in the JS answer. That wouldn't work, however, as Japt's method to get a character just wraps to the other end of the string if the index is negative or too large.
Instead, my solution builds a regex out of the second substring and tests it on the first substring. Let's take the 5th item in test-case abaabbab as an example:
abaabbab
    ^ split point -> abaa for testing regex, bbab for making regex

   slice  regex                              matches abaa
1. b      /(b|^)$/                           no
2. bb     /(b|^)(b|^)$/                      no
3. bba    /(b|^)(b|^)(a|^)$/                 no
4. bbab   /(b|^)(b|^)(a|^)(b|^)$/            no
5. bbab.  /(b|^)(b|^)(a|^)(b|^)(.|^)$/       no
6. bbab.. /(b|^)(b|^)(a|^)(b|^)(.|^)(.|^)$/  yes: /^^ab..$/

The main trick is that ^ can match infinitely, up until an actual character is matched. This lets us ignore any number of characters from the start of the regex, while ensuring that the rest are all matched consecutively, finishing at the end of the test string.
I'm not sure I've explained this very well, so please let me know if there's anything you'd like clarified, or anything else that should be explained.

32 bytes.

@Shaggy Thanks, that semicolon was bugging me :P

C (gcc), 143 142 140 139 128 126 123 119 bytes

Saved a byte. Golfed !b&&printf to b||printf.
Saved two bytes thanks to Kevin Cruijssen. Removed the for loop body parentheses by juggling the printf placement.
Saved a byte. Golfed b+=S[i+k]!=S[i-n+k] to b|=S[i+k]-S[i-n+k].
Saved eleven bytes. Removed the need of l=strlen(S) by conditioning both string handling loop to break when reaching the string's end (a null byte '\0').
Saved two bytes. Golfed i-n+k>~0 to i-n>~k.
Saved three bytes thanks to ceilingcat; b||printf("|"),n++ is equivalent to n+=b||printf("|").
Saved four bytes thanks to ceilingcat.

i,b,k,n;f(char*S){for(i=~0;S[++i];)for(b=n=1;b;n+=b||printf("%d,",n))for(b=0,k=i;k<n+i&&S[k];k++)b|=n>k?0:S[k]-S[k-n];}

Try it online!

You can save 2 bytes by removing the brackets and putting b||printf("%d,",n) inside the for-loop: i,b,k,n,l;f(char*S){for(l=strlen(S),i=-1;++i<l;)for(b=n=1;b;b||printf("%d,",n),n++)for(b=k=0;k<n;k++)i+k<l&i-n+k>=0&&(b+=S[i+k]!=S[i-n+k]);} 140 bytes

@KevinCruijssen Thank you.

@ceilingcat Thanks; neat equivalence, that one.

@ceilingcat Thank you.

Python 2, 115 bytes
lambda s:[min(j+1for j in R(len(s))if all(s[k+~j]==s[k]for k in R(i,i-~j)if len(s)>k>j))for i in R(len(s))]
R=range

Try it online!


text:
Biggest number challenge (Brainfuck)
This is a brainfuck version of Largest Number Printable, and this.

Let's think about brainfuck interpreter such that,

Has array that can be stretched left & right arbitrary large
Each cell can contain arbitrary large integer

Can contain negative integer too

When the interpreter starts, every cell is intialized by 0
. prints integer representation of value of cell, then LF.

For example, <<+++.>--. prints
3
-2

, then terminate.

Description
Your goal is to write a brainfuck program that prints a number/numbers.
The bigger the number, the more points you'll get.
There are some rules to follow.

Your program must terminate.
You should not use ,.
You can print multiple integers.
Your score will be largest number that the program prints.
Maximum code length is 1024 bytes. (Only []+-><. counts)

Here is sample brainfuck interpreter that you could test.

Leaderboards
:)

What's the point in having a separate challenge while such answers can as well be posted to the other challenge?

@user202729 largest number printable challenge's maximum code lengths are 100, and it is quite short for brainfuck.

Here's a TIO link for your brainfuck interpreter

Is there any sort of time limit?

@JoKing There are no time limit for program. But it must terminate.

Doesn't really make a difference. Also we havecompressed BF too.

@user202729 Also, this challenge disallows to concatenate string(output). Therefore, we cannot use technique like +...........

Well, I watched Jo King 's answer. @user202729 is right. 100 bytes is enough for BF, and there is no point to have a seperate challenge. ~Please mark~ I will mark this challenge as duplicated.

Score: 2↑↑45306
Edit: Replaced it with a more modifiable version. Try 2↑↑2, 2↑↑3, and 2↑↑4 (2↑↑5 times out)
Just testing the waters with a short answer.
+>+>++>++>++>++++>++[>[<+++++>-]<<]>
>++<
[
    >[->>+>+<<<]
    >>>
    [
        <[-<+<+>>]
        <[->+<]
        >>-
    ]
    <[-]<<<-
]
>.

The ↑↑ indicate Knuth's arrow notation, where a single ↑, such as X↑Y, means (((X*Y)*Y)*Y)... X times = X^Y, and two ↑↑s means (((X↑Y)↑Y)↑Y)... X times. For example, 2↑↑4 = 2222.
(I'm not familiar with bignum notation, so please tell me if there's a shorter way of representing this, or there's an error in my calculations)
Explanation:
+>+>++>++>++>++++>++[>[<+++++>-]<<]>

Produces the number 45306. (Taken from the brainfuck constants page on Esolangs, an immensely useful page). This will be used as the counter.
>++<

Sets the current value as two and move back to the counter
[ Loop until the counter is 0

    Square the current value
    >[->>+>+<<<]
    >>>
    [
        <[-<+<+>>]
        <[->+<]
        >>-
    ]<[-]

    Decrement the counter
    <<<-
]

A few ways to extend this:

Increase the counter. Pretty easy to do.
Increase the initial value. To be simple, you could just set the initial value and the counter as the same number
Remove the clear cell in the squaring operation, which compounds the result
Create another counter and put another loop around the whole thing

This effectively adds another Knuth's Arrow to the result (I think)
Further addition, for each iteration of the outer loop, copy the current value to use as the inner loop's counter
And then put another loop around the whole lot again.

Squaring 2 45306 times only gives you 2^2^45306.

@lirtosiast Yeah, I feel kinda stupid looking back at this. I was mixing up $((2^2)^2)^2...$ with $2^{2^{2^{2...}}}$


text:
Interpret deadfish

Please participate in the meta discussion about reopening this challenge before casting a vote.

Introduction
This challenge was inspired by semicolon-#.
Deadfish is a non-Turing-complete programming language, created by Jonathan Todd Skinner. It has an accumulator register and contains 4 commands, i, d, s, and o, standing for increment, decrement, square, and output, respectively. While this seems simple enough, the original implementation has some quirks that must be present in your interpreter.
Unlike a similar challenge here, this does not require the interpreter to be interactive.
Challenge
The challenge is to write a fully functional Deadfish interpreter, quirks included. The following requirements must be met:

The accumulator must be more than 8 bits wide.
When an i is encountered, increment the accumulator by 1.
When a d is encountered, decrement the accumulator by 1.
When an s is encountered, square the value of the accumulator.
When an o is encountered, print the value of the accumulator along with a newline.
When any other character is encountered, including control characters and whitespace but not a newline, print a newline.
If and only if the accumulator equals -1 or 256, set the accumulator to 0.

Test cases
From the esolangs article:
iissso -> 0
diissisdo -> 288
iissisdddddddddddddddddddddddddddddddddo -> 0

Rules

Input may be accepted through STDIN or as argument(s).
Standard loopholes are disallowed
This is code-golf, so the shortest solution in bytes wins

@dylnan This one doesn't impose an interactivity requirement, however, allowing more languages to be used

True. I think people will say you should make a meta post about it. If they say it's a good idea and you link to the meta post on this post then people will be okay with it.

@Uriel yes it should!

Related meta post.

Proton, 114 bytes
a=0s={"i":(a=>a+1),"d":(a=>a-1),"s":(a=>a*a),"o":(a=>[print(a),a][1])}for i:input(){a=s[i](a)if a in[-1,256]{a=0}}

Try it online!
The fact that this even parses correctly demonstrates how weird Proton 1 is o_O


text:
Conjugate permutations
A permutation of size n is a reordering of the first n positive integers.  (meaning each integer appears once and exactly once).  Permutations can be treated like functions that change the order of a list of items of size n.  For example
(4 1 2 3) ["a", "b", "c", "d"] = ["d", "a", "b", "c"]

Thus permutations can be composed like functions.
(4 1 2 3)(2 1 3 4) = (4 2 1 3)

This brings about a lot of interesting properties.   Today we are focusing on conjugacy.  Permutations y and x (both of size n) are conjugates iff there are permutations g and g-1 (also of size n) such that
x = gyg-1
and gg-1 is equal to the identity permutation (the first n numbers in proper order).
Your task is to take two permutations of the same size via standard input methods and decide whether they are conjugates.  You should output one of two consistent values, one if they are conjugates and the other if they are not.
This is code-golf so answers will be scored in bytes with fewer bytes being better.
There are lots of theorems about conjugate permutations that are at your disposal, so good luck and happy golfing.
You may take input as an ordered container of values (either 1-n or 0-n) representing the permutation like above, or as a function that takes a ordered container and performs the permutation.  If you choose to take function you should take it as an argument rather than have it at a predefined name.
Test Cases
(1) (1) -> True
(1 2) (2 1) -> False
(2 1) (2 1) -> True
(4 1 3 2) (4 2 1 3) -> True
(3 2 1 4) (4 3 2 1) -> False
(2 1 3 4 5 7 6) (1 3 2 5 4 6 7) -> True

Can we take input as a function? Can we also take in the size n?

@xnor Sure on both counts.  I'm not sure how the first will help you though.

The default function input rules allow the function to be assumed to be predefined, which saves bytes on writing it as an argument, if you allow it.

@xnor Are we talking about this rule?  That is for black box functions which permutations are not.  This makes sense because that consensus is designed to allow languages without function pointers/objects to compete whereas here they can because permutations can be represented otherwise.

I was, I didn't think of the distinction of them being black-box. So here, the input may be a function, but only as an explicit argument?

@xnor Yes.  That is my intention.  I'll detail this in the post.

@WheatWizard could you show the working on a test case?

@ManishKundu You can show that those two are conjugates by decomposing them into their cycle factors. The first is (2 1)(7 6) and the second is (3 2)(5 4).  There is a theorem that tells us that if two permutations have the same cycle structures they are conjugates and both of these have the cycle structure (- -)(- -)

Do we need to support the empty permutation ?

Python 2, 87 bytes
f=lambda P,k:k<1or len({sum([x==eval('L['*k+'x'+']'*k)for x in L])for L in P})&f(P,k-1)

Try it online!
Takes input with P as a pair of both permutations and k their length. Outputs 1 for conjugates and 0 not.
This uses the result:

Two permutations x and y are conjugate exactly if their k-th powers xk and yk have an equal number of fixed points for every k from 0 to n.

Two conjugate permutations satisfy this because their k-th powers are also conjugate, and conjugacy preserves the count of fixed points.
It's less obvious that any two non-conjugate permutations always differ. In particular, conjugacy is determined by the sorted list of cycle lengths, and these can be recovered from the counts of fixed points. One way to show this is with linear algebra, though it might be overkill.
Let X be the permutation matrix for x. Then, the number of fixed points of xk is Tr(Xk). These traces are the power sum symmetric polynomials of the eigenvalues of Xk with multiplicity. These polynomials for k from 0 to n let us recover the corresponding elementary symmetric polynomials of these eigenvalues, and therefore the characteristic polynomial and so the eigenvalues themselves.
Since these eigenvalues are roots of unity corresponding to the cycles of x, from these we can recover the cycle sizes and their multiplicities. So, our "signature" identifies the permutation up to conjugation.

J, 25 bytes 23 bytes 16 bytes
miles' tacit solution :
-:&([:/:~#&>)&C.

OP's explicit solution :
c=:4 :'-://:~"1#&>C.&>x;y'

This checks whether permutations x and y have the same cycle type, using the built-in C. function to produce cycle representations.
   4 1 3 2   c   4 2 1 3
1
   3 2 1 4   c   4 3 2 1
0
   2 1 3 4 5 7 6   c   1 3 2 5 4 6 7
1

Welcome to PPCG and nice first post. I shortened your method to 16 bytes -:&([:/:~#&>)&C. by using a tacit form. Here's a TIO link to try it out.

Thank you. :) I'm still quite a J beginner, and though I seem to easily put it to good use with explicit forms, composing efficient tacit forms still require an excessive lot of thought for me. I'll add your solution.

PS : don't we count the function assignments' chars as well ? c=:

@MathiasDolidon No, by default consensus, we don't count the chars required for assignment, since the function may be used as-is (with parentheses, but we don't count them).

OK ! I've retroactively updated the counts for the explicit solution in the title to take this into account.

MATL, 20 19 17 16 bytes
xY@!"&G@)@b)X=va

Input: two column vectors (using ; as separator). Output: 1 if conjugate, 0 if not.
Try it online! Or verify all test cases.
Explanation
No theorems about permutations used (out of sheer ignorance); just brute force and these two facts:

For two permutations p and q, the composition pq is equivalent to using p to index the elements of q.

The condition x = gyg−1 is equivalent to xg = gy.

Commented code:
x      % Implicitly input first permutation, x. Delete it. Gets copied into clipboard G
Y@     % Implicitly input second permutation, y. Push a matrix with all permutations
       % of its elements, each permutation on a different row. So each matrix row is
       % a permutation of [1 2 ...n], where n is the size of y
!      % Transpose. Now each permutation is a column
"      % For each column
  &G   %   Push x, then y
  @    %   Push current column. This is a candidate g permutation
  )    %   Reference indexing. This gives g composed with y
  @    %   Push current column again
  b    %   Bubble up. Moves x to the top of the stack
  )    %   Reference indexing. This gives x composed with g
  X=   %   Are they equal as vectors? Gives true or false
  v    %   Concatenate stack so far. The stack contains the latest true/false result
       %   and possibly the accumulated result from previous iterations
  a    %   Any: gives true if any element is true. This is the "accumulating" function
       % Implicit end. Implicit display

Jelly, 11 bytes
Œ!©Ụ€ịị"®⁸e

Try it online!
How it works
Œ!©Ụ€ịị"®⁸e  Main link. Left argument: x. Right argument: y

Œ!©          Take all permutations g of x. Copy the result to the register.
   Ụ€        Grade up each; sort the indices of each permutation g by their
             corresponding values. For permutations of [1, ..., n], grading up
             essentially computes the inverse, g⁻¹.
     ị       Let each g⁻¹ index into y, computing g⁻¹y.
      ị"®    Let the results index into the corresponding g, computing g⁻¹yg.
         ⁸e  Test if x occurs in the result.

As far as I understand, it's actually y which indexes into each g⁻¹, not the other way around. See the example, (4 1 2 3)(2 1 3 4) = (4 2 1 3). With your approach, it would result in (1 4 2 3) instead, since the second indexes into the first. Taking that into account, I have a 12-byte solution I won't spoil yet. :-)

@EriktheOutgolfer Fixed.

@Dennis But I didn't come to that conclusion based on the explanation, I arrived to the exact same approach, except that I had something like Œ!©Ụ€⁹ịÐ€®ị"⁸e (basically all indexing with reversed arguments), except shorter after I made major modifications. I don't think g⁻¹yg is the same as gyg⁻¹. Also, I think your answer can benefit from those modifications too, but, as I said before, I don't want to ruin the fun yet.

Yes, it's exactly the same. If x = g⁻¹yg, then gxg⁻¹ = y, so x and y are conjugates.

Hm, I feel like I should reveal my 12-byte solution then: eŒ!ị"Ụị@¥€¥¥

Wolfram Language (Mathematica), 44 bytes
Equal@@(PermutationCycles[#,Sort[0#]&]&/@#)&

Try it online!

Wolfram Language (Mathematica), 44 bytes
x_±y_:=Or@@(#[[x]]==y[[#]]&/@Permutations@x)

Using CP-1252 encoding, where ± is one byte.
Try it online!

Husk, 9 bytes
¤¦ṠmöLU¡!

Returns 1 for conjugate and 0 for non-conjugate.
Try it online!
Explanation
The conjugacy class of a permutation P of L =
 [1,2,..,n] is determined by the multiset containing the least period of each number in L under P.
When P is taken in list format, I can replace L with P and get the same multiset.
The program computes the corresponding multiset for each input and checks if one is a sub-multiset of the other.
Since they have the same number of elements, this is equivalent to being the same multiset.
¤¦ṠmöLU¡!  Implicit inputs: two lists of integers.
¤          Apply one function to both and combine with another function.
  ṠmöLU¡!  First function. Argument: a list P.
  Ṡm       Map this function over P:
       ¡!  iterate indexing into P,
      U    take longest prefix with unique elements,
    öL     take its length.
 ¦         Combining function: is the first list a subset of the other, counting multiplicities?

Perl, 61 58 57 bytes
Includes +2 for ap
Give 0-based permutations as 2 lines on STDIN
perl -ap '$_=[@1]~~[@1=map{-grep$_-$G[$i++%@G],@F=@G[@F]}@G=@F,0]'
3 0 2 1
3 1 0 2
^D

Algorithm is a minor variation on the one in xnor's solution
This older version of the code hits a perl bug and dumps core for several inputs on my latest perl 5.26.1, but it works on an older perl 5.16.3.
@{$.}=map{-grep$_==$F[$i++%@F],@G=@F[@G]}@G=@F,0}{$_=@1~~@2

It's possibly yet another instance of my old perlgolf enemy, the fact that perl doesn't properly refcount its stack.

JavaScript (ES6), 66 64 bytes
(a,b,g=a=>b+a.map(h=(e,i)=>e-i&&1+h(a[e],i)).sort())=>g(a)==g(b)

If I've read the other answers correctly, the problem is equivalent to counting the periods of all the elements and checking that the two lists have the same number of each period. Edit: Saved 1 byte thanks to @Arnauld by calculating one less than the period. Saved another byte thanks to @Arnauld by abusing JavaScript's weird coercion rules to compare the arrays. Another byte could be saved by currying but I don't like curry unless it's chicken tikka masala.


text:
Don't get your head in a spin!
Guidelines
Task
Write a function that takes in a sentence (a string, or list of characters) and reverses all the words that are greater than or equal to 5 in length.

Examples
"Hey fellow code golfers" -> "Hey wollef code sreflog"
"I aM noT a cAr" -> "I aM noT a cAr"
"I Am a tRaiN" -> "I Am a NiaRt"

Rules

Since this is code golf, the person with the least amount of bytes as their answer wins.

The input will have only one space between two adjacent words and there will be no trailing or leading spaces.

The output must also only have one space between two adjacent words and no trailing or leading spaces.

You can assume that the input will either be a string, or an array of characters. It WILL NOT be an array of words.

You must output either a string, or an array of characters. You MUST NOT output an array of words.

Words with punctuation marks can be seen as 5 or 4 letters, whichever you want

Capitalisation should stay the same for the same letters

Comments are not for extended discussion; this conversation has been moved to chat.

Jelly,  12 10 8  7 bytes
-1 thanks to dylnan (use of repeat, ¡, as a replacement of if, ?, saving the need for identity, ¹.)
ḲṚṫ¡€5K

A monadic link taking and returning lists of characters.
Try it online!
How?
ḲṚṫ¡€5K - Link: list of characters
Ḳ       - split at spaces (gets words)
     5  - literal five
    €   - for €ach word:
   ¡    -   repeat:
  ṫ     -   ...number of times: tail (5th character on, if empty falsey->0, else truthy->1)
 Ṛ      -   ...action: reverse
      K - join with spaces

Previous 8: ḲṚ¹ṫ?€5K
Previous 10: ḲµṚ¹ṫ?5µ€K
Previous 12s: ḲµUµL€>4Tµ¦K and ḲµṚ¹L>¥?4µ€K

7 bytes. Also nice trick with ṫ and putting €5 on the right side of ? I didn't realize you could do that

Oh and I never knew that would work; thanks!

Retina, 10 8 bytes
2 bytes saved thanks to @ETHproductions
V`\w{5,}

Try it online!
  \w{5,}     match 5 or more characters long strings
V`           reverse each match and insert in place

And we had such a nice chain going :(

Nice! I think it will be tricky to beat this.

Yep, this is close to optimal for any language. But why do you need the \b?

@ETHproductions I don't, thanks. Residue from the * mistake

brainfuck, 123 bytes
,[[>++++[-<-------->]<[[-<+>]++++[-<++++++++>]>,>]<]<[>]<<<<<[[>]<[.<]>[>]]>>>>[[<]>[.>]]>>>>>,[>++++[->++++++++<]>.[-]]<<]

Try it online!
Most of this is just creating the ASCII value for space (32) 3 times, which is 51 bytes, or 41.4% of the total bytecount.
An attempt to only create one cell with 32 at the beginning and use that (124 bytes):
++++[->++++++++<],[[>[-<-<+>>>+<]<[[-<+>]>,>>>>]<[[-]>>>>]<<<]>>[-<+>]<<<<<<<<[[>]<[.<]>[[-]>]<<]>>>>[[<]>[.[-]>]]>,[>.>]<<]

Earned an upvote for doing it in BF.

Having posted my first brainfuck answer a couple of weeks ago, I have great respect for this. I'm sure I can learn a lot by these examples. Great effort.

JavaScript (ES6), 60 bytes
-57 bytes, w/ help from @Amorris, @Oliver, @Shaggy
s=>s.split` `.map(w=>w[4]?[...w].reverse().join``:w).join` `

My first ever codegolf submission!

Welcome to PPCG!

Welcome to PPCG! One thing I can see right off the bat to remove 2 bytes is the brackets around s, when you are passing the input to the f arrow function. That is not needed unless you have two variables to input.

You can replace w.split('') with [...w] and .join(' ') & .join('') can be replaced with backticks .join\ ` .join```

Why are you using a when you're already mapping over s? Also, the () around the length check are unecessary.

Thanks for the advice everyone, I've just made some changes. Thanks for the warm welcome too!

w[4], not w[5] ;)

Oops! Darn indexing.

Python 2, 56 51 49 bytes
-3 bytes thanks to Jonathan Allan
-2 bytes thanks to Mr. Xcoder
-2 bytes thanks to ElPedro
for w in input().split():print w[::len(w)<5or-1],

Try it online!

Save three moving to Python 3 and a full program

You can use [::len(w)<5or-1] for -2 bytes.

49 by going back to Python 2 and using a standard for loop

@Mr.Xcoder - as hard as I try I can't figure out why len(w)<5or-1 works. Any chance you can explain?

@ElPedro In Python, bools are subclasses of integers. Namely, len(w)<5 returns either True - which is equivalent to 1 - or False - which is equivalent to 0. In case this condition is true (the length is less than 5), len(w)<5or-1 evaluates to 1, so w[::len(w)<5or-1] gives w[::1], which returns the string unchanged. In case the condition is false, then len(w)<5or-1 is equivalent to 0 or -1, which yields -1 because 0 is falsy, and therefore w[::len(w)<5or-1] is the same as w[::-1], which takes every element from the end of the string (i.e. it reverses it).

Many thanks @MrXcoder. That helps a lot. I used a kinda similar idea for my answer. It was the or that I couldn't follow. Thanks again.

QuadR, 10 bytes
\w{5,}
⌽⍵M

Try it online!
\w{5,}   match 5 or more characters long strings
         and replace
 ⍵M      each match
⌽        with its reverse

Got an upvote for using a language I hadn't even heard of before!

Haskell, 50 49 bytes
f s|s>take 4s=reverse s|1<2=s
unwords.map f.words

Try it online!
Edit: -1 byte thanks to @totallyhuman.

49 bytes. (words that are greater than or equal to 5 in length)

05AB1E, 12 bytes
ð¡εDg4›iR]ðý

Try it online!
Explanation
ð¡             # split on spaces
  ε      ]     # apply to each word
   D           # duplicate
    g          # length
     4›        # greater than 4
       iR      # if true, reverse
          ðý  # join by space

Japt, 11 bytes
Saved a byte thanks to @Shaggy
®Ê<5?Z:Zw}S

Try it online!
Explanation
®        }S    Split on spaces and map each word Z through this function:
 Ê<5             If the length of Z is less than 5,
    ?Z             return Z unchanged.
      :Zw        Otherwise, return Z reversed.
               The words are then re-joined on spaces and sent to output.

Japt v2, 11 bytes
r/\w{5,}/_w

Test it online!
Thought of this just before the Retina answer was posted. Replaces each match of /\w{5,}/g with the match reversed.

Fun fact: this would be 7 bytes according to the current feature plan for v2: r»ẉ⁵⁻_w

If only there were a shortcut for l , your second solution could be 11 bytes too! ;)

@Shaggy ...I'm a moron sometimes :P

C,  105  104 bytes
Thanks to @ceilingcat for saving a byte!
i,k;f(char*s){for(i=0;s[k=i]>32;)++i;for(;i>4&&k--;)putchar(s[k]);~k&&write(1,s,i+=k=!!s[i]);k&&f(s+i);}

Try it online!
Unrolled:
i, k;
f(char*s)
{
    for (i=0; s[k=i]>32;)
        ++i;

    for (; i>4&&k--;)
        putchar(s[k]);

    ~k && write(1, s, i+=k=!!s[i]);
    k && f(s+i);
}

99 bytes

Perl, 22 bytes
Includes +1 for p
perl -pe 's/\w{5,}/reverse$&/eg' <<< "Hey fellow code golfers"

><>, 63 53 43 bytes
i>::48*=$0(+?v
6ov!?lr?(5l~ <.1
*^>i:0(?;48

Try it online!
10 20 bytes saved thanks to Jo King!

Woah, yeah, guess I was more tired than I realized while making this. Thanks!

Python, 74 69 Bytes
def f(a):print' '.join([i if len(i)<5else i[::-1]for i in a.split()])

Edit: -5 thanks to @ElPedro

69 (TIO) - print instead of return, Python splits on space by default (don't need ' ') and lose the space between 5 and else.

GolfScript, 24 bytes
" "/{.,4>{-1%}{}if}%" "*

Try it online!

Java 8, 131 bytes
s->s.join(" ",java.util.Arrays.stream(s.split(" ")).map(x->x.length()<5?x:new StringBuffer(x).reverse()+"").toArray(String[]::new))

Explanation:
Try it online.
s->                            // Method with String as both parameter and return-type
  s.join(" ",                  //  Join String-array with spaces:
      java.util.Arrays.stream( //   An Array-stream of:
        s.split(" "))          //    The input-String split by spaces
      .map(w->                 //     Mapped to:
           w.length()<5?       //      If the word is not of length 5:
            w                  //       Leave the word as is
           :                   //      Else:
            new StringBuffer(x).reverse()+"")
                               //       Reverse it
      .toArray(String[]::new)) //   And convert the Stream to a String-array for the join

C (gcc), 152 125 106 bytes

Saved 19 bytes thanks to ceilingcat.

j;f(char*S){for(char*Z;*S;S=Z+!!*Z)for(Z=S+strcspn(S," "),j=0;Z-S>4&&--j*2>S-Z;Z[j]^=S[~j]^=Z[j]^=S[~j]);}

Try it online!

SNOBOL4 (CSNOBOL4), 132 119 bytes
 s =input
s s arb . x (' ' | rpos(0)) rem . s
 x =gt(size(x),5) reverse(x)
 o =o x differ(s) ' ' :s(s)
 output =o x
end

Try it online!

Perl 5 + -p, 21 bytes
s/\S{5,}/reverse$&/eg

Try it online!
Replace (s///) all (/g) at least 5 ({5,}) non-whitespace (\S) by the evaluation (/e) of reverse$&/the reversed match.

Python 3, 67 65  bytes
lambda s:' '.join([c[::-1]if len(c)>4 else c for c in s.split()])

f= is not needed unless it is recursive.  Saves 2.

JavaScript, 69 66 bytes
s=>s.split` `.map(i=>i.length>4?[...i].reverse().join``:i).join` `

Try it online!

You can replace i.split'' with [...i]

w[4] is shorter than w.length>4.

JavaScript, 73 50 bytes
-23 bytes thanks to Shaggy and ETHproductions
s=>s.replace(/\w{5,}/g,x=>[...x].reverse().join``)

Test cases

let f =

s=>s.replace(/\w{5,}/g,x=>[...x].reverse().join``)

console.log(f("Hey fellow code golfers"))
console.log(f("I aM noT a cAr"))
console.log(f("I Am a tRaiN"))

You don't need to split on the spaces.

I think Shaggy means that the .split and .join are superfluous and can be removed, since /\w{5,}/ doesn't match spaces. (You will have to add the g flag though)

Red, 98 bytes
f: func[a][parse a[any[copy n[to{ }| to end](if(length? n)> 4[n: reverse n]prin n)skip(prin{ })]]]

Try it online!
Ungolfed
f: func [a] [
    parse a [                            ; parse the argument on
        any [                            ; zero or more
            copy n [                     ; copy the matched substring to n
                to { }                   ; scan to a space
                | to end                 ; or to the end
            ]
            ( if (length? n) > 4 [       ; if the length of the match is bigger than 4
                  n: reverse n           ; reverse the match
              ]
            prin n)                      ; print the match
            skip (prin { })              ; skip the space
        ]
    ]

JavaScript, 53 bytes
An alternative, but slightly longer, method to the straightforward reversing of words of length ≥5, which Oliver beat me to.
s=>s.replace(/\S+/g,m=>[...m].sort(_=>!!m[4]).join``)

Try it online

Python 2, 53 bytes
for i in input().split():print i[::(-1,1)[len(i)<5]],

As far as I can see the , at the end does not leave a trailing space but please correct me if I am wrong.
Try it online!

Pyth, 20 bytes
VcwdI>lN4p+_Nd.?p+Nd

Try it online!
Vcwd          | for N in input().split(" "):
    I>lN4     |     if len(N)>4:
        p+_Nd |         print(N[::-1]+" ", end="")
    .?        |     else:
        p+Nd  |         print(N+" ", end="")

Japt -S, 9 bytes
¸®zZÊ¨5©2

Try it

CJam, 18 bytes
Port of my GolfScript answer.
lS/{_,4>{-1%}&}%S*

Try it online!

Husk, 10 bytes
wm?↔Io>5Lw

Try it online!


text:
DNA to RNA Transcription
Guidelines
Task
Given a DNA strand, return its RNA complement (per RNA transcription).
Both DNA and RNA strands are a sequence of nucleotides.
The four nucleotides found in DNA are adenine (A), cytosine (C),
guanine (G) and thymine (T).
The four nucleotides found in RNA are adenine (A), cytosine (C),
guanine (G) and uracil (U).
Given a DNA strand, its transcribed RNA strand is formed by replacing
each nucleotide with its complement:

G -> C
C -> G
T -> A
A -> U

Rules

The input will always be either a string or an array/list of characters
The output should always be either a string or an array/list of characters
In the case of invalid input, you should output 'Invalid Input' as a string or an array/list of characters
You can assume that you will only be given printable ASCII characters.
This is code golf so the person with the least amount of bytes winsx

Examples
'C' -> 'G'
'A' -> 'U'
'ACGTGGTCTTAA' -> 'UGCACCAGAAUU'
'XXX' -> 'Invalid Input'
'ACGTXXXCTTAA' -> 'Invalid Input'

Other info
This task was taken from Exercism, which was founded by Katrina Owen and is licensed under the MIT License.

Can we assume that the input will contain only printable ASCII characters? If not, what range of characters can appear in the input?

Boo-urns to input validation!

@MartinEnder Yes only printable ASCII characters, however you must still check that it is valid input.

I assume U is illegal input? At least one answer currently fails if that's true.

Here is a meta post explaining why input validation is usually discouraged. In this particular case, it also prevents the use of arithmetic solutions.

I remember seeing a sandboxed challenge like this that says "deleted too simple and probably dupe of many other things" something like that.

(Recommend sandbox)

Side note: https://exercism.io/ does not work for me. It's working fine without SSL, though.

05AB1E, 23 bytes
„—ÄGu©ÃQi®"GUAC"‡ë”Í¼î®

Try it online!
Explanation
„—ÄGu©                    # push "CATG" and store a copy in register
      Ã                   # keep only those letters of input
       Qi                 # if the result equals the input
         ®"GUAC"‡         # translate "CATG" to "GUAC"
                 ë”Í¼î®   # else, push "Invalid Input"

Moar guacamole pls

Retina, 36 31 bytes
T`GCTAp`CGAUx
K'x`Invalid input

Try it online!
Explanation
T`GCTAp`CGAUx

Perform the required character substitutions as a transliteration, while also replacing all invalid characters with x.
K'x`Invalid input

If the result contains x (i.e. the input contained an invalid character), replace it with the constant string Invalid input.

K (oK) / K4, 38 bytes
Solution:
(x;"Invalid Input")@|/^x:"CGAU""GCTA"?

Try it online!
Examples:
q)k)(x;"Invalid Input")@|/^x:"CGAU""GCTA"?"C"
"G"
q)k)(x;"Invalid Input")@|/^x:"CGAU""GCTA"?"C"
"G"
q)k)(x;"Invalid Input")@|/^x:"CGAU""GCTA"?"G"
"C"
q)k)(x;"Invalid Input")@|/^x:"CGAU""GCTA"?"ACGTGGTCTTAA"
"UGCACCAGAAUU"
q)k)(x;"Invalid Input")@|/^x:"CGAU""GCTA"?"XXX"
"Invalid Input"
q)k)(x;"Invalid Input")@|/^x:"CGAU""GCTA"?"ACGTXXXCTTAA"
"Invalid Input"

Explanation:
The mapping is trivial. 25 bytes for the "Invalid Input" portion.
(x;"Invalid Input")@|/^x:"CGAU""GCTA"? / the solution
                               "GCTA"? / return index in left list
                         "CGAU"        / index into this list
                       x:              / save as x
                      ^                / null, any nulls in x?
                    |/                 / take max
                   @                   / index into
( ;               )                    / two item list
   "Invalid Input"                     / result if null found
 x                                     / result if no nulls found

Python, 103 95 86 bytes
def f(b):
 try:return["CGAU"["GCTA".index(i)]for i in b]
 except:return"Invalid Input"

Or, if lowercase inputs count:
def f(b):
 try:return["cgau"["gcta".index(i.lower())]for i in b]
 except:return"Invalid Input"

Why not uuse "GCTA" and "CGAU" and remove the .lower()?

further to the above I think "acgt" should be considered invalid input.

@streetster I wasn't sure whether or not the lowercase letters counted as valid inputs.

Can't you inline a and c like try:return["CGAU"["GCTA".index(i)]for i in b]?

@Laikoni I didn't think of that, changed!

Python 3, 82 79 67 bytes
thanks to Laikoni for -3 bytes!
-12 bytes by looking at this 3 years later.
lambda s:{*s}-{*'ACGT'}and'Invalid Input'or s.translate('UCG A'*17)

Try it online!
str.translate takes any kind of collection of characters or codepoints that can be indexed into with an integer, in this case we use a string.

c
ord(c)
ord(c)%5
('UCG A'*20)[ord(c)]

'A'
65
0
'U'

'C'
67
2
'G'

'G'
71
1
'C'

'T'
84
4
'A'

79 bytes with "".join("UCG A"[ord(c)%5]for c in s): Try it online!

Red,118 114 bytes
func[s][t: copy{}foreach c s[append t switch/default to-word c[G[{C}]C[{G}]T[{A}]A[{U}]][return"Invalid Input"]]t]

Try it online!
Ungolfed:
f: func [s] [
    t: copy {}                              ; initialize t to an empty string
    foreach c s [                           ; for each character c of the input
        append t switch/default to-word c [ ; append to t the following if c is one of GCTA
            G [{C}]
            C [{G}]
            T [{A}]
            A [{U}]
        ]
        [ return "Invalid Input" ]          ; otherwise return "Invalid Input"
    ]
    t                                       ; return t
]

GNU sed, 70 43 bytes
s/^.*[^ATCG].*$/Invalid Input/
y/ATCG/UAGC/

Try it online!

C (clang) or MinGW, 110 bytes
f(s){for(char*t="GCTA",*o=s=strdup(s),*q;*o;o++)(q=strchr(t,*o))?*o="CGAU"[q-t]:(s="Invalid input!");puts(s);}

Try it online!

Coconut, 75 70 bytes
s->set(s)-set('ACGT')and'Invalid Input'or["UCG A"[ord(c)%5]for c in s]

Try it online! A mix of ovs' Python answer and my Haskell answer.
Edit: -5 bytes thanks to ovs!

This is shorter with a list comprehension. But I think returning a map object would be valid as well and is another byte shorter.

@ovs Thanks! Is there any consensus on map objects?

There is no specific consensus regarding iterators, but it is allowed to write a generator function. This is quite similar as the return value of a generator function is an generator, which is a specific type of an iterator just like a map object.

CJam, 43 bytes
l{"GCTA"#"CGAU "=}%_S#){];"Invalid input"}&

Online interpreter: http://cjam.aditsu.net/

Perl 5 with -p, 39 bytes
y/GCTA/CGAU/<y///c?$_="Invalid Input":0

Saved 1 byte thanks to wastl!
Try it online!

Two other 41 bytes solutions (both -p): s/.*[^GCTA].*/Invalid Input/;y;GCTA;CGAU and y/GCTA/CGAU/<length?$_='Invalid Input':0

@wastl Oh, nice. Using y///c instead of length your second saves a byte! Thank you!

We don't count flags as bytes anymore; instead, we count flags as separate languages altogether, so this answer is "Perl 5 + -p, 39 bytes" and not "Perl 5, 39 bytes + 1 (-p) = 40".

Thanks @EriktheOutgolfer I keep forgetting this. Old habits and all that...

Well, it's my question over meta which has the consensus, no wonder I've been immediately used to it. :P

Batch, 192 bytes
@echo off
set/ps=
set t=%s:A=%
set t=%t:C=%
set t=%t:G=%
set t=%t:T=%
if not "%t%"=="" echo Invalid Input&exit/b
set s=%s:A=U%
set s=%s:C=A%
set s=%s:G=C%
set s=%s:A=G%
echo %s:T=A%

Takes input on STDIN.

JavaScript (ES6), 78 bytes
f=([c,...r],s='',k='GCTA'.indexOf(c))=>c?~k?f(r,s+'CGAU'[k]):'Invalid input':s

Test cases

f=([c,...r],s='',k='GCTA'.indexOf(c))=>c?~k?f(r,s+'CGAU'[k]):'Invalid input':s

console.log(f('C'           )) // 'G'
console.log(f('A'           )) // 'U'
console.log(f('ACGTGGTCTTAA')) // 'UGCACCAGAAUU'
console.log(f('XXX'         )) // 'Invalid Input'
console.log(f('ACGTXXXCTTAA')) // 'Invalid Input'

Without input validation (non-competing)
47 bytes using search():
f=([c,...r])=>c?'CGAU'['GCTA'.search(c)]+f(r):r

48 bytes using a hash:
f=([c,...r])=>c?'UCG_A'[parseInt(c,36)%5]+f(r):r

Haskell, 75 bytes
f s|all(`elem`"GCTA")s=["UCG A"!!mod(fromEnum c)5|c<-s]
f _="Invalid Input"

Try it online! The mapping is done by taking the character values mod 5 and indexing into the string "UCG A".

Jelly,  24  23 bytes
“ɠ{>dʠ»ɓ,Ṛ;⁾TUyðḟ?“TGCA

A full program printing the result (a monadic link is  25  24 with a closing ” appended)
Try it online!
How?
“ɠ{>dʠ»ɓ,Ṛ;⁾TUyðḟ?“TGCA - Main Link: list of characters
                  “TGCA - literal list of characters = ['T','G','C','A']
                 ?      - if...
                ḟ       - ...condition: filter discard (empty is falsey)
“ɠ{>dʠ»                 - ...then: compressed string = "Invalid Input"
       ɓ       ð        - ...else: dyadic chain with swapped arguments:
         Ṛ              - reverse = ['A','C','G','T']
        ,               - pair = [['T','G','C','A'],['A','C','G','T']]
           ⁾TU          - literal list of characters = ['T','U']
          ;             - concatenate = [['T','G','C','A'],['A','C','G','T'],'T','U']
              y         -   translate...
                        -   ... 1: {'T'->'A';'G'->'C';'C'->'G';'A'->'T'}
                        -   ... 2: {'T'->'U'}

C, 128 bytes
k,l;f(S){char*s=S,b[l=strlen(s)],*t=b;for(;*t++=(k=*s++)-65?k-67?k-71?k-84?0:65:67:71:85;);puts(strlen(b)-l?"Invalid Input":b);}

Try it online!
Unrolled:
k, l;
f(S)
{
    char *s=S, b[l=strlen(s)], *t=b;
    for(; *t++ = (k=*s++)-65 ? k-67 ? k-71 ? k-84 ? 0 : 65 : 67 : 71 : 85;);
    puts(strlen(b)-l ? "Invalid Input" : b);
}

APL+WIN, 66 bytes
Prompts for screen input of original string
('CGAU',⊂'Invalid Input')[(((⍴n)×~m)↑n),(m←0<+/(n←,'GTCA'⍳⎕)=5)↑5]

How many bytes?

@Laurel Thanks for spotting my omission. Corrected.

@Laikoni That is strange I edited it, checked it and the count was there. Just gone back and it was gone. I have re-edited and checked and it is there now

R, 75 bytes
function(s)"if"(grepl("[^ACGT]",s),"Invalid Input",chartr("ACGT","UGCA",s))

Try it online!