How compactly can your language perform accurate numerical integration?

python3, 3982 2183 1866 1821 1677, ~14s

from functools import*
#let's start with the comments. I'll exclude them from total count
#from functools I need only reduce
#I've been coding in python2 for 5 years so I'm used to built-in reduce much
#and it's very handy here
g=range
#just keep it in mind while reading) ranGe -> g
#and we're getting rid of classes in favor of functions, that gives
#us ~100 bytes more. It's how it was:
#class P:
#it's a Polynomial, self.c are coefficients and self.d is a divisor. So all polynomial computations are exact
#we need polynomials to implement https://en.wikipedia.org/wiki/Gaussian_quadrature#Gauss%E2%80%93Legendre_quadrature
#   c=[0]
#   d=1
#don't even know if these initial values are necessary
#   def __init__(self,c,d=1):
#       self.c=list(c)
#       self.d=d
#n'th derivative
#   def dn(self,n=1):
#       c=self.c[:]
#       for _ in g(n):
#           c=[c[i]*i for i in g(1,len(c))]
#       d=reduce(gcd,c,self.d)
        #gcd is imported from math along with exp,log and gamma
#       return P([i//d for i in c],self.d//d)
#   def m(self,x):
#the value of poly at point x. __call__ may look better
#       return sum((x**i)*self.c[i] for i in range(len(self.c)-1,-1,-1))/self.d
        #the reverse order was for floats and really needed there for precision,
        #but python3 have exact Fractions, so maybe it's to be golfed too
#Now let's convert this class to functions
#derivative=lambda c:reduce(lambda c,_:[c[i]*i for i in g(1,len(c))],g(n),c)
#the_gcd=lambda c,d:reduce(gcd,c,d)
#the_result=lambda c,d,m:([i//m for i in c],d//m)
#where c is now the derivative
#and combined:
v=lambda c,d,n=1:(lambda c:
(lambda c,d,m:([i//m for i in c],d//m))(c,d,reduce(gcd,c,d))
)\
(reduce(lambda c,_:[c[i]*i for i in g(1,len(c))],g(n),c))
#the computing of a plynomial's value:
m=lambda c,d,x:sum((x**i)*c[i] for i in g(len(c)-1,-1,-1))/d
d={}
#https://en.wikipedia.org/wiki/Combination written recursively with Pascal's triangle, with the dict d for speed
def c(n,k):
    if (n,k) not in d:
        d[(n,k)]=1 if k==0 or k==n or n==0 else c(n-1,k)+c(n-1,k-1)
    return d[(n,k)]
#p=30
#it's the floating point precision for Decimal
#it was needed for computing the polynomial roots, you can see the raw version
#maybe I'll get rid of it if it's used in the only place
from math import*
from fractions import Fraction as F
n=61
l=v(sum(([c(n,i)*(-1)**(n-i),0] for i in g(n+1)),[]),
        2**n*reduce(lambda x,y:x*y,g(1,n+1),1),n)
#Legendre polynomial of order n, pretty straightforward, -3bytes for space
#you can't see these bytes in the tio version, there is 1 line
d=v(*l)
#and the derivative for weights
#see we can use c and d now 'cause we don't need them more
c=2**100
#maybe the hardest-to-read part, the roots of l
#taking too long to compute (2-3 mins) so hard-stored
#b(b'GKSmRyJoJz...') is the 390-bytes byte array,
#representing the <0 roots (the function is odd, so -x and x are both roots and we have to store only half)
#30 13-byte(100-bit, for 10^{-30} precision) integers are stored in lsbf order of bytes
#and c is common multiplier for all computed roots' denominators
from base64 import b64decode as b
#extract numbers from base-64,
r=(lambda b:[sum(2**(n*8)*i for n,i in enumerate(b[j:j+13])) for j in g(0,391,13)])(b(b'GKSmRyJoJzZNd978D7hBJ/SAXF6k3Q+D7w9eWlMN1hwU7v+nhNcPP3k+PPY3ALm75/G0DwxkhnBW7vYeTLvhhw8XTAWijBbPeSIxclAPxUQBLJIlU0r8S8gODz6W/ntGb0p0WeUPww6bS5oF+R0NzuqOe20OpkOWAx5DBcFecEQODqjUMBgWzmCaCiGqpQ2xekr44w56Xl998jMNN0/S8UF6TE04eGm5DL0i6Wm5wA/nHOhgNgxOR3kgsJNHFpZQMKsLdK2AMa1xRv65pzQYCxSYft+TX736FBjQfQqY8CuipXP9Bxm/adwJEKYLfykKeTs/aG00CVuQ6lnO2j04CUVLhggLyUIxC/eIqRKid9IHdSe6aSQRS8hkmWoZB2rhfvNKb9bHP8KfWwb379JeWbyiuY/elZkFsIKVLmMYZwdEhs7TBAvB47snQ/UMwtDNCgRb9soEqlNzn6z8GT8DTfSlRAVDCG07FjtxAheAQ01VIxgWXpy6oQEELmiRzDIqr+ckI9EA'))
#and make fractions
#0 is in r for magically mistaken 391 for 390 )
#maybe +[0]+r[::-1] is 1 byte shorter (or longer?)
#but at least more readable )
#roots computation code is in the raw below
r=[F(i,c) for i in [-j for j in r]+r[-2::-1]]
#the weights
w=[2/((1-x**2)*(m(*d,x))**2) for x in r]
from decimal import*
D=Decimal
setcontext(Context(prec=30, rounding=ROUND_HALF_DOWN))
#that was float=
#it's only converting Fraction to Decimal. no built-in
f=lambda r:(lambda n,d:D(n)/D(d))(*str(r).split('/'))
#number of sub-intervals of (0,1)
d=2**8
s=input().strip()
c=D(s)
#the inverse of c, not the math.exp(1) ))
e=D(1)/c
#pretty straightforward, I is the integrator,
I=lambda h:sum(sum(f(v)*h(f(((x+1)/2+i)/d))/(2*d) for v,x in zip(w,r))
        for i in range(d))
#the rest follows (at math:)
print(D(gamma(1/float(s)+1))+(c.ln())-I(lambda t:(D('0.5')+5*((-9*((-((t).ln()))**(e))).exp())).ln())-D('0.5772156649015328606065120900824')*(1-e)-1)

Try it online! -- takes input as a valid Decimal, like 0.2
Math:
0. We do google numerical integration.
1. Let's see provocative \$f(x)=c\cdot x^{c-1}\cdot e^{-x^c}=
-\left(e^{-x^c}\right)'\$
2. So, we have \$-\int\limits_0^\infty \ln\left(\frac{c\cdot x^{c-1}\cdot e^{-x^c}}{0.5e^{-x}+5e^{-10x}}\right)\left(e^{-x^c}\right)'dx\$,
we change the variable to \$t=e^{-x^c}\$, \$x^c=-\ln(t)\$,
\$x=\left(-\ln t\right)^\frac1c\$,
\$t(0)=1\$, \$t(+\infty)=0\$ and the integral is
\$\int\limits_0^1 \ln\left(\frac{c\cdot x(t)^{c-1}\cdot t}{\left(0.5+5e^{-9x(t)}\right)e^{-x(t)}}\right)dt=\$
\$\int\limits_0^1 \left(\ln c+\left(\ln x(t)\right)\cdot(c-1)+ \ln t- \ln\left(0.5+5e^{-9x(t)}\right) +x(t)\right)dt=\$
\$\int\limits_0^1 \left(\ln c+\left(\ln \left(-\ln t\right)\right)\cdot\frac{c-1}{c}+ \ln t- \ln\left(0.5+5e^{-9x(t)}\right) +x(t)\right)dt\$
3. Next we wolframalpha these things:
\$\int\limits_0^1\ln(-\ln t)dt\$,
\$\int\limits_0^1 (-\ln t)^a dt\$,
\$\int\limits_0^1 \ln t\,dt\$  and do the rest numerically (the latter thing maybe can be done with trapeziums or rectangles or Simpson -- the idea for short submissions).
The raw thing:

from copy import copy
from functools import reduce
class Poly:
    c=[0]
    d=1
    def __init__(self,c,d=1):
        self.c=list(c)
        self.d=d
    def dn(self,n=1):
        c=copy(self.c)
        for _ in range(n):
            c=[c[i]*i for i in range(1,len(c))]
        d=reduce(gcd,c,self.d)
        return Poly([i//d for i in c],self.d//d)
    def m(self,x):
        return sum((x**i)*self.c[i] for i in range(len(self.c)-1,-1,-1))/self.d
def gcd(x,y):
    return abs(gcd(y,x%y)) if y else x
cdict={}
def c(n,k):
    if (n,k) not in cdict:
        cdict[(n,k)]=1 if k==0 or k==n or n==0 else c(n-1,k)+c(n-1,k-1)
    return cdict[(n,k)]
def root(x,f,f_):
    x_old=0
    while x!=x_old:# and abs(f(x))>1e-15:
        print(x,f(x),f_(x))
        x_old=x
        x=x-f(x)/f_(x)
    print('===')
    return x
precision=30
def b(b,e,f,eps=1e-17):
    mold,m=0,1
    while e-b>eps and mold!=m:
        mold=m
        m=(e+b)/2
        if (l.m(m)>0)!=(l.m(b)>0):
            e=m
        else:
            b=m
        #print(*map(float,[b,e,f(b),f(e)]))
    print('.',sep='',end='')
    return b
##class Frac:
##    n=0
##    d=1
##    def __init__(self,n,d):
##        self.n=n
##        self.d=d
##    def
lcm=lambda x,y:x*y//gcd(x,y)
import math
from fractions import Fraction
degree=61
n=degree
l=Poly(sum(([c(n,i)*(-1)**(n-i),0] for i in range(n+1)),[]),
       2**n*reduce(lambda x,y:x*y,range(1,n+1),1)).dn(n)
ld=l.dn()
#print(l.coeffs,l.d)
#r=[root(math.cos(math.pi*(4*i-1)/(4*n+2)),l.m,ld.m) for i in range(1,n+1)]
##d=2**8#4096
##while True:
##    i_=[(b,e) for b,e in [(Fraction(i,d)-1,Fraction(i+1,d)-1)
##                          for i in range(2*d)] if (l.m(b)>0)!=(l.m(e)>0)]
##    print(d,len(i_))
##    if len(i_)==n:
##        break
##    d*=2
##r=[b(*i,l.m,Fraction(1,10**precision)) for i in i_]
##print('\n',sep='',end='')
cm=1267650600228229401496703205376
#cm=reduce(lambda x,i:lcm(int((str(i).split('/')+[1])[1]),x),r,1);cm
#[str(i*cm) for i in r]
r=[Fraction(int(i),cm) for i in ['-1266681605106811426160584860697', '-1262547799267707740863710314936', '-1255122086390021131342967954015', '-1244422184933863703004183427391', '-1230475806835976018691325584397', '-1213319288075032955237836344344', '-1192997371846808208190052844742', '-1169563069074221666262667138623', '-1143077514053466175428649175963', '-1113609802945881973204995949479', '-1081236812728978305124643427497', '-1046043000289730543348383120049', '-1008120181921745998647915597624', '-967567293702390287305984778942', '-924490133333634877286205966159', '-879001084101412705885157895540', '-831218821664589525108846925845', '-781268004433877062952267018393', '-729278948345971539276192261648', '-675387286880006687633990914140', '-619733617202494872284783888651', '-562463133363442075271048079222', '-503725247500289525435137450347', '-443673200037730123766618583031', '-382463659900222496924931293872', '-320256315780122313563780137228', '-257213459527711400732339664476', '-193499562749975057795207525453', '-129280847722706546595631169560', '-64724853735360852478581550597', '0', '64724853735360852478581550596', '129280847722706546595631169559', '193499562749975057795207525452', '257213459527711400732339664475', '320256315780122313563780137227', '382463659900222496924931293871', '443673200037730123766618583030', '503725247500289525435137450346', '562463133363442075271048079221', '619733617202494872284783888650', '675387286880006687633990914139', '729278948345971539276192261647', '781268004433877062952267018392', '831218821664589525108846925844', '879001084101412705885157895539', '924490133333634877286205966158', '967567293702390287305984778941', '1008120181921745998647915597623', '1046043000289730543348383120048', '1081236812728978305124643427496', '1113609802945881973204995949478', '1143077514053466175428649175962', '1169563069074221666262667138622', '1192997371846808208190052844741', '1213319288075032955237836344343', '1230475806835976018691325584396', '1244422184933863703004183427390', '1255122086390021131342967954014', '1262547799267707740863710314935', '1266681605106811426160584860696']]
#r=[Fraction(-72002513042367095, 72057594037927936), Fraction(-35883766692782835, 36028797018963968), Fraction(-35672715239059617, 36028797018963968), Fraction(-141474422995755015, 144115188075855872), Fraction(-69944451686068079, 72057594037927936), Fraction(-137938433007892963, 144115188075855872), Fraction(-135628098615462501, 144115188075855872), Fraction(-66481963419518119, 72057594037927936), Fraction(-32488216960856169, 36028797018963968), Fraction(-126602776952709289, 144115188075855872), Fraction(-61461197033678349, 72057594037927936), Fraction(-59460660411885473, 72057594037927936), Fraction(-7163124720376473, 9007199254740992), Fraction(-109999665903886841, 144115188075855872), Fraction(-105102359763536115, 144115188075855872), Fraction(-99930853605361871, 144115188075855872), Fraction(-23624659822433771, 36028797018963968), Fraction(-88819888837164975, 144115188075855872), Fraction(-41454708727199633, 72057594037927936), Fraction(-19195661220692463, 36028797018963968), Fraction(-70455555169530143, 144115188075855872), Fraction(-63944654967081315, 144115188075855872), Fraction(-28633465234423143, 72057594037927936), Fraction(-6304975386764939, 18014398509481984), Fraction(-10870271009372985, 36028797018963968), Fraction(-36408927801417385, 144115188075855872), Fraction(-29241784833142379, 144115188075855872), Fraction(-21998353389560073, 144115188075855872), Fraction(-14697530755564293, 144115188075855872), Fraction(-7358363943167303, 144115188075855872), Fraction(0, 1), Fraction(3679181971583651, 72057594037927936), Fraction(3674382688891073, 36028797018963968), Fraction(2749794173695009, 18014398509481984), Fraction(14620892416571189, 72057594037927936), Fraction(4551115975177173, 18014398509481984), Fraction(43481084037491939, 144115188075855872), Fraction(50439803094119511, 144115188075855872), Fraction(57266930468846285, 144115188075855872), Fraction(31972327483540657, 72057594037927936), Fraction(35227777584765071, 72057594037927936), Fraction(76782644882769851, 144115188075855872), Fraction(82909417454399265, 144115188075855872), Fraction(44409944418582487, 72057594037927936), Fraction(94498639289735083, 144115188075855872), Fraction(49965426802680935, 72057594037927936), Fraction(52551179881768057, 72057594037927936), Fraction(13749958237985855, 18014398509481984), Fraction(114609995526023567, 144115188075855872), Fraction(118921320823770945, 144115188075855872), Fraction(122922394067356697, 144115188075855872), Fraction(15825347119088661, 18014398509481984), Fraction(129952867843424675, 144115188075855872), Fraction(132963926839036237, 144115188075855872), Fraction(33907024653865625, 36028797018963968), Fraction(68969216503946481, 72057594037927936), Fraction(139888903372136157, 144115188075855872), Fraction(70737211497877507, 72057594037927936), Fraction(142690860956238467, 144115188075855872), Fraction(143535066771131339, 144115188075855872), Fraction(144005026084734189, 144115188075855872)]
#r=[Fraction(-144104924687379029, 144115188075855872), Fraction(-144061113633417193, 144115188075855872), Fraction(-71991152681636629, 72057594037927936), Fraction(-143868501524294767, 144115188075855872), Fraction(-35929931908622757, 36028797018963968), Fraction(-143536019344824829, 144115188075855872), Fraction(-71658710569760757, 72057594037927936), Fraction(-143063986084641675, 144115188075855872), Fraction(-142775775751233995, 144115188075855872), Fraction(-35613215044775229, 36028797018963968), Fraction(-142095317851501427, 144115188075855872), Fraction(-141703235672459401, 144115188075855872), Fraction(-141276708943911307, 144115188075855872), Fraction(-70407920670826367, 72057594037927936), Fraction(-140320744889653401, 144115188075855872), Fraction(-34947884983137447, 36028797018963968), Fraction(-139228355106226913, 144115188075855872), Fraction(-138631327306447751, 144115188075855872), Fraction(-69000300827755959, 72057594037927936), Fraction(-68668165733468573, 72057594037927936), Fraction(-136638678208163739, 144115188075855872), Fraction(-135907811461286037, 144115188075855872), Fraction(-67571954440908669, 72057594037927936), Fraction(-134347156155496359, 144115188075855872), Fraction(-16689718369143059, 18014398509481984), Fraction(-132655882883583863, 144115188075855872), Fraction(-131761773444627501, 144115188075855872), Fraction(-65417817986076227, 72057594037927936), Fraction(-64938847793634331, 72057594037927936), Fraction(-32222046285398959, 36028797018963968), Fraction(-127867345160661637, 144115188075855872), Fraction(-31703855946358703, 36028797018963968), Fraction(-62866338356003711, 72057594037927936), Fraction(-15577420891180097, 18014398509481984), Fraction(-123475765655790143, 144115188075855872), Fraction(-61151075136161875, 72057594037927936), Fraction(-121098806255952059, 144115188075855872), Fraction(-119866026109883705, 144115188075855872), Fraction(-118604109492524957, 144115188075855872), Fraction(-117313363144639965, 144115188075855872), Fraction(-115994100814789491, 144115188075855872), Fraction(-28661660795766563, 36028797018963968), Fraction(-28317829445786347, 36028797018963968), Fraction(-111868458922669023, 144115188075855872), Fraction(-110438407601984251, 144115188075855872), Fraction(-27245377857813575, 36028797018963968), Fraction(-26874531136490757, 36028797018963968), Fraction(-105988607520833283, 144115188075855872), Fraction(-26113331820545011, 36028797018963968), Fraction(-102892657018719659, 144115188075855872), Fraction(-50653488045428427, 72057594037927936), Fraction(-49848334969235775, 72057594037927936), Fraction(-98062129987227927, 144115188075855872), Fraction(-96403753553428489, 144115188075855872), Fraction(-94721943747436259, 144115188075855872), Fraction(-23254277343922147, 36028797018963968), Fraction(-45644832420663197, 72057594037927936), Fraction(-89540030043462969, 144115188075855872), Fraction(-10971078784389609, 18014398509481984), Fraction(-85975896119833679, 144115188075855872), Fraction(-42081131673510875, 72057594037927936), Fraction(-20582043201506859, 36028797018963968), Fraction(-40237035159487741, 72057594037927936), Fraction(-39300203286200335, 72057594037927936), Fraction(-19176909251924261, 36028797018963968), Fraction(-74796221710411347, 144115188075855872), Fraction(-72866625298407583, 144115188075855872), Fraction(-35459658404464939, 72057594037927936), Fraction(-68954769584591107, 144115188075855872), Fraction(-33486730579157493, 72057594037927936), Fraction(-32487936568629803, 72057594037927936), Fraction(-31481245542875313, 72057594037927936), Fraction(-60933804407252565, 144115188075855872), Fraction(-58890306225406907, 144115188075855872), Fraction(-56832493264165915, 144115188075855872), Fraction(-54760865727051299, 144115188075855872), Fraction(-26337963587783547, 72057594037927936), Fraction(-25289092203398143, 72057594037927936), Fraction(-48468147330210951, 144115188075855872), Fraction(-46346328843725859, 144115188075855872), Fraction(-11053311177256411, 36028797018963968), Fraction(-21034706713097939, 72057594037927936), Fraction(-19957678053844251, 72057594037927936), Fraction(-4718949543956531, 18014398509481984), Fraction(-35578660114658865, 144115188075855872), Fraction(-33397075583856055, 144115188075855872), Fraction(-15603686524289111, 72057594037927936), Fraction(-29010084771446223, 144115188075855872), Fraction(-1675359053686717, 9007199254740992), Fraction(-24594889131807827, 144115188075855872), Fraction(-22378054994346827, 144115188075855872), Fraction(-20155781304247947, 144115188075855872), Fraction(-4482152060343901, 36028797018963968), Fraction(-15697077176510773, 144115188075855872), Fraction(-6730865269878557, 72057594037927936), Fraction(-5611555844344803, 72057594037927936), Fraction(-4490882388138869, 72057594037927936), Fraction(-6738234618615355, 144115188075855872), Fraction(-2246533281244659, 72057594037927936), Fraction(-2246806352819167, 144115188075855872), Fraction(0, 1), Fraction(1123403176409583, 72057594037927936), Fraction(4493066562489317, 144115188075855872), Fraction(3369117309307677, 72057594037927936), Fraction(8981764776277737, 144115188075855872), Fraction(11223111688689605, 144115188075855872), Fraction(13461730539757113, 144115188075855872), Fraction(3924269294127693, 36028797018963968), Fraction(17928608241375603, 144115188075855872), Fraction(10077890652123973, 72057594037927936), Fraction(11189027497173413, 72057594037927936), Fraction(12297444565903913, 72057594037927936), Fraction(26805744858987471, 144115188075855872), Fraction(14505042385723111, 72057594037927936), Fraction(31207373048578221, 144115188075855872), Fraction(16698537791928027, 72057594037927936), Fraction(2223666257166179, 9007199254740992), Fraction(37751596351652247, 144115188075855872), Fraction(39915356107688501, 144115188075855872), Fraction(42069413426195877, 144115188075855872), Fraction(44213244709025643, 144115188075855872), Fraction(23173164421862929, 72057594037927936), Fraction(24234073665105475, 72057594037927936), Fraction(50578184406796285, 144115188075855872), Fraction(52675927175567093, 144115188075855872), Fraction(27380432863525649, 72057594037927936), Fraction(28416246632082957, 72057594037927936), Fraction(29445153112703453, 72057594037927936), Fraction(15233451101813141, 36028797018963968), Fraction(62962491085750625, 144115188075855872), Fraction(64975873137259605, 144115188075855872), Fraction(66973461158314985, 144115188075855872), Fraction(34477384792295553, 72057594037927936), Fraction(70919316808929877, 144115188075855872), Fraction(36433312649203791, 72057594037927936), Fraction(37398110855205673, 72057594037927936), Fraction(76707637007697043, 144115188075855872), Fraction(78600406572400669, 144115188075855872), Fraction(80474070318975481, 144115188075855872), Fraction(82328172806027435, 144115188075855872), Fraction(84162263347021749, 144115188075855872), Fraction(42987948059916839, 72057594037927936), Fraction(87768630275116871, 144115188075855872), Fraction(11192503755432871, 18014398509481984), Fraction(91289664841326393, 144115188075855872), Fraction(93017109375688587, 144115188075855872), Fraction(47360971873718129, 72057594037927936), Fraction(12050469194178561, 18014398509481984), Fraction(49031064993613963, 72057594037927936), Fraction(99696669938471549, 144115188075855872), Fraction(101306976090856853, 144115188075855872), Fraction(51446328509359829, 72057594037927936), Fraction(104453327282180043, 144115188075855872), Fraction(52994303760416641, 72057594037927936), Fraction(107498124545963027, 144115188075855872), Fraction(108981511431254299, 144115188075855872), Fraction(55219203800992125, 72057594037927936), Fraction(55934229461334511, 72057594037927936), Fraction(113271317783145387, 144115188075855872), Fraction(114646643183066251, 144115188075855872), Fraction(57997050407394745, 72057594037927936), Fraction(29328340786159991, 36028797018963968), Fraction(29651027373131239, 36028797018963968), Fraction(14983253263735463, 18014398509481984), Fraction(60549403127976029, 72057594037927936), Fraction(122302150272323749, 144115188075855872), Fraction(61737882827895071, 72057594037927936), Fraction(124619367129440775, 144115188075855872), Fraction(125732676712007421, 144115188075855872), Fraction(126815423785434811, 144115188075855872), Fraction(31966836290165409, 36028797018963968), Fraction(128888185141595835, 144115188075855872), Fraction(129877695587268661, 144115188075855872), Fraction(130835635972152453, 144115188075855872), Fraction(32940443361156875, 36028797018963968), Fraction(66327941441791931, 72057594037927936), Fraction(133517746953144471, 144115188075855872), Fraction(67173578077748179, 72057594037927936), Fraction(135143908881817337, 144115188075855872), Fraction(33976952865321509, 36028797018963968), Fraction(68319339104081869, 72057594037927936), Fraction(137336331466937145, 144115188075855872), Fraction(138000601655511917, 144115188075855872), Fraction(69315663653223875, 72057594037927936), Fraction(4350886097069591, 4503599627370496), Fraction(139791539932549787, 144115188075855872), Fraction(17540093111206675, 18014398509481984), Fraction(140815841341652733, 144115188075855872), Fraction(70638354471955653, 72057594037927936), Fraction(17712904459057425, 18014398509481984), Fraction(71047658925750713, 72057594037927936), Fraction(142452860179100915, 144115188075855872), Fraction(71387887875616997, 72057594037927936), Fraction(71531993042320837, 72057594037927936), Fraction(143317421139521513, 144115188075855872), Fraction(35884004836206207, 36028797018963968), Fraction(143719727634491027, 144115188075855872), Fraction(71934250762147383, 72057594037927936), Fraction(143982305363273257, 144115188075855872), Fraction(18007639204177149, 18014398509481984), Fraction(36026231171844757, 36028797018963968)]
w=[2/((1-x**2)*(ld.m(x))**2) for x in r]
from decimal import Decimal,Context,setcontext,ROUND_HALF_DOWN
setcontext(Context(prec=30, rounding=ROUND_HALF_DOWN))
float=lambda r:(lambda x:Decimal(x[0])/Decimal(x[1]))(str(r).split('/'))
d=2**8
s='{120.000000000000000000000000000,9.26052826812554737559992621571,3.32335097044784255118406403126,2.00000000000000000000000000000,1.50457548825155601882809780906,1.26582350605728327736200759570,1.13300309631934634747833911121,1.05218372089129332722399903882,1.00000000000000000000000000000}'
l=list(map(Decimal,s[1:-1].split(',')))
gamma=Decimal('0.5772156649015328606065120900824024310421593359399235988057672348848677267776646709369470632917467495')
for (c,c_1,real),l_ in zip([
    (Decimal('0.1')*i,Decimal('10')/i,10/i) for i in range(2,11)],l):
    #let t=e^{-x^c},\ln t=-x^c,x=(-\ln t)^{\frac1c}
    #t(0)=1,t(\infty)=0
    #dt=-e^{-x^c}\cdot x^{c-1}\cdot c
    #f(x)=e^{-x^c}\cdot x^{c-1}\cdot c=t\cdot (-\ln t)^{\frac{c-1}c}\cdot c
    xt=lambda t:(-((t).ln()))**(c_1)
##    f=lambda x:c*(x**(c-1))#*(math.exp(-(x**c)))
    fln=lambda t:((-((t).ln())).ln())#+(t.ln())
##    g=lambda x:Decimal('0.5')+5*((-9*x).exp())#*math.exp(-x)
    g=lambda t:Decimal('0.5')+5*((-9*xt(t)).exp())#*math.exp(-x)
##    h=lambda x:f(x)*((-(x**c)).exp())*\
##       ((f(x)).ln()-(x**c)-((g(x)).ln()-x))
##    #0,inf->0,1: x=t/(t-1), xt-x=t, (x-1)t=x, t=x/(x-1)
##    h1=lambda t:h(t/(1-t))/((1-t)**2) # 0,1
##    h2=lambda v:h1((v+1)/2)/2
    h1=lambda t:g(t).ln()#f(t).ln()-((g(t).ln())-xt(t))
    int_=lambda h1:sum(
          sum(float(w_)*h1(float(((x+1)/2+i)/d))/(2*d) for w_,x in zip(w,r))
          for i in range(d))
    print(c,Decimal(math.gamma(real+1))+(c.ln())-int_(h1)-gamma*(1-c_1)-1)
h1_=r'''0.2 0.476044892154085268532810576285
0.3 0.326045243249124607083205564208
0.4 0.194544295792217104304557844994
0.5 0.0805857800502670858642542661562
0.6 -0.0176136562407463311404194282348
0.7 -0.102042234943715186336125809639
0.8 -0.174612380676135222634071174702
0.9 -0.237048749195042896134197564780
1.0 -0.290856610889057599214369459143'''
x=[i.split(': ') for i in r'''c = 0.2. Output: 119.2233798550179
c = 0.3. Outout: 8.077346771987397
c = 0.4. Output: 2.07833944013377
c = 0.5. Output: 0.8034827042913205
c = 0.6. Output: 0.3961739639940003
c = 0.7. Output: 0.2585689391629249
c = 0.8. Output: 0.2287758419066705
c = 0.9. Output: 0.2480070283065089
c = 1.0. Output: 0.2908566108890576'''.split('\n')]
y=[i.split(' ') for i in r'''0.2 119.223379855017945799292478451
0.3 8.07734677198740392689540304712
0.4 2.07833944013376923348715605315
0.5 0.80348270429132046532502570246
0.6 0.39617396399400051391328713871
0.7 0.25856893916292307961043114604
0.8 0.22877584190665494099938058972
0.9 0.24800702830645810748432393277
1.0 0.29085661088905759921436945914'''.split('\n')]
#[(lambda l:(l and min(l)) or 0)([n for n,(d1,d2) in enumerate(zip(i[1],j[1])) if d1!=d2]) for i,j in zip(x,y)]
#[0, 14, 15, 17, 17, 16, 15, 14, 17]


Python 3, 275,467 255,540 states
Thanks @mypronounismonicareinstate for suggesting to add \$I\$ into the \$B \rightarrow C\$ loop, which ultimately saves about \$20k\$ states.

def print_machine(states):
 print(len(states[0]))
 for i in 0,1:
  for s in states[i]:
   # if s is None (state unused), puts dummy value in there
   move, new_val, new_state = s or ["H", 0, 0]
   print(move, new_val, new_state+1)

# simple machine that uses ceil(step/2) states
# used for small cases
def generate_simple_machine(steps):
 n_states = (steps+1)//2
 # states[cur_char][state_id]
 states = [[], []]
 for i in range(n_states):
  states[0].append(["S", 1, i])
  states[1].append(["S", 0, i+1])
 states[1][-1][0] = "H"
 if steps%2==1: states[0][-1][0] = "H"
 return states

BASE_STEPS = [(1<<i+2)-i-3 for i in range(20)]
BASE_STEPS[0] = -999

def generate_counter_machine(steps, do_print=True):
 # how many bits/states needed?
 for n_bits, max_steps in enumerate(BASE_STEPS):
  if max_steps > steps:
   break
 n_bits -= 1
 n_states = n_bits + 2
 extra = steps - BASE_STEPS[n_bits]
 if extra >= (1 << (n_bits+1)):
  n_states += 1

 # if small number of steps, use simple machine
 n_states_simple = (steps+1)//2
 if not do_print:
  return min(n_states_simple, n_states)
 if n_states >= n_states_simple :
  states = generate_simple_machine(steps)
  print_machine(states)
  return n_states_simple

 # states[cur_char][state_id]
 # use 0 indexed state
 states = [[None]*n_states, [None]*n_states]

 # state indices
 I_STATE  = 0
 B_STATE  = 1
 E_STATE  = n_states - 1
 C_STATES = [i+2 for i in range(n_bits)]

 # initial state
 states[0][I_STATE] = ["R", 1, C_STATES[0]]
 states[1][I_STATE] = ["H", 0, 0]  # not used initially

 # go back state
 states[0][B_STATE] = ["L", 0, B_STATE]
 states[1][B_STATE] = ["R", 1, C_STATES[0]]

 # ith-digit check states
 for i in C_STATES:
  states[0][i] = ["L", 1, B_STATE]
  states[1][i] = ["R", 0, i+1]
 states[1][C_STATES[-1]][0] = "H"

 # dealing with extras
 # first, figure out how many half-state
 # goes between B_1 -> C1_x
 t = 1<<n_bits
 q1 = t - 1
 q2 = q1 + t
 q3 = q2 + t
 if  extra < q1:
  extra_state = I_STATE
 elif extra < q2:
  # connect B_1 -> I_0 -> C1_?
  states[1][B_STATE] = ["S", 0, I_STATE]
  extra -= q1
  extra_state = I_STATE
 elif extra < q3:
  # connect B_1 -> I_0 -> I_1 -> C1_x
  states[1][B_STATE] = ["S", 0, I_STATE]
  states[0][I_STATE] = ["S", 1, I_STATE]
  states[1][I_STATE] = ["R", 1, C_STATES[0]]
  extra -= q2
  extra_state = E_STATE
 else:
  # connect B_1 -> I_0 -> I_1 -> E_0 -> C1_x
  states[1][B_STATE] = ["S", 0, I_STATE]
  states[0][I_STATE] = ["S", 1, I_STATE]
  states[1][I_STATE] = ["S", 0, E_STATE]
  states[0][E_STATE] = ["R", 1, C_STATES[0]]
  extra -= q3
  extra_state = E_STATE

 # then put a half-state between Cx_0 -> B
 # if needed
 if extra > 0:
  states[1][extra_state] = ["L", 1, B_STATE]
  for i in reversed(C_STATES):
   if extra%2==1:
    states[0][i] = ["S", 1, extra_state]
   extra //= 2
 print_machine(states)
 return n_states

Try it online! or Verify all machines from 1 to 20k
Big idea
We want to construct a Turing machine that has a large time complexity compared to the number of states. In this answer, I used a binary counter to count all integers with \$n\$ bits, which has a time complexity of \$O(2^n)\$. The binary counter was chosen because it is very simple to construct, easy to scale, and flexible enough to add any small number of steps.
Binary counter
Let's say we want to count all integers with 4 bits. The tape layout will be as follows:
1 x x x x
e.g.
1 0 0 0 0
1 1 0 0 0
....
1 0 1 1 1
1 1 1 1 1

where the left most 1 is used to mark the start of the number, and xxxx is the current number in binary, in reverse order (the least significant bit first). We start with 10000, and end with 11111.
At each cycle, we increase the number by 1 as follows:

Find the left most 0. E.g.

1 1 1 0 1
      ^

Set that digit to 1, and all previous digits to 0. The previous example becomes 1 0 0 1 1.

We then repeat these steps until the tape is 1 1 1 1 1.
Binary counter Turing machine
The counter machine for \$b\$-bit integers will have \$b+2\$ states: the initial state \$I\$, \$b\$ digit check states \$C_1\$ to \$C_b\$, and the "go back" state \$B\$:

The initial state \$I\$ simply sets the left most cell to 1: R 1 C1 / x x x.

The \$i^{th}\$ digit check state \$C_i\$ is only called if all previous digits are 1, and the pointer is currently on the \$i^{th}\$ left most digit.

If the current digit is 0, then we've found the left most 0. Set the current digit to 1, and enter "go back" state: L 1 B.
If the current digit is 1, set that digit to 0 and enter the next digit check state: R 0 C(i+1). If this is the last digit check state (\$C_b\$), then halts, since this means the current number is 111..1.

"Go back" state \$B\$ is called after the number is incremented, to reset the pointer to the unit digit and start a new cycle. This state simply moves left until it sees the 1 that marks the start of the number. It then moves one step right to the unit digit, and calls the first digit check state \$C_1\$: L 0 B / R 1 C1.

Time complexity
With \$n\$ states (counting \$n-2\$ bit integers), a counter machine runs for \$2^n-n-1\$ steps.
states  steps
     3      4
     4     11
     5     26
     6     57
     7    120
     8    247
     9    502
    10   1013
    11   2036
    12   4083
    13   8178
    14  16369
    15  32752

Bridging the gap
The above scheme only allows us to generate machines with the exact number of steps in the table above. This means that we are stuck if the number of steps falls in the "gaps" between the above numbers. Thankfully, there is a simple scheme that allow us to add some extra steps to a machine, at the cost of at most 1 state.
For example, from the above table, we know that a counter with 6 states runs for 57 steps, and a machine with 7 states runs for 120 steps. There are 62 numbers in the gap between them (58 to 119). This means that we need to be able to extend a 6-state machine to have 1 to 62 extra steps. (In general, we need a scheme to extend an \$n\$-states machine by 1 to \$2^n-2\$ steps).
First, some notation: let's \$S^0\$ and \$S^1\$ be the "half-states" of \$S\$, aka \$S\$ when the current cell is 0 or 1.
Let's look at how many time each half-state is called in an original 6-state counter machine:
                I    B   C1   C2   C3   C4
cur_char = 0    1   11    8    4    2    1
cur_char = 1    0   15    8    4    2    1

Observation 1
The number of times each digit check half-state is called is always a power of 2. Furthermore, the transition afterward is always \$C_i^0 \rightarrow B^x\$ (refer to the state transition diagram above). This means that we can add an extra half-state in between (aka \$C_i^0 \rightarrow X \rightarrow B^x\$). The extra half-state simply wastes a step before transitioning to \$B\$. The number of extra steps gained is equal to the number of times \$C_i^0\$ is called.
By selecting which \$C_i^0\$ are connected to this extra half-state \$X\$, we can add any number of extra steps from 1 to 15 (since \$15=8+4+2+1\$), at the cost of 1 extra half-state.

For example, in the modified counter above, \$C_1^0\$ and \$C_3^0\$ transitions through \$X\$ before reaching \$B\$. Since \$C_1^0\$ is called 8 times and \$C_3^0\$ is called 2 times, \$X\$ is called 10 times in total, adding an extra 10 steps to the machine.
Observation 2:
Both \$B^1\$ and \$I^0\$ transitions to state \$C_1\$. Furthermore, both \$B^1\$ and \$I^0\$ sets the current cell to 1, then moves right. Thus, we can have \$B^1 \rightarrow I^0 \rightarrow C_1^x\$. This gives us an extra 15 steps for free.
Furthermore, for each additional half-state inserted between \$I^0\$ and \$C_1^x\$, the machine runs for 16 extra steps. For example, using 2 extra half-state, we can gain \$15+16+16=47\$ extra steps.
By combining the 2 observations, we can reach any number of extra steps between 1 and 62 inclusive, using at most 3 extra half-states (1 half-state in observation 1, 2 in observation 2, which gives at most \$15 + 47 = 62\$ extra steps).

For example, in the machine above, \$I^0\$ and 2 extra half-states are added between \$B^1\$ and \$C_1^x\$, adding \$15+16+16 = 47\$ extra steps. Another extra half-state is added between the digit checks and \$B\$, adding 10 extra steps. In total, this machine has 57 extra steps compared to the base machine.
This process can be generalized to any \$n\$-state counter machine.
Note that since \$I^1\$ is unused in the base machine, we already start with a free half-state. This means that we only need at most 1 extra state \$E\$ (aka 2 half-states \$E^0\$ and \$E^1\$).
Code explanation
If you want to take a look at the code, the states are ordered as follow:

Initial state \$I\$
Go back state \$B\$
Digit check states from \$C_1\$ to \$C_b\$
Extra state \$E\$ (if needed)


Haskell — 70 characters

data N a=N{v::a,c::[N a]}
d n=f[n][]
f(x:y)=f(c x++y).(++[v x])
f _=id

In a more readable format:

data Node a = Node {value::a, children::[Node a]}

dfs :: Node a -> [a]
dfs node = dfs' [node] []
  where dfs' [] result = result
        dfs' (x:xs) result = dfs' (children x ++ xs) (result ++ [value x])

Sample tree:

sampleTree =
    Node 1 [Node 2 [Node 3 [Node 4 [],
                            Node 5 []],
                    Node 6 []],
            Node 7 [],
            Node 8 [Node 9 [Node 10 [],
                            Node 11 []],
                    Node 12 []]]

Sample run:

*Main> dfs sampleTree
[1,2,3,4,5,6,7,8,9,10,11,12]


C.U.S.R.S - The Completely Useless String Refactoring System!

Python 3 (164 194 186 181 168 165 bytes)

p=0
w,*x=input().split()
for i in x:
 if '-'>i:w,p=w[:p]+i[1:]+w[p:],0
 else:
  try:p=w.index(i[1:],p)
  except:p=len(w)
  w=w[:p]+w[p:].replace(i[1:],'',1)
print(w)

Example demonstrating the pointer moving to the end if it doesn't find a substring:

Input: HelloThere -x +Friend
Output: HelloThereFriend

Special thanks to Artyer for saving me 13 bytes.

Another thanks to Artyer for saving me another 3 bytes via the beg parameter of index.

Old answer:

p=0
x=input().split()
w=x[0]
for i in x[1:]:
 if i[0]=='+':
  w=w[:p]+i[1:]+w[p:]
  p=0
 else:
  p=w[p:].index(i[1:])+p
  w=w[:p]+w[p:].replace(i[1:],'',1)
print(w)

Example demonstrating the pointer works (all the examples in the Q work even if you don't factor in the pointer and simply replace on first occurence):

Input: HelloThereCowboy -r -e -y +ySays +Oh
Output: OhHelloTheCowboySays

Edit: Since 2 minutes ago my answer is now invalid according to a comment by the asker.

  aaa -b +b would result with aaab because the pointer would go all the
  way to the end.

Edit2: Fixed.


Python, n≈108

def magic_sequences(n):
    if n==4:
        return (1, 2, 1, 0),(2, 0, 2, 0)
    elif n==5:
        return (2, 1, 2, 0, 0),
    elif n>=7:
        return (n-4,2,1)+(0,)*(n-7)+(1,0,0,0),
    else:
        return ()

This uses the fact, which I'll prove, that the only Magic sequences of length n are:

[1, 2, 1, 0] and  [2, 0, 2, 0] for n=4
[2, 1, 2, 0, 0] for n=5
[n-4, 2, 1, 0, 0, ..., 0, 0, 1, 0, 0, 0] for n>=7

So, for n>=7, one only needs to return a huge tuple. I can do this for up to roughly n=10^8 on my laptop, which is likely limited by memory; any more and it freezes up. (Thanks to trichoplax for the idea of using tuples rather than lists.) Or, if one can instead print a dictionary of nonzero entries, {0:n-4, 1:2, 2:1, (n-4):1}, one can do this for ginormous n.

I prove the uniqueness for n>=7; the other ones can be checked by brute force or casework.

The sum of the entries of l is the total count of all numbers of the list, which is its length n. The list has l[0] zeroes, and so n-l[0] nonzero entries. But by definition l[0] must be nonzero or we get a contradiction, and each of the other nonzero entries is at least 1. This already accounts for a sum of l[0] + (n-l[0]-1)*1 = n-1 out of the overall sum of n. So not counting l[0], there can be at most one 2 and no entry bigger than 2.

But that means the only nonzero entries are l[0], l[1], l[2], and l[l[0]], whose values are at most l[0] and a permutation of 1,1,2, which gives a maximum sum of l[0]+4. Since this sum is n, which is at least 7, we have l[0]>=3, and so l[l[0]]=1. Now, there's at least one 1, which means l[1]>=1, but if l[1]==1 that's another 1, so l[1]>=2, which implies l[1] is the lone 2. This gives l[2]=1, and all the remaining entries are 0, so l[0]=n-4, which completes the solution.


Python 3.8, 75 68 97 63 bytes

lambda s,n:max(l:=[s[j:j+n]for j in range(len(s))],key=l.count)

You can try it online! Increased byte count because, as @xnor kindly pointed out, Python's str.count doesn't count overlapping substrings... But then @xnor's reformulation of what I was doing allowed to slice a third of the bytes!

How:

l:=[s[j:j+n]for j in range(len(s))]

This creates a list of all the substrings in s of size n, plus the suffixes of size n-1, n-2, ..., 1. Then we find the max on that list, with the numerical value being used to sort given by

l.count

That means that if a and b are from l, a > b if a shows up more times in l than b. This means the shorter suffixes are never the result of the max because they only show up once, and even if the correct-sized substrings only show up once, they are first in l so they come out instead of the short suffixes. This allows me to save some bytes in the range used, given that I don't have to prevent i+n from being larger than len(s).

# Python, 83 64 bytes

lambda s,n:max((s[i:i+n]for i in range(len(s)-n+1)),key=s.count)

Thanks to @mypetlion I saved a LOT of bytes :D

You can try it online with my very own incredible test case!


Remove vowels without using too many different characters


Python 3

import string
import random

with open('lorem.txt') as f:
    text = f.read()
number = eval(input("Input number: "))

dictionary = ''.join(ch for ch in text if ch not in set(string.punctuation)).split(" ")

chars = []

for word in dictionary:
    for char in word:
        chars.append(char)

chars = list(set(chars))

occurences = {}

for char in chars:
    occurences[char] = []

for word in dictionary:
   for idx, char in enumerate(word):
        try:
            occurences[char].append(word[idx+1])
        except IndexError:
            pass

lengths = [len(x) for x in dictionary]

result = ""

for _ in range(number):
    length = random.choice(lengths)
    word = random.choice(chars)
    for _ in range(length):
        try:
            word += random.choice(occurences[word[-1]])
        except IndexError:
            break
    result += word + " "

print(result)

Takes text input through a file named lorem.txt and number of words through STDIN.

Samples:

De Finibus:

  bolute moresu xisi libospssev lolu ute tamqump Sercolimo mnci iaerue unt xptemp ptur xiui mumnsc ner citerum hiositius fun Set llu hibol etet mpesi amitap voserata mol iumol ospe pte ell asequmut

Die Verwandlung:

  Frehwauchmi «
      vo ineic venzundenwasender geitende «
      darenenserttem Semint estt Scklode
      Zur
      g ZenÂ»e Orer urd cher
      s
      Bet
      kun renaunn

Pride and Prejudice:

  paime k
      hothenoc 5
      “ 230
      erth ZZWedomincab Mrevoueim Vifedrctogei Come Kidi yol qul
      “Thant Kie Rag 41
      mf vate 12
      Eled 8
      Dathed 1
      mb Bed
      “Y merie xto zasorl h’sh ghasst Wha quce skeniat zan dishond
       othing
      hare hing din

And finally, the Magna Carta:

  wincand zisend
      s
       Pes CEFured indons fequ dindshay ranen Gofun
       OURore ibec 6248 Rofonestheasaven
      sul nthal
      232 rend
      matyont r
       uiconlicend
       ucriof 7 ashesevenye Gerd
       BEndrouse IIns jurig 20000 UREndit mandira 0000000000s
      a
      wic 47 Enccet

It's not my best work.

All I'm doing here is some simple Markov chain recreation of the original text, with word lengths taken from a list of all lengths in the given text.

I sort of hoped for better results, but oh well.


Compute the shortest decimal representation of a IEEE 754 double-precision binary floating-point number

C - 47 45 characters

Counting just the function f, and not including #includes and main.

In C, the %g fprintf specifier will always choose the shortest format. Add a precision specifier equal to the usual maximum precision of double and a bit of casting hocus-pocus to coerce int64 to double and Bob's your uncle.

#include <assert.h>
#include <stdint.h>
#include <stdio.h>

// The following line is what I'm counting...
f(int64_t u){printf("%.14g\n",*(double*)&u);}

int main()
{
    assert(sizeof(int64_t) == sizeof(double));

    f(0x4000CCCCCCCCCCCD);
    f(0x3DDB7CDFD9D7BDBB);
    f(0x40934A456D5CFAAD);
    f(0x3FEFFFFFFAA19C47);
    f(0xC088A8CF13CEE9DD);

    return 0;
}

Output is as per specs:

2.1
1e-10
1234.5678
0.99999999
-789.101112

Summary: C rocks!


Python - 132 chars

Data is read from stdin, starting from the "Qn..."

I=raw_input()
print("%X"%int("".join(`ord(I[x/8])>>(7-x%8)&1`*all(x%f for f in range(2,x))for x in range(2,24024)),2)).decode('hex')


CJam, 45 bytes

0{{)_s:C,2m*{~Ce\is_W%=},,2/:O!CCW%=|}g}ri*SO

Try it online!

How it works

0          e# Push 0 (candidate).
{          e# Loop:
  {        e#   Loop:
    )_     e#     Increment the candidate and push a copy.
    s:C    e#     Cast to string and save in C.
    ,      e#     Get the length of C, i.e., the number of digits.
    2m*    e#     Push all pairs [i j] where 0 ≤ i,j < length(C).
    {      e#     Filter:
      ~    e#       Unwrap, pushing i and j on the stack.
      Ce\  e#       Swap the elements of C at those indices.
      is   e#       Cast to int, then to string, removing leading zeroes.
      _W%= e#       Copy, reverse and compare.
    },     e#     Keep the pairs for which = returned 1, i.e., palindromes.
    ,2/    e#     Count them and divide the count by 2 ([i j] ~ [j i]).
    :O     e#     Save the result (the order) in O.
    !      e#     Negate logically, so 0 -> 1.
    CCW%=  e#     Compare C with C reversed.
    |      e#     Compute the bitwise NOT of both Booleans.
           e#     This gives 0 iff O is 0 or C is a palindrome.
  }g       e#   Repeat the loop while the result is non-zero.
}ri*       e# Repeat the loop n times, where n is an integer read from STDIN.
           e# This leaves the last candidate (the n-th Dennis number) on the stack.
SO         e# Push a space and the order.


Create an ASCII-to-hex table for Mark Watney

JavaScript (ES6), 323 332 353

Edit I managed to shorten this a bit
Step 1, believe it or not, using an array of 16 chars is shorter than toString + toUpperCase
Step 2, fiddling around to use .map instead of for, so that I can transform it all to a single expression function, avoding console.log and/or return.

Edit 2 Moved DEL at place 0, idea borrowed from Cole Cameron

H=x=>(x=[...'0123456789ABCDEF']).map((d,r)=>x[S='slice'](0,8).map(c=>(o+=`   ${w=c*16+r} ${c+d} `[S](-z)+("DELNULSOHSTXETXEOTENQACKBELBS HT LF VT FF CR SO SI DLEDC1DC2DC3DC4NAKSYNETBCANEM SUBESCFS GS RS US ".substr((w+1&127)*3,3)||String.fromCharCode(w)),z=c<5?8:9,'Dec Hex   '[S](0,c<2?z+2:z)),o+=`
`,z=7).join` `,o='')[0]+o

MD5: 41B6ECDE6A3A1324BE4836871D8354FE

Pixel perfect, I'd say

LESS GOLFED

H=x=>(
  x=[...'0123456789ABCDEF'],
  a="DELNULSOHSTXETXEOTENQACKBELBS HT LF VT FF CR SO SI DLEDC1DC2DC3DC4NAKSYNETBCANEM SUBESCFS GS RS US ",
  o='', // the string o will contain the body (16 rows)
  x.map((d,r)=> ( // main loop, r is thr row number, d is the second hex digit to print
    o+=`\n`, z=7,
    x.slice(0,8).map(c=> // loop on 8 columns, c is both column number and digit to print
      (
        // append the column to o
        o += `   ${w=c*16+r} ${c+d} `.slice(-z) + (a.substr((w+1&127)*3,3)||String.fromCharCode(w)),
        z=c<5?8:9, // adjust the column size
        'Dec Hex   '.slice(0,c<2?z+2:z) // column head, right size
      ) // the .map result is the 8 columns heading
    ).join` ` // join the heading in a single string
  ))[0] // any element of the result map is the heading
  + o // concatenate the body
)

Test

H=x=>(x=[...'0123456789ABCDEF']).map((d,r)=>x[S='slice'](0,8).map(c=>(o+=`   ${w=c*16+r} ${c+d} `[S](-z)+("DELNULSOHSTXETXEOTENQACKBELBS HT LF VT FF CR SO SI DLEDC1DC2DC3DC4NAKSYNETBCANEM SUBESCFS GS RS US ".substr((w+1&127)*3,3)||String.fromCharCode(w)),z=c<5?8:9,'Dec Hex   '[S](0,c<2?z+2:z)),o+=`
`,z=7).join` `,o='')[0]+o

/* TEST */
console.log=x=>O.textContent=x

console.log(H())


CP-1610 assembly, 37 bytes
This is simply using macro expansion.
Z EQU 0
MACRO S(n)
(%n%+1)
ENDM
 DCW [expression]

Example
With the expression S(S(Z)) * S(S(S(Z))), this gets compiled as:
00000000 Z
0x0                             Z EQU 0
                                MACRO S(n)
                                (%n%+1)
                                ENDM
                                ;DCW S(S(Z)) * S(S(S(Z)))
                                ;DCW (S(Z)+1) * S(S(S(Z)))
                                ;DCW ((Z+1)+1) * S(S(S(Z)))
                                ;DCW ((Z+1)+1) * (S(S(Z))+1)
                                ;DCW ((Z+1)+1) * ((S(Z)+1)+1)
0000   0006                      DCW ((Z+1)+1) * (((Z+1)+1)+1)
 ERROR SUMMARY - ERRORS DETECTED 0
               -  WARNINGS       0

(compiled with as1600 from the SDK included with jzIntv)


R, 78 75 bytes

Built-ins, you say? Well...

message(paste(as.Date(.leap.seconds)-1,"23:59:60\n"),"2015-06-30 23:59:60")

R has an automatic variable .leap.seconds which contains the date and time of each leap second insertion, given in the system's local time. As of R version 3.2.0, this does not include today, so I've added that manually.

Ungolfed + explanation:

# Convert the datetime values to UTC dates. These will be a day past the
# expected output, so we can subtract 1 to get what we want.
dates <- as.Date(.leap.second) - 1

# Paste the UTC time and a newline onto the end of each date
datetimes <- paste(dates, "23:59:60\n")

# Print each time, including today, on its own line
message(datetimes, "2015-06-30 23:59:60")

You can try it online!


05AB1E, 38 33 32 bytes
-6 bytes thanks to Kevin Cruijssen!
For each possible output this generates the input and selects the matching one. Colors are encoded as B=0, G=1, R=2, Y=3.
3Ý4ãʒU•˜ÐÐÛ•4в4äεœεX-0¢}¬Dràα‚}Q

Try it online!
Commented:
3Ý4ã              # Generate all possible outputs
3Ý                # range [0 .. 3]
  4и              # to the 4th cartesian power

ʒU ... Q          # filter the possible outputs
                  #   where the following equals the input
                  #   and assign the current output to variable X

•˜ÐÐÛ•4в4ä        # encode the 4 guesses
•˜ÐÐÛ•            # compressed integer 2517300803
      4в          # convert to base 4:
                  #   [2,1,1,2,0,0,2,2,3,3,1,2,1,0,0,3]
        4ä        # split into 4 groups:
                  #   [2,1,1,2],[0,0,2,2],[3,3,1,2],[1,0,0,3]

εœεX-0¢}¬Dràα‚}   # compute the score for each guess
ε             }   # map over the guesses ...
 œ                #   take all permutations
                  #     the first will be the original guess
  ε    }          #   map over the permuations ...
   X-             #     subtract the current output
     0¢           #     count the 0's
        ¬         #   get the head without popping
                  #     this is number of correct positions (c)
         D        #   duplicate it       => c, c, [...]
          r       #   reverse the stack  => [...], c, c
           à      #   take the maximum
                  #     this is number of correct colors,
                  #     correct and misplaced (c+m)
                  #                      => c+m, c, c
            α     #   absolut difference => |c-(c+m)|, c = m, c
             ‚    #   pair up     => [c, m]


Java, 303 286 bytes

Saved 17 bytes thanks to @VoteToClose!

Not actually meant to be the shortest, I just thought it would be fun to try in Java.

Creates a list of string variables representing common strings, then creates an array of all the outputs, then prints the right one.

String a(int y){String n="\n",d=">:U",A=" ",B=A+A,C=B+B,D=C+C,a="U"+B+" U"+n,G=D+A,H=C+B,c=d+G+d+n,E=B+A,F=C+E;String[]z={"quack",d,C+A+a+">"+B+": "+a+" >"+E+a+">"+B+": "+a+C+B+"UUU",D+D+B+c+d+D+F+c+B+A+d+F+d+B+c+H+d+G+c+G+d+H+c+H+d+G+c+E+d+F+d+B+c+d+D+F+c+D+D+C+A+d+d+d};return z[y];}

Ungolfed:

String a(int y) {
    String n = "\n", d = ">:U", A = " ", B = A + A, C = B + B, D = C + C,
            a = "U" + B + " U" + n, G = D + A, H = C + B, c = d + G + d + n,
            E = B + A, F = C + E;
    String[] z = { "quack", d, C + A + a + ">" + B + ": " + a + " >" + E + a + ">" + B + ": " + a + C + B + "UUU", D + D + B + c + d + D + F + c + B + A + d + F + d + B + c + H + d + G + c + G + d + H + c + H + d + G + c + E + d + F + d + B + c + d + D + F + c + D + D + C + A + d + d + d };
    return z[y];
}

This is my first answer on this site, so please tell me if I have done something wrong.


Japt, Shaggy, A000290

p#A000290uCnG

Try it online!


Jelly, 15 bytes

,®ÆDL€ṛ©0>/?µƓ#

For input n, this prints the first n highly composite numbers.

For n = 20, it takes less than two seconds on Try it online!

How it works

,®ÆDL€ṛ©0>/?µƓ#  Main link. No implicit input.

            µ    Push the chain to the left on the local link stack.
             Ɠ   Read an integer n from STDIN.
              #  Execute the chain for k = 0, 1, 2, ..., until it returned a truthy
                 value n times. Return the list of matches.

,®               Pair k with the value in the register (initially 0).
  ÆD             Compute the divisors of k and the register value.
    L€           Count both lists of divisors.
           ?     If
         >/        k has more divisors than the register value:
      ṛ©             Save k in the register and return k.
        0          Else: Return 0.

Alternate version, 13 bytes (non-competing)

While the below code worked in the latest version of Jelly that precedes this challenge, the implementation of M was very slow, and it did not comply with the time limit. This has been fixed.

ÆDL®;©MḢ’>µƓ#

Try it online!

How it works

ÆDL®;©MḢ’>µƓ#  Main link. No implicit input.

          µ    Push the chain to the left on the local link stack.
           Ɠ   Read an integer n from STDIN.
            #  Execute the chain for k = 0, 1, 2, ..., until it returned a truthy
               value n times. Return the list of matches.

ÆD             Compute the divisors of k.
  L            Count them.
   ®;          Append the count to the list in the register (initially 0 / [0]).
     ©         Save the updated list in the register.
      M        Obtain all indices the correspond to maximal elements.
       Ḣ       Retrieve the first result.
        ’>     Subtract 1 and compare with k.
               This essentially checks if the first maximal index is k + 2, where
               the "plus 2" accounts for two leading zeroes (initial value of the
               register and result for k = 0).


The Math is Right, But the Answer is Wrong - Robbers


One out of Infinity: Interpolating polynomials

MATL, 38 bytes
ynq3$ZQ'y=' '%+fx^%i'btn:qP&vYDh1J3-h)

Inputs are an array with the x values and an array with the y values.
Try it online!
y          % Inplicitly take the two inputs, and push another copy of the first
nq         % Get its length minus 1. This is the required polynomial degree.
3$ZQ       % Coefficients of polynomial fitted to those data (`polyfit`)
'y='       % Push this string
'%+fx^%i'  % Push format string for `sprintf`
b          % Bubble up the polynomial coefficients to the top of the stack
tn:qP      % Duplicate and produce [n n-1  ... 0] where n is the polynomial degree.
           % These are the exponents
&v         % Concatenate vertically. This gives a 2D array with the coefficients in
           % the first row and the exponents in the second
YD         % Apply `sprintf` to this array with previous format string. The array
           % is read in column-major order: down, then across
h          % Concatenate 'y=' and formatted string representing the polynomial
1J3-h)     % The string ends in '...x^0'. Remove last three chars to delete this.
           % Implicitly display


Code that runs the Game of Life on itself


Python 2, 79 78 73 72 bytes

n,d=input()
c='|\/'[d]
i=n
while i:print' '*(n-i*d)+c,i%2*c or' ',c;i-=1

Try it online!

Takes [1,0,-1] for [north-west, north, north-east]

-1 byte, thanks to Neil


Python 2, 82 bytes

f=lambda n,s=1:n*"'"and"  _"*s+f(n-1,0)+"_"*(n-2)+"\n%c|%s|"%(64+n,"_"*n)+f(n-1,0)

I noticed no one had posted the binary recursion method and decided to give it a shot...and now with a trick borrowed from Sherlock9, it is the shortest python answer! (Also, thanks to xnor for one more shortening.) (And then Dennis who shaved a handful more...)

Ungolfed:

def f(n,s=1):
    if n>0:
        strsofar = "  _" if s==1 else ""        #prepend overhang for top-level call
        strsofar += f(n-1,0)                    #build the city above the current line
        strsofar += "_"*(n-2)                   #add the overhang to reach the current tower
        strsofar += "\n%c|%s|" % (64+n, "_"*n)  #write the current (center) line
        strsofar += f(n-1,0)                    #build the city below the current line
        return strsofar
    else:
        return ""                               #only this line will be executed when n==0 (base case)

print "  _"+f(input())


Haskell, 283 275 bytes

The function g should be called with the matrix and the two ranges as arguments. The matrix is just a list of lists, the ranges each a two element list.

import Data.List
t=transpose
u=tail
z=zipWith
l%x=sum$z(*)l$iterate(*x)1                                   --generate powers and multiply with coefficients
e m y x=[l%x|l<-m]%y                                         --evaluate the encoded polynomial
a#b=[a,a+(b-a)/102..b]                                       --create a range
g m[u,w][i,j]=unlines$v[map((0<).e m y)$u#w|y<-i#j]          --evaluate the function on the grid, get the sign
f g=u[u$u$map fst$scanl(\(r,l)c->(c==l,c))(1<0,1<0) l|l<-g]  --find +- or -+ transitions within lines
a&b|a&&b=' '|0<1='#'                                         --helper function for creating the string
v g=z(z(&))(f g)(t$f$t g)                                    --create the string

Here the outputs for the more interesting cases: Note that I had to downsize the resultion from 100x100 to about 40x40 such that it sill fits in the console (just change the hardcoded 102 to a smaller number). Also note that the y-axis is pointing downwards.


Python 3, 144 140 131 130 137 bytes
Damn bugs :(
O=""
for Q in input():
 C="X%07dX"%int(bin(ord(Q))[2:])
 while"1">C[8-len(O)%8]:C="."+C
 O+=C
O+="."
while O:print((O+"."*8)[:8]);O=O[8:]

This is really straight forward.
Ungolfed with explanation
# initialize output buffer
output = ""
# loop through input
for char in input():
    # get charcode, binary, remove 0b, parse as int, format
    code = "X%07dX" % int(bin(ord(char))[2:])
    # pad code while the line starting character would be 0
    while "1" > code[8 - len(output) % 8]:
        code = "." + code
    # append result to output buffer
    output += code
# add dot to ensure padding in end
output += "."
# loop while any output is left
while output:
    # print line of output, with padding
    print((output + "." * 8)[:8])
    # remove printed output
    output = output[8:]


Make two numbers co-prime while preserving their least common multiple

Jelly, 21 13 bytes
ÆEz®0iṂ$¦€ZÆẸ

Try it online!

If a = 2A · 3B · 5C · … and b = 2α · 3β · 5γ · …, then we compute

c = 2A>α?A:0 · 3B>β?B:0 · 5C>γ?C:0 · …

d = 2A>α?0:α · 3B>β?0:β · 5C>γ?0:γ · …

Now lcm(c, d) = 2max(A>α?A:0, A>α?0:α) · … = 2max(A, α) · 3max(B, β) · … = lcm(a, b)
and gcd(c, d) = 2min(A>α?A:0, A>α?0:α) · … = 20 · 30 · 50 · … = 1.

In other words: start from (c, d) = (a, b). Then, for each prime, divide that prime all the way out of the factorization of either c or d: whichever has the smallest exponent for that prime. (In this implementation, in case of a tie, c loses its exponent.)
So if a = 2250 = 21 · 32 · 53 and b = 360 = 23 · 32 · 51,
then c = 20 · 30 · 53 = 125 and d = 23 · 32 · 50 = 72.
Jonathan Allan golfed down a whopping 8 bytes! Thank you~


Number of ways to sum [1..n] with [n+1..2n] such that each sum is prime

CJam, 38 35 32 bytes

0{)_e!{ee{1b1$+)_m!)\)%},!},,p}h

This is an infinite list version. If you run it using the Java compiler, you will keep on getting result for increasing n on each line until the program crashes (if it does. Did not test).

For sanity, run the finite version using this link. You can change the number in the input to see a longer list.

How it works:

0{                            }h  e# This acts as an infinite do-while loop here
  )_                              e# Starting from 0, increment the number and copy it
                                  e# Lets call this number at each iteration as N
    e!                            e# Get all possible permutations of the array 0..N-1
      {                   },      e# Filter the list of permutations based on this code block
       ee                         e# Convert the permutation array into an [index value]
                                  e# pair array. For ex. [5 2]ee gives [[0 5] [1 2]]
         {             },         e# Pass each index value pair through this filter
          1b1$+)                  e# Sum the index and value and add current N + 1 to it
                                  e# At this point, we have something equivalent to
                                  e# pairwise addition of [1 .. n] and [n .. 2n - 1]
                _m!)\)%           e# Now we do ((N - 1)! + 1)%N to see if N is prime
                                  e# This is Wilson's theorem and will give 0 for primes
                         !        e# Now we have a filtered index-value pairs which all
                                  e# correspond to non-prime numbers. If the list is empty,
                                  e# Then all numbers are prime. Thus we do a ! on empty list
                                  e# to get truthy.
                            ,p    e# Take the total permutations where X + pN(Y) are all
                                  e# primes and print the number to STDOUT immediately
                                  e# We are left with the initial incremented N on stack
                                  e# which is always non-zero, so the loop continues
                                  e# infinitely

UPDATE: 2 bytes saved, thanks to Martin!


Jelly, 8 bytes

²R²+²Æ²O

This answer is non-competing, since it uses features that have been implemented after the challenge was posted. Try it online!

This approach does not use floating point math, so it will give the correct answer as long as the intervening lists can fit into memory.

Idea

If (a, b, c) is a Pythagorean triple, there are strictly positive integers k, m, n such that the set equality {a, b} = {km2 - kn2, 2kmn} holds.

In particular, this means that a < b2 and b < a2, so for input a we can simply check if a2 + b2 is a perfect square for each b in {1, … a2}.

Code

            Input: x

²           Compute x².
 R          Get get range 1 ... x².
  ²         Square each integer in that range.
   +²       Add x² to each resulting square.
     Æ²     Check if the resulting sums are perfect squares.
       O    Get all indices of ones.


Ruby, 84 79 77 74 bytes

->x{y=1;x+="#{x}".reverse.to_i while(2...x).any?{|z|0==y=x%z}&&x%11>0;y>0}

Try it online!

   If I got it right, when we reach a multiple of 11 we can stop (we will only get multiples of 11 after that)


Jelly, 18 bytes
ŒṪÆịœc4ṗ2ạ/€QLƲ€ċ3

Try it online!
Input is a two-dimensional list of 0 and 1 (or any other falsy and truthy value).
Explanation
The idea is that for every four distinct points, we calculate the distance between each pair and if there are exactly three distinct distances (including 0), it's a square. (There are other shapes with this property, but they don't fit on a square grid; see @aPaulT's comment.)
ŒṪÆịœc4ṗ2ạ/€QLƲ€ċ3   Main monadic link
ŒṪ                   Get the coordinates of truthy points
  Æị                 Convert to complex numbers
    œc4              Get all combinations of size 4
               €     For each
              Ʋ      (
       ṗ2              Cartesian square
         ạ/            Absolute difference
           €             of each pair
            Q          Find unique items
             L         Length
              Ʋ      )
                ċ3   Count the occurences of 3


Fourth grade math homework for the week: A most inefficient traveling salesman

Mathematica, 55 or 90 bytes

Mathematica you said? ;)

FirstCase[Permutations@#,p_/;Tr@Abs@Differences@p==#2]&

This is an anonymous function that first takes the positions of the friends (in any order), and then the target length. It returns Missing[NotFound], if no such path exists.

FirstCase[Permutations@#,p_/;Tr@Abs@Differences@p==#2]&[{0, 5, 7, 13, 16, 17}, 62]
(* {7, 16, 0, 17, 5, 13} *)

I can save four bytes if returning all valid paths is allowed (FirstCase -> Cases).

Returning an array of strings is a bit more cumbersome:

FromCharacterCode[68+#]&/@Ordering@FirstCase[Permutations@#,p_/;Tr@Abs@Differences@p==#2]&


Almost Illegal Strings, Mark II (Robbers)

Python 2, 7 bytes, cracks xnor's post

0xbin()

Try it online!
The answer is easy to understand if syntax highlighting for above snippet works correctly.
So bad. The syntax highlighting did work correctly. But SO changed their render library... Anyway, above code is:
0xb in ()


Python 2.7, 285 bytes

from itertools import*
from random import*
def f(s,r):
 p=[];n=1;k=1;P=1;d=choices('123456',k=r);D=permutations(d,r);O=product('+-*/',repeat=r-1)
 while-~s*3>n:p+=P%k*[k];n,k,P=n+P%k,k+1,P*k*k
 return any(n in{eval('int(%s)'%'%s'.join(i)%o)for i in D for o in O}for n in p[-4:-1])

Technically conforms to the specifications of the challenge. Only returns True/False, does not expose the dice rolls used or the expression used to caller.

Also, this algorithm ignores grouping, since we can perform the same operations without grouping by using ordering instead. (This would not be true if exponentiation was one of the possible operations, for example.)

Exponential runtime, since it generates all possibilities and then checks if at least one solution exists.


Golfscript, 46 42 40 38 chars

~])\({[{.@-\}*])\}*;]-1%){0\{+.}/p]}*;

This uses a simple difference table approach, which is described in more detail on my GolfScript blog.


Reduction to Traveling Salesman Problem, O(n^2*2^n).

In the above, n is the number of vertices in the graph.

I will give a description of the algorithm for now. Starting with the input graph, carry out the following steps:

Create a new graph with edge weights equal to the negation of the input edge weights. These weights represent the value to the taxi driver of traversing those edges.
Let N be the sum of all of the negative weights in the (new) graph minus 1. Add N to each outgoing edge from a node on the shortest path (as given in the input). This represents the fact that the taxi driver absolutely must cross each vertex in the shortest path.
Now, use dynamic programming to solve the traveling salesman problem on this new graph as follows:
Next, create a memo table, m, with entries that are pairs, (v,S), where v is the final vertex in the (partial) path created so far, and S is a subset of the vertices in the graph. The weight associated with this entry will be the minimum sum of edge weights to reach v after having passed through the vertices in S. Also, maintain a parent pointer.
Initialize the memo table with the entry m[(source,{source}]=0, p[(source,{source}]=None.
Fill in the memo table, using the recursion that m[(v,S)] = min(m[(u,S-{v})]+w[(u,v)] for u in S), where w is the the edge weight dictionary. Create parent pointers accordingly.
Using the completed memo table, find the minimum value of m[(destination,S)], for all subsets S of the input vertices.
Trace the parent pointers from this minimum value backwards until we reach the source node. The resulting path is the solution.

I don't feel like coding that all up, but I believe it is a correct solution. It runs in O(n^2*2^n) time because there are n*2^n entries in the memo table, and each is generated by taking a minimum over no more than n possibilities. All the other work takes far less than that amount of time.

This solves the problem because the traveling salesman path must go through all of the vertices on the shortest path, because skipping one of those vertices results in an increase in the traveling salesman cost of N, which cannot be offset by the negative edge weights in the graph, since N was chosen to be more negative than all of them combined.


Common Lisp, 368 340

Encoding is implementation-dependent, but UTF-8 is generally supported among implementations (see also the set of standard characters that must be supported).

(ql:quickload'cl-ppcre)(lambda(s g)(ppcre:scan(do(e(L(coerce g'list))c p)((not L)`(:sequence,@(reverse e):end-anchor))(push(case(setf c(pop L))(#\*'(:regex".*"))(#\? :everything)(#\[(prog1`(,(or(and(char=(car L)#\^)(pop L):inverted-char-class):char-class),@(subseq L 0(setf p(position #\] L :start 1))))(setf L(nthcdr(1+ p)L))))(t c))e))s))

Pretty-printed

(lambda (s g)
  (cl-ppcre:scan
   (do (e
        (l (coerce g 'list))
        c
        p)
       ((not l) `(:sequence ,@(reverse e) :end-anchor))
     (push
      (case (setf c (pop l))
        (#\* '(regex".*")
        (#\? :everything)
        (#\[
         (prog1
             `(,(if (char= (car l) #\^)
                    (prog1 :inverted-char-class (pop l))
                    :char-class)
               ,@(subseq l 0 (setf p (position #\] l :start 1))))
           (setf l (nthcdr (1+ p) l))))
        (t c))
      e))
   s))

Converting to regex is not so hard when using non-string representations of regexes. CL-PPCRE is a regular expression library by Edi Weitz which accepts two ways of defining such expressions:

the usual string-based syntax, or
a more lispy approach using a DSL

Today I answered a question about alternative syntaxes for regular expressions, and this challenge is a good example of why a structured format can be useful instead of strings.

Example

For the following glob, "ww*[w-c]?*", the regular expression being built is described by this form:

(:sequence #\w
           #\w
           (:regex ".*")
           (:char-class #\w #\- #\c)
           :everything
           (:regex ".*"))

And we match "www-". The (:char-class ...) list takes indiviudal charaters, which does not need escaping like it would if I wrote "[w-c]" as a string regex.

Test suite

(loop for (glob match no-match) in
      '(("w*c*d"      ("wildcard")    ("wildcards"))
        ("ww*w*d"     ("wwwdwd")      ("wwd"))
        ("ww*[w-c]?*" ("www-" "wwcc") ("wwc"))
        ("[a-c]"      ("-")           ("b"))
        ("^[*][^]]"   ("^*[")         ("^?[" "^*]" "**]"))
        ("w*\\*s"     ("wild\\ness")  ()))

      for matchp = (lambda(s)(funcall *fun* s glob))

      always (every matchp match)
      never (some matchp no-match))

=> T


The Great Battle Conundrum- Who are Alive?

Jelly, 16 bytes
Ḥ,‘$€F>ÐḟðƬF⁴R¤ḟ

Try it online!
Ḥ,‘$€F>ÐḟðƬF⁴R¤ḟ  Main Link
         ðƬ       While the results don't reach a fixed point
Ḥ                 Double each value (killed soldier)
 , $              Pair            with
    €                  each value
  ‘                                    itself incremented
     F            Flatten the result
       Ðḟ         Filter out (remove) elements that are
      >           Greater than the right argument (the number of soldiers)
           F      Flatten the accumulated list of killed soldiers
               ḟ  Filter; remove the killed soldiers from
            ⁴R¤   [1, 2, ..., N], the list of all soldiers


Bash + curl + iproute2, 54 50 49 48 33 bytes

ip r g 1|awk '$0=$7'
curl eth0.me

Thanks @DomHastings for golfing off 1 byte!

Thanks @Sisyphus for coming up with a shorter URL!

Thanks @zeppelin for golfing off 9 bytes!


Brachylog, 8 bytes

{~×≜+}ᶜ¹

Try it online!

Explanation

{    }ᶜ¹  Count unique results of this predicate:
 ~×       Create list of numbers whose product is the input.
   ≜      Label the list, forcing it to take a concrete value.
    +     Take its sum.

I'm not entirely sure why ~× only produces lists with elements above 1, but it seems to do so, which works great in this challenge.


Find how many pair elements sums up to N

Pyth, 9 bytes

/sM{.cSE2

Test suite

Takes the number and array newline separated.

Explanation:

/sM{.cSE2
/sM{.cSE2Q    Implicit variable introduction.
              Implicit: Q = eval(input())
       E      Take the array as input.
      S       Sort the input.
    .c  2     Form all ordered pairs.
   {          Deduplicate.
 sM           Map each to its sum.
/        Q    Count the number of occurrences of Q in the resulting list.


JavaScript, 285 bytes

(My first answer here after lurking here for a while)

d=prompt(m=prompt(e='MutableCardinalFixedAirWaterFireEarthCapricornAquariusPiscesAriesTaurusGeminiCancerLeoVirgoLibraScorpioSagittarius'.match(/[A-Z][a-z]+/g)));alert(m>0&m<13&d>0&d<29-~'202121221212'[--m]?e[n=7+m%12+(d>18-~'121012333413'[m])]+', '+e[n%4+3]+', '+e[n%3]:'Invalid date')

The first prompt() is the month in numerical form, and the second prompt() is the day of the month (Ignore the text of the prompt). Leading zeroes are optional for both. The output is displayed with alert(). (Thanks to bitpwner, Snack, edc65, and core1024 for helping shorten the code.)

Try it above using Stack Snippets or at http://jsfiddle.net/8vq89/5/.

Code with whitespace and comments to explain the confusing parts added:

var m = prompt(), d = prompt(),
e = 'MutableCardinalFixedAirWaterFireEarthCapricornAquariusPiscesAries\
TaurusGeminiCancerLeoVirgoLibraScorpioSagittarius'.match(/[A-Z][a-z]+/g);
alert(m > 0 && m < 13 && d > 0
      & d < 29 - ~'202121221212'[--m] /* ~ is bitwise NOT, which yields -(x + 1). It also
                                         converts a string to a number. Subtracting that
                                         number from 29 gives the number of days in the
                                         month given. */
      ? e[n = 7 + // 7 is added to skip over the 7 qualities and elements in array e.
      m % 12 // The modulus allows dates near the end of December to wrap around to January.
      + (d > 18 - ~'121012333413'[m])] + ', ' +
      e[n % 4 + 3] + /* Qualities and elements follow a pattern, so the modulus determines
                        which one it is. 3 is added to skip over the 3 qualities. */
      ', ' + e[n % 3] : 'Invalid date')


Jelly, 3 bytes

+SḂ

Try it online!

How it works

+SḂ  Main link. Argument: A (array)

 S   Compute the sum of A.
+    Add the sum to each element of A.
     Using _ (subtraction) or ^ (bitwise XOR) would also work.
  Ḃ  Bit; compute the parity of each resulting integer.


Haskell, 50 bytes

f.read
f(a:b)='[':show(a+0)++'|':f b++"]"
f _="[]"

Try it online!

The +0 lets the Haskell type checker know that we are dealing with lists of numbers, so read will parse the input string for us.


Jelly, 20 bytes, score  53  57
“¦/œḌ⁼ƥ~ẹµḲ5&Ċd@ṡ»ḲY

Try it online!
Wordsearch:
a d m i s s i o n
h o u s e h o l d
s o m e t h i n g
g e n e r a l l y
p o t e n t i a l
t h e r e f o r e

Words:
admission generally household potential something therefore
general mission
house stair there thing
ally gene here hill hold miss some tent thin
air all due era for hat her ill oil old one pot see set son ten the use
ad ah at do go he hi ie in me ms oh on or so to us
i

Previous
...the dictionary referenced in the question has changed since this was posted so this would drop to a score of 33.
Jelly, 23 bytes, score  150 154 158  160
“RʂȥḄ0ḣq⁾÷yḊzIḥẊḥYx »ḲY

Try it online!
Used Python to search for boards; there are, no doubt, higher scores possible though.
The board:
donations
beverages
placement
performed
metallica
thousands

The words:
['a', 'ac', 'ace', 'ae', 'ag', 'age', 'ages', 'al', 'all', 'am', 'an', 'and', 'ar', 'art', 'as', 'at', 'ati', 'au', 'b', 'be', 'beverage', 'beverages', 'bp', 'c', 'ca', 'cd', 'ce', 'cement', 'cf', 'd', 'da', 'das', 'db', 'do', 'don', 'donation', 'donations', 'ds', 'e', 'ec', 'ed', 'ee', 'eh', 'el', 'em', 'en', 'ent', 'er', 'era', 'es', 'et', 'ev', 'eve', 'ever', 'f', 'fa', 'fo', 'for', 'form', 'formed', 'g', 'ge', 'gem', 'h', 'ho', 'i', 'ia', 'ic', 'in', 'io', 'ion', 'l', 'la', 'lace', 'le', 'lee', 'li', 'll', 'ls', 'm', 'me', 'med', 'men', 'ment', 'met', 'meta', 'metal', 'metallic', 'metallica', 'mi', 'min', 'mr', 'mt', 'n', 'na','nat', 'nation', 'nations', 'nd', 'ne', 'nec', 'ns', 'nt', 'nv', 'o', 'oe', 'og', 'ol', 'on', 'ons', 'or', 'ou', 'p', 'pe', 'per', 'perform', 'performed', 'pl', 'place', 'placement', 'pm', 'pp', 'ppm', 'r', 'ra', 'rage', 're', 'rf', 'rl', 'rm', 'rt', 's', 'sa', 'san', 'sand', 'ss', 'st', 'std', 't', 'ta', 'tall', 'td', 'th', 'thou', 'thousand', 'thousands', 'ti', 'tion', 'tions', 'to', 'tr', 'treo', 'u', 'us', 'usa', 'v', 'va', 'var', 've', 'ver']

The search

Note LIMIT_TO_N_BEST_NINES limits the search - lower numbers try fewer boards by never using the lower scoring rows (nine letter words) which will find "good" scores quicker, while higher numbers (up to 909 - the number of 9 letter words in the dictionary) will search more boards (and likely never complete!).
f = open(filePath, 'r')
ws = set(w.replace('\n', '').lower() for w in f.readlines())

def iterSubWords(w, ws):
    for l in range(1,len(w)+1):
        for s in range(len(w)-l+1):
            if w[s:s+l] in ws: yield w[s:s+l]

nines = sorted([w for w in ws if len(w) == 9], key=lambda w:len(tuple(iterSubWords(w, ws))), reverse=1)

def diags(rows):
    for rs in range(len(rows)):
        yield ''.join(rows[rs + x][x] for x in range(min(len(rows) - rs, len(rows[0]))))
    for cs in range(1, len(rows[0])):
        yield ''.join(rows[x][cs + x] for x in range(min(len(rows[0]) - cs, len(rows))))

def diagWords(rows, validWords):
    for d in diags(rows):
        for sw in iterSubWords(d, validWords): yield sw

def allWordsOnBoard(rows, validWords):
    r = set()
    for row in list(rows) + [''.join(col) for col in zip(*rows)]:
        for validWord in iterSubWords(row, validWords): r.add(validWord)
    for validWord in diagWords(rows, validWords): r.add(validWord)
    return r

from itertools import combinations, permutations

LIMIT_TO_N_BEST_NINES = 107

m = 0
for wl in combinations(nines[:LIMIT_TO_N_BEST_NINES], 6):
    fws = allWordsOnBoard(wl, ws)
    if len(fws) > m:
        for p in permutations(wl):
            fws = allWordsOnBoard(p, ws)
            if len(fws) > m:
                m = len(fws)
                print(m, p)


Print the alphabet without using each vowel


Pyth, 4 bytes

eo_S

Try it online

Explanation

eo_S
 o  NQ    Order the inputs...
  _S      ... by their reversed sorted values...
e         ... and take the last.


05AB1E, 12 11 10 bytes

Supports the sequence up to 2^95 = 39614081257132168796771975168

₃ÝoŒʒg≠}Jù

Try it online!

Explanation

₃Ý            # push range [0 ... 95]
  o           # raise 2 to the power of each
   Œ          # get a list of all sublists
    ʒ         # filter, keep elements that satisfy:
     g        # length
      ≠       # false (not equal to 1)
       }      # end filter
        J     # join each
         ù    # keep numbers of length matching the input

Saved 1 byte thanks to Erik the Outgolfer
Saved 1 byte thanks to Riley


Hello human, I want to recover my little cat pics

PowerShell (v4), 58 49 bytes

(gc list.txt)-replace"^[^-]*`t"|mv -des withmodel

# Previous 58 byte version
(gc list.txt)-notmatch'^-'-replace".+`t"|mv -des withmodel

get-content of the list
remove camera models up to the tab by replacing them with nothing. This won't change the lines starting with "-".
pipe into the move command, destination folder 'withmodel'. This will hit a lot of errors for the unchanged lines starting with "-", but since none of the files has a "-" in the name, that won't move any incorrect files, only the right files will be moved.


JavaScript (ES6),  93 83 80  79 bytes
Saved 1 byte thanks to @tsh
Returns the \$n\$th term, 1-indexed.

i=>eval("for(n=k=1;k=(a=[...k+[n-k]+k])+''!=a.reverse()?k-1||--i&&++n:++n;);n")

Try it online!
How?
Given \$n\$, we test whether there exists any \$1\le k\le n\$ such that both \$k\$ and \$n-k\$ are palindromes. If we do find such a \$k\$, then \$n\$ is the sum of two palindromes.
The trick here is to process \$k\$ and \$n-k\$ at the same time by testing a single string made of the concatenation of \$k\$, \$n-k\$ and \$k\$.
Example:
For \$n=2380\$:

we eventually reach \$k=1441\$ and \$n-k=939\$
we test the string "\$1441\color{red}{939}1441\$" and find out that it is a palindrome

Commented
NB: This is a version without eval() for readability.
i => {                       // i = index of requested term (1-based)
  for(                       // for loop:
    n = k = 1;               //   start with n = k = 1
    k =                      //   update k:
      ( a =                  //     split and save in a[] ...
        [...k + [n - k] + k] //     ... the concatenation of k, n-k and k
      ) + ''                 //     coerce it back to a string
      != a.reverse() ?       //     if it's different from a[] reversed:
        k - 1                //       decrement k; if the result is zero:
          || --i             //         decrement i; if the result is not zero:
            && ++n           //           increment n (and update k to n)
                             //         (otherwise, exit the for loop)
      :                      //     else:
        ++n;                 //       increment n (and update k to n)
  );                         // end of for
  return n                   // n is the requested term; return it
}                            //


Python 2, 222 bytes

import sys
y=h=v=0;B={}
for l in sys.stdin:
 z=y;y+=2j
 while l:
    if"0"<l:B[z]=int(l[:2])
    l=l[2:];z+=1
while B:C=B;B={b:B[b]for b in B if(h<B[b])+sum(3>abs(c-b)for c in B)/7};a=C==B;h+=a;v+=a*sum(h>B[b]for b in B)
print v

Reads input through STDIN and writes the result to STDOUT.

Explanation

We start at zero and incrementally increase the water level as follows:
Suppose that the water level is h, and we want to add 1 centimeter of water.
We'll call hexagons of height h or less, ones that are about to go (or already are) underwater, "submerged."
The water will spill through any submerged hexagon that isn't surrounded by six neighbors.
We eliminate all such hexagons; of course, now some other submerged hexagons might have less than six neighbors, and they need to be eliminated as well.
We continue in this fashion until convergence, i.e., until all remaining submerged hexagons have exactly six neighbors.
At this point we add the number of submerged hexagons (the gained water volume) to the total count, and increment the water level.

Eventually, all the hexagons will have been eliminated and we halt.


Jelly,  26  24 bytes

O%48«⁵µ13R«⁵ẋ4œ-+ṖS$>21S

A monadic link accepting a list of characters (using either the lower-case option OR the upper-case option with 1 for A) which returns the numerator (the number of 49ths) in [0,49].

Try it online! Or see the test-suite

How?

Note that by using lower-case the minimum of 10 and the ordinals modulo by 48 gives the card values. The same holds for upper-case T, J, Q, K and 1 for an ace, as shown on the right (but an upper-case A does not work):

     card:   a   2   3   4   5   6   7   8   9   t   j   q   k   |   1   T   J   Q   K
  ordinal:  97  50  51  52  53  54  55  56  57 116 106 113 107   |  49  84  74  81  75
   mod 48:   1   2   3   4   5   6   7   8   9  20  10  17  11   |   1  36  26  33  27
min(_,10):   1   2   3   4   5   6   7   8   9  10  10  10  10   |   1  10  10  10  10

O%48«⁵µ13R«⁵ẋ4œ-+ṖS$>21S - Link: list of characters   e.g. "q3a"
O                        - ordinals (of the input list)    [113, 51, 97]
 %48                     - modulo by 48                    [17,3,1]
     ⁵                   - ten
    «                    - minimum                         [10,3,1]
      µ                  - start a new monadic chain
       13R               - range of 13                     [1,2,3,4,5,6,7,8,9,10,11,12,13]
           ⁵             - ten                             10
          «              - minimum                         [1,2,3,4,5,6,7,8,9,10,10,10,10]
            ẋ4           - repeat four times               [1,2,3,4,5,6,7,8,9,10,10,10,10,1,2,3,4,5,6,7,8,9,10,10,10,10,1,2,3,4,5,6,7,8,9,10,10,10,10,1,2,3,4,5,6,7,8,9,10,10,10,10]
              œ-         - multi-set difference            [1,2,3,4,5,6,7,8,9,10,10,10,10,1,2,3,4,5,6,7,8,9,10,10,10,10,1,2,3,4,5,6,7,8,9,10,10,10,10  ,2  ,4,5,6,7,8,9   ,10,10,10]
                   $     - last two links as a monad:
                 Ṗ       -   pop                           [10,3]
                  S      -   sum                           13
                +        - add (vectorises)                [14,15,16,17,18,19,20,21,22,23,23,23,23,14,15,16,17,18,19,20,21,22,23,23,23,23,14,15,16,17,18,19,20,21,22,23,23,23,23,15,17,18,19,20,21,22,23,23,23]
                    >21  - greater than 21?                [0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1]
                       S - sum                             19


shell + sed + dc, 56 61 bytes

sed '1i0
s/.//2g;y"idmhe"+-*/q";i1
/[*/]/i1+
/P/crdn'|dc

Try it online!
Converts the program into a dc program, then evaluates it as dc code. This takes the input separated by newlines. Note that dc is stack-based and uses reverse polish notation, so 5 2- gives 3, and numbers are always rounded down.
The input is first piped to sed
1i0 on the first line of input, insert (prepend) a 0, this will be the accumulator
s/.//2g remove everything but the first character on each line
y"idmhe"+-*/q" transliterate idmhe into +-*/q respectively, + - * / are the arithmetic commands and q quits the program
i1 on every line insert a 1 - this satisfies addition and subtraction
/[*/]/ on every line containing * or /, i1+ additionally insert 1+ because of the preceding 1, which dc will eventually evaluate into 2
/P/ on every line containing P, crdn change it into rdn, equivalent to reverse the top two elements, to rid the inserted 1, and duplicate and output as a number without newline (whilst popping it, hence the earlier duplicate) in dc
Now this is evaluated as a dc expression.


05AB1E, 130 128 133 131 124 123 122 121 bytes
žežfžg)V0[Y`UD3‹©12*+>₂*T÷®Xα©т%D4÷®т÷©4÷®·()ćsO7%2@+Y`т‰0Kθ4ÖUD2Qi\28X+ë<7%É31α}‹iY¬>0ëY1¾ǝDÅsD12‹i>1ë\1Dǝ¤>2}}ǝVYI'.¡Q#

I'm out of my mind..
For the golfing language 05AB1E it doesn't matter at all whether the input is with . or -. However, 05AB1E doesn't have any builtins for Date objects or calculations. The only builtin regarding dates it has is today's year/month/day/hours/minutes/seconds/microseconds.
So because of that, almost all of the code you see are manual calculations to go to the next day, and calculating the day of the week.
+5 bytes due to a part I forgot in Zeller's formula (year-1 for months January and February)..
-1 byte thanks to @Grimmy, by changing \$\left\lfloor{\frac{13(m+1)}{5}}\right\rfloor\$ to \$\left\lfloor{\frac{26(m+1)}{10}}\right\rfloor\$ in the code, since 05AB1E has single-byte builtins for both 26 and 10 (being ₂ and T respectively), as opposed to the 3 bytes of 13 and 5.
Try it online or Try it online with an emulated self-specified date of 'today'.
Explanation:
Wall of text incoming.
In general, the code follows the following pseudo-code:
1   Date currentDate = today;
2   Integer counter = 0;
3   Start an infinite loop:
4*    If(currentDate is NOT a Saturday and currentDate is NOT a Sunday):
5       Counter += 1;
6*    currentDate += 1; // Set currentDate to the next day in line
7     If(currentDate == parsed input-string):
8       Stop the infinite loop, and output the counter

1) Date currentDate = today; is this part of the 05AB1E program:

že          # Push today's day
  žf        # Push today's month
    žg      # Push today's year
      )     # Wrap them into a single list
       V    # Pop and store this list in variable `Y`

2) Integer counter = 0; and 3) Start an infinite loop: are straight-forward in the 05AB1E program:

0     # Push 0 to the stack
 [    # Start an infinite loop

4) If(currentDate is NOT a Saturday and currentDate is NOT a Sunday): is the first hard part with manual calculations. Since 05AB1E has no Date builtins, we'll have to calculate the Day of the Week manually.
The general formula to do this is:
$${\displaystyle h=\left(q+\left\lfloor{\frac{13(m+1)}{5}}\right\rfloor+K+\left\lfloor{\frac{K}{4}}\right\rfloor+\left\lfloor{\frac{J}{4}}\right\rfloor-2J\right){\bmod{7}}}$$
Where for the months March through December:

\$q\$ is the \$day\$ of the month ([1, 31])
\$m\$ is the 1-indexed \$month\$ ([3, 12])
\$K\$ is the year of the century (\$year \bmod 100\$)
\$J\$ is the 0-indexed century (\$\left\lfloor {\frac {year}{100}}\right\rfloor\$)

And for the months January and February:

\$q\$ is the \$day\$ of the month ([1, 31])
\$m\$ is the 1-indexed \$month + 12\$ ([13, 14])
\$K\$ is the year of the century for the previous year (\$(year - 1) \bmod 100\$)
\$J\$ is the 0-indexed century for the previous year (\$\left\lfloor {\frac {year-1}{100}}\right\rfloor\$)

Resulting in in the day of the week \$h\$, where 0 = Saturday, 1 = Sunday, ..., 6 = Friday.
Source: Zeller's congruence
We can see this in this part of the 05AB1E program:

Y             # Push variable `Y`
 `            # Push the day, month, and year to the stack
  U           # Pop and save the year in variable `X`
   D          # Duplicate the month
    3‹        # Check if the month is below 3 (Jan. / Feb.),
              # resulting in 1 or 0 for truthy/falsey respectively
      ©       # Store this in variable `®` (without popping)
       12*    # Multiply it by 12 (either 0 or 12)
          +   # And add it to the month
              # This first part was to make Jan. / Feb. 13 and 14

>             # Month + 1
 ₂*           # Multiplied by 26
   T÷         # Integer-divided by 10
®             # Push month<3 from variable `®` again
 Xα           # Take the absolute difference with the year
   ©          # Store this potentially modified year as new `®` (without popping)
    т%        # mYear modulo-100
D4÷           # mYear modulo-100, integer-divided by 4
®т÷©4÷        # mYear integer-divided by 100, and then integer-divided by 4
®·(           # mYear integer-divided by 100, doubled, and then made negative
)             # Wrap the entire stack into a list
 ć            # Extract the head (the counter variable that was also on the stack)
  s           # Swap so the calculated values above are as list at the top
   O          # Take the sum of this entire list
    7%        # And then take modulo-7 to complete the formula,
              # resulting in 0 for Saturday, 1 for Sunday, and [2, 6] for [Monday, Friday]

2@            # Check if the day is greater than or equal to 2 (so a working day)

5) Counter += 1; is straight-forward again:

     # The >=2 check with `2@` results in either 1 for truthy and 0 for falsey
+    # So just adding it to the counter variable is enough

6) currentDate += 1; // Set currentDate to the next day in line is again more complex, because we have to do it manually. So this will be expanded to the following pseudo-code:
a   Integer isLeapYear = ...;
b   Integer daysInCurrentMonth = currentDate.month == 2 ?
c                                 28 + isLeapYear
d                                :
e                                 31 - (currentDate.month - 1) % 7 % 2;
f   If(currentDate.day < daysInCurrentMonth):
g     nextDate.day += 1;
h   Else:
i     nextDate.day = 1;
j     If(currentDate.month < 12):
k       nextDate.month += 1;
l     Else:
m       nextDate.month = 1;
n       nextDate.year += 1;

Sources:
Algorithm for determining if a year is a leap year. (EDIT: No longer relevant, since I use an alternative method to check leap years which saved 7 bytes.)
Algorithm for determining the number of days in a month.
6a) Integer isLeapYear = ...; is done like this in the 05AB1E program:

Y             # Push variable `Y`
 `            # Push the days, month and year to the stack
  т‰          # Divmod the year by 100
    0K        # Remove all items "00" (or 0 when the year is below 100)
      θ       # Pop the list, and leave the last item
       4Ö     # Check if this number is visible by 4
         U    # Pop and save the result in variable `X`

Also used in this 05AB1E answer of mine, so there some example years are added to illustrate the steps.

6b) currentDate.month == 2 ? and 6c) 28 + isLeapYear are done like this:

D            # Duplicate the month that is now the top of the stack
 2Q          # Check if it's equal to 2
   i         # And if it is:
    \        #  Remove the duplicated month from the top of the stack
     28X+    #  Add 28 and variable `X` (the isLeapYear) together

6d) : and 6e) 31 - (currentDate.month - 1) % 7 % 2; are done like this:

ë           # Else:
 <          #  Month - 1
  7%        #  Modulo-7
    É       #  Is odd (shortcut for %2)
     31     #  Push 31
       α    #  Absolute difference between both
}           # Close the if-else

6f) If(currentDate.day < daysInCurrentMonth): is done like this:

‹     # Check if the day that is still on the stack is smaller than the value calculated
 i    # And if it is:

6g) nextDate.day += 1; is done like this:

Y       # Push variable `Y`
 ¬      # Push its head, the days (without popping the list `Y`)
  >     # Day + 1
   0    # Push index 0

        # (This part is done after the if-else clauses to save bytes)
}}      # Close the if-else clauses
  ǝ     # Insert the day + 1 at index 0 in the list `Y`
   V    # Pop and store the updated list in variable `Y` again

6h) Else: and 6i) nextDate.day = 1; are then done like this:

ë        # Else:
 Y       #  Push variable `Y`
  1      #  Push a 1
   ¾     #  Push index 0
    ǝ    #  Insert 1 at index 0 (days part) in the list `Y`

6j) If(currentDate.month < 12)::

D           # Duplicate the list `Y`
 Ås         # Pop and push its middle (the month)
   D12‹     # Check if the month is below 12
       i    # And if it is:

6k) nextDate.month += 1;:

>       # Month + 1
 1      # Push index 1

        # (This part is done after the if-else clauses to save bytes)
}}      # Close the if-else clauses
  ǝ     # Insert the month + 1 at index 1 in the list `Y`
   V    # Pop and store the updated list in variable `Y` again

6l) Else:, 6m) nextDate.month = 1; and 6n) nextDate.year += 1; are then done like this:

ë        # Else:
 \       #  Delete the top item on the stack (the duplicated month)
  1      #  Push 1
   D     #  Push index 1 (with a Duplicate)
    ǝ    #  Insert 1 at index 1 (month part) in the list `Y`

 ¤       #  Push its tail, the year (without popping the list `Y`)
  >      #  Year + 1
   2     #  Index 2

         # (This part is done after the if-else clauses to save bytes)
}}       # Close the if-else clauses
  ǝ      # Insert the year + 1 at index 2 in the list `Y`
   V     # Pop and store the updated list in variable `Y` again

And finally at 7) If(currentDate == parsed input-string): and 8) Stop the infinite loop, and output the counter:

Y          # Push variable `Y`
 I         # Push the input
  '.¡     '# Split it on dots
     Q     # Check if the two lists are equal
      #    # And if they are equal: stop the infinite loop
           # (And output the top of the stack (the counter) implicitly)


Kakoune, 62 keystrokes
<a-l>"ndd<a-l>S
"hddQxy<a-p><a-p>_S
a*<c-r>h+<a-;> <backspace><esc><a-h>|bc
k<a-i>ndd<a-j>Q:ex<tab> <c-r>nq
K<a-x>d%<a-s><a-h>w<a-l>d<a-j>

(note the trailing spaces on line 1 and 2)
Assumes the input in the following format, with the cursor at the start of the buffer:
number of items
kernel separated with spaces in reverse
seed separated by spaces

Gives the output as the numbers space separated.
Here is a video of the solution in action, with a few minor human errors :)


JavaScript ES6, 86 bytes

f=s=>'NBM BM NB M B N'.replace(/\S+/g,e=>(i=0,s=s.replace(RegExp(e,'g'),_=>++i))&&i+e)

(I just had to answer this.) It goes through each substring of NBM, starting with the longer ones, which take higher priority. It searches for each occurrence of that particular string and removes it (in this case replacing it with the current count so it won't be matched again). It finally replaces each substring with the count + the string.

This Stack Snippet is written in the ES5 equivalent of the above code to make it easier to test from any browser. It is also slightly ungolfed code. The UI updates with every keystroke.

f=function(s){
  return'NBM BM NB M B N'.replace(/\S+/g,function(e){
    i=0
    s=s.replace(RegExp(e,'g'),function(){
      return++i
    })
    return i+e
  })
}

run=function(){document.getElementById('output').innerHTML=f(document.getElementById('input').value)};document.getElementById('input').onkeyup=run;run()
<input type="text" id="input" value="NBMMBNBNBM" /><br /><samp id="output"></samp>


Python 2, 170 + 150 = 320 bytes

AV to BV, 180 179 173 170 bytes:

lambda s:"BV1{2}{4}4{5}1{3}7{1}{0}".format(*["fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF"[((int(s[2:])^177451812)+8728348608)/58**i%58]for i in range(6)])

Try it online!

BV to AV, 165 158 150 bytes:

s=input()
n=0
for i in 6,4,8,3,10,11:n=n*58+"fZodR9XQDSUm21yCkr6zBqiveYah8bt4xsWpHnJE7jL5VG3guMTKNPAwcF".find(s[i])
print"av"+`n-8728348608^177451812`

Try it online!


Code-Golf: Lattice Points inside a Circle

J, 21 19 18

+/@,@(>:|@j./~@i:)

Builds complexes from -x-xj to x+xj and takes magnitude.

Edit: With >:

Edit 2: With hook and monadic ~. Runs a few times slower for some reason, but still 10-ish seconds for f(1000).


Perl, 54 characters

#!/usr/bin/perl -p
s/ |("""|'''|"|')((\\?.)*?)\1/$2/g;s/\\(["'\\])/$1/g

Just as I was posting this, I noticed that it's almost identical to Jan Dvorak's Ruby solution. I'm a little put out by how similar it is, in fact, but I'm going to say "Great minds think alike" and let it go at that.

This program highlights a weird corner case in counting characters in Perl scripts: By my reading, the presence of single-quotes in the script means that I need to count the -p option as two characters towards my total. Typically, when computing Perl script sizes, the initial dash character on the options is considered to be free, on the justification that it can be bundled with the -e that introduces the program proper ... but then you also have to account for any extra escapes you need to enter the script on the command-line. The single-quotes require lots of escaping, so to avoid that penalty I have to count it as a script run from a file, and therefore I get the #!/usr/bin/perl for free, but not any option characters. It's a little confusing.


Discrete Convolution or Polynomial Multiplication

J, 10 8 bytes

[:+//.*/

Usage:

ppc =: [:+//.*/    NB. polynomial product coefficients
80085 1337 ppc _24319 406
_1947587115 7 542822

Description: The program takes takes two lists, makes a multiplication table, then adds the numbers on the positive diagonals.


brainfuck, 28 26 bytes

a+b[c-/[/---<]>>- ]<-.+.+.

Try it online!

Got the bf code from here.

Fails in Ink due to Expected target for new thread but saw '.+.+.'.

ink

abc//-<>-]-++

Try it online!

Ink will just print abc and the rest is a comment.

Fails in brainfuck due to mismatched bracket.


Snails, 48 bytes
0 -> )0(\0!(l.)(~
1 -> )0(\1!(l.)(~
( -> )0({{(
) -> )0}}(~
| -> )0}|{(
* -> )0),(~
If we had to search for partial matches rather than matching only the full input, then it would be very easy. 0 would become \0, 1 would become \1, * would become ,, and the others would map to themselves. Instead there are a lot of shenanigans to prevent matches from starting somewhere other than the beginning or ending somewhere other than the end. !(l.) is an assertion that will fail if the beginning of the match is not at the beginning of the input. ~ matches a cell outside of the input, so it is added to all the characters that are allowed to be at the end of the regex. If there is another regex character following, it is canceled out by a numerical quantifier 0 which requires it to be matched 0 times, essentially commenting it out. To allow * (,) to work correctly despite the dummy out-of-bounds test being in the way, the language's bracket matching rules are heavily used. From the documentation:

Matching pairs of parentheses () or curly braces {} will behave as expected (like parentheses in regex), but it is also possible to leave out one half of a pair and have it inferred, according to the following rules. ) or } groups everything to the left until the nearest unclosed group opening instruction of the same type(( or { respectively), or the beginning of the pattern if none exists. It closes any unclosed opening instructions of the opposite type in the middle of this range. An otherwise unmatched ( or { is closed by the end of the pattern.

Clear as mud, right?