text:
Pseudofactorial
There is a rather curious number which shows up sometimes in math problems or riddles. The pseudofactorial(N) is the least (i.e. lowest) common multiple of the numbers 1 through N; in other words, it's the lowest number which has all numbers from 1 through N as factors.
For instance pseudofactorial(7) = 3 * 4 * 5 * 7, which is the same as 7! except that 2 and 6 have been removed because they are contained in other terms.
Write a program to calculate pseudofactorial(N) and as always, shortest code wins.
Here is a short list for your use. More test cases can be found in the OEIS under A003418.
Factorial:

1
2
6
24
120
720
5040

Pseudofactorial:

1
2
6
12
60
60
420

I'm not sure I understand why 2 and 6 were removed from the list of multiples. Can please you clarify the rules?

@Mattysen, psuedofactorial(N) is the smallest number which has the numbers 1 through N as factors (The least common multiple of those numbers). That is the technical definition, but the way I wrote it was somewhat suggestive that it is similar to a factorial.

@TonyRuth ohh i see now, thanks.

https://oeis.org/A003418

Welcome to Programming Puzzles & Code Golf! This is a nice first challenge!

Your first challenge got to the top of HNQ. Nice!

Thanks, I've never really asked many questions on stack exchange, tried more to answer, but this came up in a puzzle. What is HNQ?

Hot Network Questions.

Dyalog APL, 3 bytes
∧/⍳

APL beats Jelly‽
⍳ 1 though argument
∧/ LCM across

That interrobang is so sexy.

O man you beat Dennis...

Impressive, but how are these 3 bytes?

https://en.wikipedia.org/wiki/APL_(codepage)

Jelly, 4 bytes
Ræl/

Try it online! or verify all test cases.
How it works
Ræl/  Main link. Input: n

R     Range; yield [1, ..., n].
   /  Reduce the range...
 æl     by LCM.

Haskell, 20 bytes
f x=foldr1 lcm[1..x]

Usage example: map f [1..7] -> [1,2,6,12,60,60,420].
The lcm trick in Haskell.

C (x86-64 gcc -O1), 52 bytes
d(n,k,b,t){for(b=k=1;b;++k)for(t=n,b=0;t;b+=k%t--);}

Checks numbers from 1 upwards. For each number, divides it by all numbers from n down to 1, and sums the remainders. Stops when the sum is 0.
Usage:
main()
{
    printf("%d\n", d(7)); // outputs 420
}

It's not obvious how it returns a value (there is no return statement).
The calling convention for x86 says that the function must return its value in the eax register. Conveniently, the division instruction idiv expects its input in eax, and outputs the result in eax (quotient) and edx (remainder). The last iteration divides k by 1, so eax will contain the right value when the function exits.
This only works with gcc and -O1 optimization option (otherwise, it outputs different results — usually 0 or random-looking numbers, but sometimes 421, while the correct answer is 420).
Try it with Compiler Explorer

How do you get away with not declaring the type of n, k, b,and t?

C has the default-int rule - all omitted types are int by default (including the return value). It works for function arguments if they are declared using the so-called "old-style" syntax. The declaration with explicitly defined types would be int d(n,k,b,t) int n,k,b,t; {...}

if you're taking advantage of a calling convention then this should really be marked "C (cdecl)" rather than just "C"

@SteveCox Both cdecl and stdcall use the same method for return-value, so I guess x86 is enough

This doesn't work anymore on modern versions of GCC or clang (if it ever did), because EAX gets overwritten by another value, but here's a mockup of how it probably worked: Try it online! – I wouldn't be surprised if it only worked on a narrow range of compiler versions.

@Deadcode It works in all gcc versions (but only with -O1), and in some clang versions. Fortunately, we have Compiler Explorer! I added a link so anyone could check these results.

Ah, I see! Interesting. I was familiar with that site, and had already tried various versions of compilers on it with your code, but it wouldn't have occurred to me to try -O1, as I'd never seen a gcc exploit before that relied on that rather than the default -O0. Why not also include a Try it online! link?

Python, 46 bytes
g=lambda n,c=0:n<1or(c%n<1)*c or g(n,c+g(n-1))

Looking for the multiple c of g(n-1) directly. I had though before that this method would wrongly find 0 as a multiple of anything, but the or short-circuiting or (c%n<1)*c will skip c==0 as well because 0 is Falsey.

50 bytes:
g=lambda n,i=1:n<1or(i*n%g(n-1)<1)*i*n or g(n,i+1)

Like Dennis's solution, but as a recursive function. Having computed g(n-1), looks for the smallest multiple i*n of n that's also a multiple of g(n-1). Really slow.
Thanks to Dennis for 4 bytes by looking at multiples of n instead of g(n-1).

Python + SymPy, 45 bytes
import sympy
lambda n:sympy.lcm(range(1,n+1))

Fairly self-explanatory.

Python 2, 57 54 bytes
i=r=input();exec't=r\nwhile r%i:r+=t\ni-=1;'*r;print r

Test it on Ideone.
How it works
The input is stored in variables i and r.
exec executes the following code r times.
t=r
while r%i:r+=t
i-=1

While i varies from r to 1, we add the initial value of r (stored in t) as many times as necessary to r itself to create a multiple of i. The result is, obviously, a multiple of t.
The final value of r is thus a multiple of all integers in the range [1, ..., n], where n is the input.

Without using third party libraries or exec tricks there's a 78 byte solution: from fractions import*;lambda n:reduce(lambda x,y:x*y/gcd(x,y),range(1,n+1),1)  Uses the fact that lcm(x,y) = x*y/gcd(x,y).

MATL, 4 bytes
:&Zm

Try it online!
Explanation
:      % Take input N implicitly. Generate range [1 2 ... N]
&Zm    % LCM of the numbers in that array. Display implicitly

J, 9 bytes
[:*./1+i.

Straight-forward approach. Creates the range of numbers [0, ..., n-1], then adds one to each, and reduce it using the LCM.
Usage
   f =: [:*./1+i.
   f 7
420

Mathematica, 13 bytes
LCM@@Range@#&

isn't this equivalent to just composing LCM and Range with @*?

LCM operates element-wise on a list, which would be passed by Range, meaning this would just return the lcm(x) for x from 1 through n. Also, there's a missing & that would close the anonymous function. Something like LCM@@Range@#& for 13 bytes would work.

Julia, 11 bytes
!n=lcm(1:n)

Try it online!

Perl 6, 13 bytes
{[lcm] 1..$_}

Anonymous code block that creates a Range from 1 to the input (inclusive), and then reduces that with &infix:<lcm>.
Example:
#! /usr/bin/env perl6
use v6.c;

my &postfix:<p!> = {[lcm] 1..$_}

say 1p!; # 1
say 2p!; # 2
say 3p!; # 6
say 4p!; # 12
say 5p!; # 60
say 6p!; # 60
say 7p!; # 420

say 10000p!; # 5793339670287642968692270879...
# the result from this is 4349 digits long

https://ideone.com/gR4SK5

Pyth - 8 bytes
Checks all numbers till it finds one that is divisible by [1..N].
f!s%LTSQ

Test Suite.

Octave, 27 bytes
@(x)lcm(1,num2cell(1:x){:})

Creates an anonymous function that can be invoked as ans(N).
Online Demo
Explanation
This solution creates a list of all numbers between 1 and x (1:x), converts them to a cell array with num2cell. Then the {:} indexing creates a comma-separated-list which is passed to lcm as multiple input arguments to compute the least common multiple. A 1 is always passed as the first argument to lcm because lcm always needs at least two input arguments.

So lcm in Octave accepts more than 2 inputs! Interesting

@LuisMendo Yup 2+

MATLAB, 49 bytes
@(x)find(~any(bsxfun(@rem,1:prod(1:x),(1:x)')),1)

Arturo, 13 bytes
$=>[lcm@..1&]

Try it

Regex  (ECMAScript+(?*)x*+RME / PCRE2 v10.35+), 60 59 54 bytes
^((?*(?=(xx+?)\2*$|)((?=x\2)(?=(x+)(\4+$))\5)*+x+)x)*$

Takes its input in unary, as a string of x characters whose length represents the number. Returns its output as the number of ways the regex can match. (The rabbit emoji indicates this output method.)
Attempt This Online! - PCRE2 v10.40+
Try it on replit.com - ECMAScript+(?*)+x*+ (RegexMathEngine -xml,pq)
The  output method takes advantage of an aspect of regex that's normally hidden: the backtracking paths that aren't taken. In normal use, all traces of the avenues of potential alternative matches are erased when a final match is found. But in , they're all taken and counted, allowing a number to be outputted that's larger than the input. For scalar unary input, this provides a strict superset of the power of returning a number via the matched substring or a capture group (either of which can only return values less than or equal to the input), except that there can be no extra state of returning "no match" (in , that just returns \$0\$).
The limitation of having to work within the space of the input is still present.  can do combinations of multiplication and addition to yield numbers larger than the input, but it can't do subsequent tests on those results (it can only do tests on intermediate results calculated using capture groups and tail). So for example in this problem, the regex can't just directly search for the smallest number that is divisible by all numbers in the range \$[1,n]\$, because that number is not only larger than the input, it's too large even to be able to emulate using number base arithmetic (and even if that were possible, it would not golf well). So, this regex uses an algorithm different from all of the other answers:
It takes the base prime \$p\$ of every prime power \$p^k\le n\$, and calculates the product of that list of numbers. And because each \$p\$ will occur \$k\$ times in that list, this product is the same as the product of the prime powers themselves would be, if only the largest from each base prime were included.
The prime power portion is based on my prime powers answer Neil's prime powers answer (which is in turn based on my earliest CGCC answer). In the prime powers challenge, my regex is shorter, but for the purposes of this challenge, his regex (after some extra golfing) allows capturing the smallest prime factor, thus golfing down the overall regex by 1 6 bytes.
^                       # tail = N = input number
(                       # Loop the following:
    (?*                 # Non-atomic lookahead:
                            # M = tail, which cycles from N down to 1
        (?=(xx+?)\2*$|)     # \2 = smallest prime factor of M if M ≥ 2;
                            # otherwise, leave \2 unchanged in PCRE, or
                            # unset in ECMAScript
        (
            (?=x\2)         # Keep iterating until tail ≤ \2, and because of
                            # what \2 is, this means at the end of the loop,
                            # either tail == \2 (if M is a prime power) or
                            # tail == 1 (if M is not a prime power)
            (?=(x+)(\4+$))  # \4 = {largest proper divisor of tail}
                            #    = tail / {smallest prime factor of tail};
                            # \5 = tail - \4
            \5              # tail = tail - (tail - \4) = \4
        )*+                 # Iterate the above as many times as possible,
                            # minimum zero, and lock in the result using a
                            # possessive quantifier.
        x+                  # Multiply number of possible matches by tail
    )
    x                   # tail -= 1
)*                      # Loop the above a minimum of 0 times
$                       # Assert that at the end of the above loop, tail == 0

This even returns a correct value for \$n=0\$, while the earlier 60 byte version did not (and needed to be extended to 63 bytes to do so).
A list of other answers that return \$f(0)=1\$ correctly, complete at the time of this edit: AWK, Dyalog APL, J, Japt, Julia v0.7+ (but it was v0.6 at the time of posting, and didn't support it then), MATLAB, MATL, Maxima (with functs), Minkolang (1st answer), Nibbles, PHP, Pari/GP, Perl 5, Perl 6, Pyth, Python (with SymPy), Python (with math), Python, QBIC, Rexx, Vyxal. (Not tested: 8th, Axiom, Hoon)

Brachylog, 5 bytes
fa~⟦₁

Try it online!
Reversed I/O.
 a       An affix of
f        the list of the output's factors
  ~⟦₁    is [1 .. n].

Essentially a specialization of my basic LCM solution f⊇p~d: ranges are duplicate-free, so they don't need to be deduplicated; ranges are ascending, so they don't need to be permuted; ranges are necessarily contiguous prefixes of the list of factors, so ⊇ can be replaced by the evidently much more performant a.

Nibbles, 5.5 bytes
/|,~~+.,@%@

Attempt This Online!
/|,~~+.,@%@
/|,~        Find the first positive integer k such that
     +      the sum
      .,@   for i from 1 to n
         %@ of k mod i
    ~       is zero

JavaScript (ES6), 92 88 80 74 69 bytes:
Thanks @ConorOBrien and @Neil
y=>(g=(a,b)=>b?g(b,a%b):a,[...Array(y)].map((_,i)=>y=y*++i/g(y,i)),y)

b?g(b,a%b):a saves a byte.

y*++i/g(y,i) saves some more bytes.

Desmos, 16 bytes
f(n)=[1...n].lcm

Super straightforward
Try It On Desmos!

Nim, 52 bytes
import math,sequtils
func p[I](n:I):I=lcm toSeq 1..n

Attempt This Online!

05AB1E, 20 bytes
Lpvyi¹LÒN>¢àN>*ˆ}}¯P

Explanation
Lpv                    # for each item in isprime(range(1,N)): N=7 -> [0,1,1,0,1,0,1]
   yi                  # if prime
     ¹LÒN>¢            # count occurrences of the prime
                         in the prime-factorization of range(1,N):
                         p=2 -> [0,1,0,2,0,1,0]
           àN>*ˆ       # add max occurrence of that prime multiplied by the prime
                         to global array: N=7 -> [4,3,5,7]
                }}     # end if/loop
                  ¯P   # get product of global array

Try it online

Minkolang 0.15, 12 bytes
I have two 12-byte solutions, and have included them both.
1n[i1+4$M]N.

Try it here!
Explanation
1               Push 1
 n              Take number from input
  [             For loop that repeats n times
   i1+          Push loop counter + 1
      4$M       Pop b, a and push lcm(a,b)
         ]      Close for loop
          N.    Output as number and stop.

About as straightforward as it gets.

11nLd[4$M]N.

Try it here!
Explanation
11              Push two 1s
  n             Take number from input
   L            Pop b, a and push range from a to b, inclusive
    d           Duplicate top of stack (n)
     [4$M]      Pop b, a and push lcm(a,b), n times
          N.    Output as number and stop.

A third solution can be derived from this: remove a 1 and add a d after the current d. In both cases, the extra number is needed because the for loop runs one too many times, and making it run one less time takes two bytes (1- just before the [).

Pyke, 3 bytes
S.L

Try it here!
S   - range(1, input+1)
 .L - lowest_common_multiple(^)

Ruby, 25 bytes
g=->n{(1..n).reduce :lcm}

Ruby, 25 bytes
g=->n{n<1?1:a[n-1].lcm n}

Hello, and welcome to PPCG! Great first post! You don't have to name your function, so you can remove g=.

Anonymous functions are allowed.

GameMaker Language, 60 bytes
for(b=k=1;b;++k){b=0for(t=argument0;t;b+=k mod t--)}return k

Based on the logic of anatolyg's answer.

I haven't actually tested this in GameMaker, but as written it almost certainly doesn't work, and needs to return k-1, not k.

PHP, 61 52 48 bytes
saved 9 bytes thanks to @user59178, 4 bytes by merging the loops.
Recursion in PHP is bulky due to the function key word; so I use iteration.
And with a "small"few tricks, I now even beat Arnauld´s JS.
while(++$k%++$i?$i>$argv[1]?0:$i=1:$k--);echo$k;

takes input from command line argument. Run with -r.
breakdown
while(++$k%++$i?    # loop $i up; if it does not divide $k
    $i>$argv[1]?0       # break if $i (smallest non-divisor of $k) is larger than input
    :$i=1               # while not, reset $i and continue loop with incremented $k
    :$k--);         # undo increment while $i divides $k
echo$k;         # print $k

ungolfed
That´s actually two loops in one:
while($i<=$argv[1]) # loop while $i (smallest non-divisor of $k) is not larger than input
    for($k++,       # loop $k up from 1
        $i=0;$k%++$i<1;);   # loop $i up from 1 while it divides $k
echo$k;             # print $k

Note: copied from my answer on the duplicate

QBIC, 35 32 bytes
This brought me here.
:{p=0[a|~q%b|p=1]]~p=0|_Xq\q=q+1

Explanation:
:        Get cmd line param as number 'a'
{        Start an infinite DO loop
p=0      Sets a flag that shows if divisions failed
[a|      FOR (b=1; b<=a; b++)
~q%b     IF 'q' (which starts at 1 in QBIC) is not cleanly divisible by 'b'
|p=1     THEN Set the flag
]]   Close the FOR loop and the IF, leave the DO open
~p=0     IF 'q' didn't get flagged
|_Xq     THEN quit, printing 'q'
\q=q+1   ELSE raise 'q', redo
         [DO Loop implicitly closed by QBIC]

Here's a version that stops testing q when b doesn't cleanly divide it. Also, the order of testing b's against q is reversed in the assumption that higher b's will be harder to divide by (take 2, 3, 4 for instance: if %2=0, %4 could be !0. Vice versa not so much...).
:{p=0[a,2,-1|~q%b|p=1┘b=2]]~p=0|_Xq\q=q+1

Pari/GP, 14 bytes
n->lcm([1..n])

Try it online!

Japt, 10 bytes
No LCM built-in.
@õ e!vX}a1

Try it

J-uby, 10 bytes
:+|:/&:lcm

Attempt This Online!
Explanation
:+ | :/ & :lcm

:+ |            # Get range 1..n, then
     :/ & :lcm  # reduce with LCM

Factor, 26 bytes
[ [1,b] 1 [ lcm ] reduce ]

Try it online!

05AB1E, 3 bytes
L.¿

Pretty similar as most golfing languages.
Try it online or verify all test cases.
Explanation:
L    # Push a list in the range [1, (implicit) input]
 .¿  # Pop and push the LCM (Least Common Multiple) of this list
     # (which is output implicitly as result)

Pyt, 9 bytes
Đ`Đ↔Ĺ↔⁻ł+

Try it online!
Đ            implicit input; Đuplicate
 `     ł     do... while top of stack is truthy
  Đ          Đuplicate top of stack
   ↔         flip stack
    Ĺ        get ĹCM of top two on stack
     ↔       flip stack
      ⁻      decrement
        +    add (removes pesky 0); implicit print

Thunno, \$ 5 \log_{256}(96) \approx \$ 4.12 bytes
R1+Al

Attempt This Online!
Explanation
R      # range(0, input)
 1+    # plus one
   Al  # LCM of list

Python, 44 bytes
lambda n:math.lcm(*range(1,n+1))
import math

Attempt This Online!
Requires Python 3.9+

Vyxal, 3 bytes
ɾ∆Ŀ

Run it!
Explanation:
ɾ   # numbers from 1 to input
 ∆Ŀ # least common multiple

Thunno 2, 2 bytes
Rŀ

Try it online!
Explanation
    # Implicit input
R   # Range [1..input]
 ŀ  # Reduced by LCM
    # Implicit output

Hoon, 67 bytes
|*
*
(roll (gulf 1 +<) |=({a/@ b/_1} (div (mul a b) d:(egcd a b))))

Create the list [1..n], fold over the list with lcm. Unfortunately, the Hoon stdlib doesn't have a pre-built one I can use :/

, 7 chars / 9 bytes
Мū…⩤⁽1ï

Try it here (ES6 only).
Just a LCM of inclusive range from 1 to input.

AWK, 42 bytes
{for(x=n=1;n<=$1;)if(x%n++){x++;n=1}$0=x}1

Command line usage:
awk '{for(x=n=2;n<=$1;)if(x%n++){x++;n=2}$0=x}1' <<< NUM

I didn't see an AWK solution and a duplicate of the question just got posted yesterday, so I thought I'd throw this together.  It's rather slow solving for 19 or larger on my box, but it works.

Axiom, 35 bytes
f(x)==reduce(lcm,[i for i in 1..x])

test code and results
(25) -> [[i,f(i)] for i in [1,6,19,22,30]]
   (25)  [[1,1],[6,60],[19,232792560],[22,232792560],[30,2329089562800]]
                                                  Type: List List Integer

i just make the solution of
Find the smallest positive integer which has all integers from 1 to n as factors
becouse you say it is douplicate i post it here

8th, 23 bytes
Code
1 ' lcm rot 2 swap loop

This code leaves resulting pseudofactorial on TOS
Usage and example
ok> 7 1 ' lcm rot 2 swap loop .
420

Or more clearly
ok> : pseudofact 1 ' n:lcm rot 2 swap loop ;

ok> 7 pseudofact .
420

Husk, 3 bytes
F⌉ḣ

Try it online!
same as APL.


text:
Same length sub arrays
Background:
Here's a little simple challenge. You want to be able to find out whether the arrays inside an array have the same length.
Input:
Your input should consist of exactly one array (this is the value passed to the function, not a user input). Your function takes exactly 1 parameter.  It could contain arrays or be empty. No error checking needed, assume only list is ever passed in. Assume a 1-D array such as [1] or [1,2,3,4,5] is never passed in.
Output:
Return true if all the list elements have the same length, false if they don't, and the parameter itself if the list is empty (or null if your language doesn't support multiple return types).
Some test cases:
List: [] - [] (or null/your language equivalent)
List: [[1], [1], [2]] - True
List: [[1]] - True
List: [[1, 2, 3, 4]] - True
List: [[1, 2, 3, 4, 5], [2], [12, 314123]] - False
List: [[1, 2, 3, 4], [1]] - False

No std(in/out) input/output needed (however, it is allowed, just not required!), the function only needs to return boolean values true or false; or the parameter itself if the function is passed an empty list (or null/your language equivalent). Only one return value is returned.
Rules:
Shortest byte count wins, only function is necessary (full programs are allowed if you desire).

what if we don't have a null type?

@Maltysen Good question, I'll change the rules to accommodate such languages.

what if we can't return different types (Arrays / Booleans)?

@nimi To be totally fair this question was designed with multiple return types in mind. Having to return either an array or boolean is what adds to the challenge imo. Let me know if you have any suggestions.

As the parameter is only returned when it is empty, how about some kind of option type like Haskell's Maybe, i.e. Nothing for the empty list and Just True/Just False else? Or Either -> Left [] / Right True. Basically any wrapper that can combine two types.

Are the sublist elements always going to be positive integers?

@nimi That works well as there would be 3 different returns values in that case.

@Neil The sub lists elements can be of any type, your code should have no knowledge of the context lists, just compares their length!

The special-case output for the empty list, especially one of a different type, is an extraneous task that makes solutions needlessly uglier.

Welcome to PPCG! Usually we first post a question in the Sandbox for Proposed Challenges. That way we can first get feedback and discussions to make the question close to perfect before posting it here. It's advisable to keep it in the Sandbox for ±72 hours so enough people can give recommendations, remarks and ask questions regarding your challenge. More info can be found in the Sandbox itself. (That being said, it looks like a good question, but in the Sandbox people often ask about edge/cases.)

Actually my sublist question was a red herring; I had got my lists and sublists confused.

Are full programs allowed?

@xnor It's part of the difficulty of the challenge, but I'll keep that in mind next time I design a question.

@Mego You can if you would like, but I thought I'd make the requirements more language agnostic, and only ask for a function.

@TimmyD To keep it simple! Only a function needed, no need to pipe in input from any outside source.

@mrdomoboto The default is to allow either a program or function since one or the other is easier in some languages. Same with the standard I/O methods I linked earlier. Restricting those defaults actually makes the challenge less language agnostic.

Also ... Welcome to Programming Puzzles and Code Golf! I hope you enjoy your time here. :-)

@TimmyD Okay, I'll update the requirements with these edge cases.

Pyth - 7 5 bytes
Saved 2 bytes thanks to @FryAmTheEggman.
And I was the one who told @issacg to remove the q default...
?QqCC

Test Suite.

I think ?QqCC works.

@FryAmTheEggman nice!

Python 2, 31
lambda l:l and l==zip(*zip(*l))

This requires the lists to be lists of tuples. zip Drops extra elements if the input was ragged, so double zipping is only a noop if the lists all have the same length.
Try it here

Javascript ES6, 44 43 42 bytes
Saved 1 byte thanks to @Neil
a=>a[0]?!a.some(b=>b.length-a[0].length):a

Alternative solutions
a=>a[0]?a.every(b=>b.length==a[0].length):a // 43
a=>a[0]?new Set(a.map(b=>b.length)).size==1:a // 45
a=>a[0]?Math.max(...a.map(b=>b.length))==a[0].length:a // 54
a=>a[0]?[a[0].length,...a].reduce((b,d)=>b==d.length):a // 55, doesn't work as intended

Somehow the stacksnippet doesn't print [], try it in your console for the actual result.

f=
a=>a[0]?a.every(b=>b.length==a[0].length):a

z.innerHTML = [
  [],
  [[1], [1], [2]],
  [[1]],
  [[1, 2, 3, 4]],
  [[1, 2, 3, 4, 5], [2], [12, 314123]],
  [[1, 2, 3, 4], [1]]
].map(m=>JSON.stringify(f(m))).join`<br>`
<pre id=z>

(yay for crossed out 44)

Your second alternative won't work, reduce uses the result of the previous function call as the first parameter to the next. Even if it did work, c costs you a byte. c costs you 4 bytes in your third alternative, since it's an unused variable.

I think I shaved off a byte: a=>a[0]?!a.some(b=>b.length-a[0].length):a

"Somehow" == in JavaScript [].toString() returns an empty string.

Array.prototype.toString() is equivalent to Array.prototype.join() with no arguments, that's why.

Try wrapping the array in JSON.stringify to display it correctly.

@CᴏɴᴏʀO'Bʀɪᴇɴ Good idea, thanks

Set solution ==1 => <2

Jelly, 5 bytes
L€E⁸ȧ

Try it online!
How it works
L€E⁸ȧ  Monadic link. Argument: A (list)

L€     Map length over the list.
  E    Test if all elements are equal.
   ⁸ȧ  Take the logical AND of A and the resulting Boolean.

Perl 6, 17 bytes
{$_??[==] $_!!$_}

[==] $_ does a reduce of the input ($_) with &infix:<==>. &infix:<==> is a Numeric operator so it coerces its inputs to Numeric. The rest is just the ternary operator ?? !!.
This is roughly equivalent to
sub ( $_ ) {
  if $_ {
    # the ｢map｣ is for clarity, it is not needed
    $_.map(*.elems).reduce(&infix:<==>)
    # ｢[OP] List｣ is actually smarter than ｢List.reduce(&infix:«OP»)｣
    # as it takes into account operator chaining, and associativity
  } else {
    $_
  }
}

Test:
#! /usr/bin/env perl6

use v6.c;
use Test;

# put it into the lexical namespace for clarity
my &same-elems = {$_??[==] $_!!$_}

my @tests = (
  [] => [],
  [[1], [1], [2]] => True,
  [[1],] => True,
  [[1, 2, 3, 4],] => True,
  [[1, 2, 3, 4, 5], [2], [12, 314123]] => False,
  [[1, 2, 3, 4], [1]] => False,
);

plan +@tests;

for @tests -> ( :key(@input), :value($expected) ) {
  is same-elems(@input), $expected, @input.perl
}

1..6
ok 1 - []
ok 2 - [[1], [1], [2]]
ok 3 - [[1],]
ok 4 - [[1, 2, 3, 4],]
ok 5 - [[1, 2, 3, 4, 5], [2], [12, 314123]]
ok 6 - [[1, 2, 3, 4], [1]]

Swift 3 - 47 Bytes
{$0.isEmpty ?nil:Set($0.map{$0.count}).count<2}

To invoke, first assign it to a variable:
 let f: ([[Any]]) -> Bool? = {$0.isEmpty ?nil:Set($0.map{$0.count}).count<2}
 f([[1], [1,2], [1,2,3]])

Is the initial space required?

Nope, that was just a typo. It wasn't in my letter count anyway

Haskell, 48 46 bytes
f[]=Nothing
f x|h:t<-length<$>x=Just$all(==h)t

Wraps the result in the Maybe type and returns Nothing if the input is the empty list and Just True/Just False otherwise.
Usage example:
*Main> map f [[],[[1],[2],[3]],[[1]],[[1,2,3,4]],[[1,2,3,4,5],[2],[12,314123]],[[1,2,3,4],[1]]]
[Nothing,Just True,Just True,Just True,Just False,Just False]

How it works:
f[]=Nothing                   -- empty input
f x                           -- otherwise
   |(h:t)<-length<$>x         -- map length function over the input and bind h
                              -- to the first element and t to rest of the list
          =     all(==h)t     -- return whether all values in t equal h
           Just$              -- wrapped in the Maybe type

Edit: @Lynn saved two bytes. Thanks!

Looks like can drop the parens around h:t.

@Lynn: Wow. I don't think I've ever tried to drop parens in a pattern match.

Brachylog, 9 bytes
.v|:ladl1

Returns true or false or the empty list.
Explanation
.v      Unify the output with the input if it's the empty list
|       Or
:la     Apply length to each element of the input
   d    Remove all duplicates
    l1  The length of the resulting list is 1

Ruby, 27 bytes
->i{!i.map(&:size).uniq[1]}
Test:
s = ->i{!i.map(&:size).uniq[1]}
s[[[1, 2, 3, 4], [1]]]
=> false
s[[[1, 2, 3, 4]]]
=> true

Java 10, 145 129 107 106 103 93 77 bytes
Loads of bytes saved thanks to @Frozn, and by using Object as return-type, we can comply with OP's rules of returning the input-array when the array is empty, despite Java's one-return-type-only nature regarding methods.
m->{int f=1;for(var a:m)f=m[0].length!=a.length?0:f;return m.length<1?m:f>0;}

Try it online.
Explanation:
m->{                  // Method with integer-matrix parameter and Object return-type
  int f=1;            //  Flag-integer, starting at 1
  for(var a:m)        //  Loop over the rows of the matrix
    f=m[0].length!=a.length?
                      //   If the length of the first and current row aren't the same:
       0              //    Change `f` to 0
      :               //   Else:
       f;             //    Leave `f` the same
  return m.length<1?  //  If there is only one row:
          m           //   Return the input-matrix as result
         :            //  Else:
          f>0;}       //   Return whether the flag `f` is still 1 as boolean

I don't understand why the p = a[x].length is necessary as it seems to don't change the value of p

@Frozn Ah, you're completely right, I screwed up!.. I've removed it. Thanks.

Alright, I think you can get rid of some characters by changing the for-loop to a for each. Didn't tested it just wrote it on a piece of paper and it looked a bit shorter. Oh and in addition you can remove l so it will get even shorter.

@Frozn True. I had the for-loop because of the previous p = a[x].length;, but now I can indeed use a foreach-loop instead. So, changed yet again. :)

@KevinCruijssen I changed the requirements, null or the parameter is fine.

It's me again, I claim you can change the return type to Object to save an additional character. Also with the forearm loop you can remove the first if statement and move it to the end of the function as a ternary like return a.length < 0 ? null : 1 > 0

As the OP allows to return the parameter itself you can replace the return of null with a. This will save some more characters, so you could come down to 93.

@Frozn Sorry for the late response.. I somehow read past your comments. Edited and thanks! :)

PowerShell v2+, 53 bytes
param($a)if($a){($a|%{$_.count}|select -u).count-eq1}

This presumes that standard I/O methods and both programs and functions are allowed. Additionally, in PowerShell, the concept of "returning" an empty array is meaningless -- it's converted to $null as soon as it leaves scope -- and so it is the equivalent of returning nothing, which is what is done here.
We take input $a, and if it's non-empty we collect all the .counts of each sub-array. We pipe that to Select-Object with the -unique flag, take that .count and verify that it's -equal to 1. Returns Boolean $true or $false. If the input is the empty array, returns nothing (i.e., $null).
Examples
PS C:\Tools\Scripts\golfing> .\same-length-sub-arrays.ps1 ((1),(2),(3))
True

PS C:\Tools\Scripts\golfing> .\same-length-sub-arrays.ps1 ((1),(2),(3,4))
False

PS C:\Tools\Scripts\golfing> .\same-length-sub-arrays.ps1 @()

PS C:\Tools\Scripts\golfing> (.\same-length-sub-arrays.ps1 @()).GetType()
You cannot call a method on a null-valued expression.
At line:1 char:1
+ (.\same-length-sub-arrays.ps1 @()).GetType()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : InvokeMethodOnNull

PS C:\Tools\Scripts\golfing> (.\same-length-sub-arrays.ps1 @())-eq$null
True

Mathematica, 22 bytes
a@{}={};a@b_:=ArrayQ@b

The requirement of a[{}] == {} ruins everything and prevents a 6 byte solution of the built-in ArrayQ, since in Mathematica a zero length array is also an array.

I don't have my mathematica rpi running atm, but IIRC, you can save by special casing {} by doing a@b_:=b&&ArrayQ@b

@Maltysen That doesn't seem to work, it'll always return the array if it is an array then (b&&c will always return b if c evaluates to True).

why does it do that? shouldn't it return c if b is true?

@Maltysen Your statement is the inverse of mine and is also true. I'm referring to a@{} -> {} && ArrayQ@{} -> {} && True -> {}. This is desirable. But let b = {{1},{2},{3}}, then a@b -> b && ArrayQ@b -> b && True -> b -> {{1},{2},{3}} whereas we need True here.

oic, can you do instead then {}&&stuff?

@Maltysen I'm not seeing how that would be helpful.

I guess mathematica's short-circuiting is just weird and I'm not understanding it...sorry

Julia, 33 bytes
!x=[]==x?x:diff(map(endof,x))⊆0

Try it online!
How it works
We redefine the unary operator ! for this task.
If x is the empty array, we simply return x.
Else, we map endof (equivalent to length) over the arrays in x and compute the differences of consecutive lengths with diff. If all length are equal, this will generate an array of 0's. Otherwise, there will be non-zero numbers in the result.
Finally, ⊆0 tests if all differences are 0 and return the corresponding Boolean.

Actually, 18 bytes
`♂l╔l;Y"[].⌂"£n=1`

Try it online! (calls the function with ƒ)
Explanation:
`♂l╔l;Y"[].⌂"£n=1`  push a function:
 ♂l                   map length over input
   ╔l                 uniquify
     ;Y               1 if list is empty else 0
       "[].⌂"£n       call this function that many times:
        [].             print an empty list
           ⌂            exit
               =1     1 if length of unique list equals 1 else 0

If the function-only requirement is lifted, the equivalent program works for 15 bytes:
♂l╔l;Y`[].⌂`n=1

Try it online!

05Ab1E, 12 bytes
Dg0Qië€gÙg1Q

Explained
Dg0Qi          # if empty list, return input
     ë         # else
      €g       # map length over list
        Ùg1Q   # check if length of uniquified list is 1

Try it online

F#, 78 bytes
function
|[]->None
|x->Seq.forall(fun y->Seq.length y=Seq.length x.[0])x|>Some

Output is the F# Option type. If the input is empty output is None, else it's Some bool, where the bool value indicates whether all the sub-arrays are of equal length.
// F# Interactive
let f =
    function
    |[]->None
    |x->Seq.forall(fun y->Seq.length y=Seq.length x.[0])x|>Some;;

val f : _arg1:#seq<'b> list -> bool option

> f [[0;1];[2];[3]];;
val it : bool option = Some false
> f [[0;1];[2;3];];;
val it : bool option = Some true
> f [];;
val it : bool option = None

Python, 45 bytes
lambda x:x and min(x,key=len)==max(x,key=len)

5 bytes shorter: f=lambda x:x and len(set(map(len,x)))<2

also, yours doesn't work on []

You should return the array if it's empty.

@Maltysen Thanks for the tip. Feel free to post that as an answer, since it's a totally different approach and I didn't come up with it.

Octave, 51 bytes
@(x)repmat(2>n(unique(cellfun(n=@numel,x))),n(x)>0)

Online Demo
Explanation
Loops through the input (a cell array) and determines the number of elements in each entry numel, then from this array of the number of elements, we ensure that there is only one unique value: 2 > numel(unique(numberOfElements)). This will give us the boolean we want. Unfortunately, it is difficult to yield an empty array efficiently so in order to deal with the case of an empty input, we use repmat to repeat this boolean value N times where N is the number of subarrays in the input. If the input is empty this repeats the boolean value 0 times leading to [].

J, 26 bytes
]`(1=[:#@~.#@>@>)@.(*@#@>)

Since J doesn't support ragged arrays, I will use boxed arrays instead. It returns 1 for true, 0 for false, and the input if empty.
Usage
   f =: ]`(1=[:#@~.#@>@>)@.(*@#@>)

   NB. Boxed array representing [[1, 2, 3, 4, 5], [2], [12, 314123]]
   < 1 2 3 4 ; 2 ; 12 314123
┌─────────────────────┐
│┌───────┬─┬─────────┐│
││1 2 3 4│2│12 314123││
│└───────┴─┴─────────┘│
└─────────────────────┘
   f < 1 2 3 4 ; 2 ; 12 314123
0
   NB. The empty list
   a:
┌┐
││
└┘
   f a:
┌┐
││
└┘
   f < 1 ; 1 ; 2
1
   f < < 1
1
   f < < 1 2 3 4
1
   f < 1 2 3 4 ; 1
0

Retina, 35 bytes
If only [] could return true or false. Returning a 3rd value makes it so much longer.
\[]
xx
\d|],

M`^\[(\[,*)\1*]]|x
2

Try it online
This is the core program. It removes digits and occurrences of ],, then matches if the number of commas is the same after each [. It would return 0 for []. The code above varies because I added a check for an empty list to make it match twice, then I replace 2 with nothing for a null return.
\d|],

^\[(\[,*)\1*]]

APL, 13 bytes
1=(×∘⍴⍴≢)∪≢¨⎕

In English:

compute the unique of the tallies of each of the subarrays;
reshape the result with the signum of its shape: if its an empty vector, it remains an empty vector;
is it equal to 1?

There's a bug: if the input is the empty list, you should return the empty list instead of 0 or 1. This returns 0.

@marinus, you are absolutely right: I didn't read carefully enough the specs. Let's see if it's worth trying to fix it...

C#, 80 bytes
Im checking length 4 times in this golf. i wish there was a better way to be honest.
bool f(List<int[]>a){return a.Where(m=>m.Length==a[0].Length).Count()==a.Count;}

alternative version also 80 bytes..
bool f(List<int[]>a){return a.Where(m=>m.Length==a[0].Length).SequenceEqual(a);}

Prolog, 40
m([],L).
m([H|T],L):-length(H,L),m(T,L).

Provide a true/false answer when calling m(X,L) for some input X.

APL, 13 bytes
{(×⍴⍵)↑⍵≡↓↑⍵}

Explanation:

↓↑⍵: turn the list of arrays into a matrix, and then turn the matrix back into a list of arrays. Because a matrix has to be rectangular, short arrays will be padded with zeroes to match the longest.
⍵≡: see if the result is equal to the input. This is only the case if no zeroes have been added, which means all the sublists were the same length.
×⍴⍵: take the sign of the length of ⍵, which is 0 if ⍵ is empty and 1 if not.
↑: take the first 0 or 1 items from the result depending on whether the array was empty or not.

Turn it into a train to save 4 bytes: ×∘⍴↑⊢≡↓∘↑. Btw, will I see you in Glasgow?

@Adám: hopefully, if nothing goes wrong, I will indeed come to Glasgow. But when you have improvements to my posts, it is better to suggest them as edits officially, that way you will get part of the reputation for subsequent upvotes. I don't want to just copy your improvements into my answers without you getting any benefit from it, it feels like cheating.

@marinus Suggesting golfing edits to an answer is against site policy. All such edits should be rejected as "causes harm" or "conflicts with author's intent".

Clojure, 40 bytes
#(if(not-empty %)(apply =(map count %)))

Yay for suitable language features :)

source: Stack Exchange

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

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

sort: votes


text:
Check if a pattern appears in a DNA sequence
In a project I am working on, I am checking to see if certain DNA sequences appear in certain genes in E. coli. I have written a program in Java that performs the below features. However, since I wrote my program in Java, the universe needs to be corrected and rid of verbosity by having you write your code in as few bytes as possible.
My program took a DNA sequences and a regex as input (for this challenge, order doesn't matter). The DNA sequence contains only the letters A, C, G, and T. It will be determined if the DNA sequence contains any subsequences that follow the regex, and the output of the program will be the one-indexed location(s) of the first character of each matching subsequence in the DNA sequence in your choice of format. If there is no such location, you may output any reasonable indicator of this.
The regex I used had the following specifications.

A, C, G, and T match to themselves.
N matches to any of A, C, G, and T
(X/Y) means that at the current location in the sequence, the next character(s) in the sequence match X or Y (note that X and Y can be multiple characters long, and that there can be multiple slashes; for example, (AA/AG/GA) matches to AA, AG or GG; however, X and Y must have the same length)

You may assume that the DNA sequence is longer than any sequence that follows the specifications of the regex, and that both the DNA and the regex are valid.

Test cases
Here, the DNA sequence is first, and the regex is second.
AAAAAAAAAA
AAA
==> 1 2 3 4 5 6 7 8

ACGTAATGAA
A(A/C)(T/G/A)
==> 1 5

GGGGCAGCAGCTGACTA
C(NA/AN)
==> 5 8 15

ACGTTAGTTAGCGTGATCGTG
CGTNA
==> 2 12

This is code-golf. The shortest answer in bytes wins. Standard rules apply.

Inb4 someone asks me why I didn't use Java's native regex system; I don't know.

Python 3, 125 bytes
import re,sys
a=sys.argv
s=re.sub
print([i+1 for i in range(len(a[1]))if re.match(s('N','[ACGT]',s('/','|',a[2])),a[1][i:])])

Can you use a=input() instead of the sys stuff?

Pyth, 28 bytes
fT*VSlQ_:RX+\^z"/N.|")0_M.__

Simple regex matching.
I hope there had a function which returns the position of each match, but there is not.
Test suite.

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


text:
Simplify a Date
This is similar to simplifying fractions, but with Dates!
The input of your program must be of the form mm/dd
For example
3/4 //March 4
12/15 //December 15
1/1 // January 1

We assume that the input will be valid such that the months have these numbers of days in them:
January 31
February 28
March 31
April 30
May 31
June 30
July 31
August 31
September 30
October 31
November 30
December 31

Your program's job is to take the assumed valid input, and iteratively (or recursively) simplify the date, and at each iteration (including the 0th), output the date with the full name of the month as written above.
For example:
Given an input of:
12/18

Would output
December 18
June 9
February 3

An input that is already simplified only outputs itself:
11/17

Outputs:
November 17

The month names cannot come from a function in your language. The strings can be obfuscated, computed, however you like, but you cannot use a standard function like GetMonthString(4) or something, you either have to write that function, or find a way to output the month names as described.
I cannot think of any cases where the simplified date produces an illegal date, but if ever you produce an illegal date along the way, output:
Illegal Date

But if you are sure this cannot happen, you do not need to have code covering this case. The dates outputted just always need to be valid according to what was described above (it goes without saying that months and days start at 1).
The algorithm:
At each iteration you divide by the smallest number that divides numerator and denominator.
That is, you find all the numbers such that, dividing both the numerator and denominator by this number produces a new numerator and denominator that are both integers (common factors). Select the smallest one and individually divide the numerator and denominator to produce a new fraction.
If the only number you can divide by is 1, then you have simplified as much as possible and you stop.
I hope this is clear.
Any language is allowed. This is Code Golf, shortest code wins!

question was closed while i was posting an answer. Doh !

@t-clausen.dk The challenge has been reopened.

Why from 12/18 to 6/9 and not 4/6 (I don't get all the iteration mess ... when I simplify a fraction I got immedialtely the resulting simplified value)?

Jelly, 59 bytes
ṣ”/VµÆDf/2ị:@µÐĿị1¦€“£ṢtẒ⁽ẹ½MḊxɲȧėAṅ ɓaṾ¥D¹ṀẏD8÷ṬØ»ṣ⁶¤j€⁶j⁷

Try it online!
How it works
ṣ”/VµÆDf/2ị:@µÐĿị1¦€“...»ṣ⁶¤j€⁶j⁷  Main link. Argument: mm/dd

ṣ”/                                Split at slashes.
   V                               Eval each chunk, yielding [m, d] (integers).
    µ                              Begin a new, monadic chain. Argument: [m, d]
             µÐĿ                   Execute the chain to the left until the results
                                   are no longer unique. Yield the list of all
                                   intermediate results.
     ÆD                              Compute the divisors of each number.
       f/                            Intersect them.
         2ị                          Select the one at index 2. If there is only
                                     one divisor, ị wraps around and selects 1.
           :@                        Divide [m, d] by this common divisor.
                        ¤            Combine the links to the left into a chain.
                 “...»                 Yield the month's name, space-separated.
                      ṣ⁶               Split at spaces.
                €                    For each pair...
             ị                          index into the month's names...
              1¦                        for the first element.
                         j⁶€         Join each pair, separating by spaces.
                            j⁷       Join, separating by linefeeds.

Pyth - 116 87 bytes
jm++@rR3c."ayÖèÈÒ+J÷z4wëÝ~ñ!Õ¥´{mCØóy|å²z¼qP?ë"\qhd;ed.u/RYNPiFKsMcz\/K

Test Suite.

Explanation please? :3

TSQL 296 bytes
Not being allowed to use the standard datename cost me alot of bytes, however to save a few bytes, I used the first 3 characters of the default date description(with the format mon dd yyyy hh:miAM (or PM)) and added the rest of the month name.
Golfed:
use master
DECLARE @ varchar(5) = '12/2'

DECLARE @m int=month('2000/'+@),@d INT=day('2000/'+@)WHILE @m>0BEGIN PRINT left(dateadd(d,@m*29,0),3)+choose(@m,'uary','uary','ch','il','','e','y','ust','tember','ober','ember','ember')+' '+LEFT(@d,2)SELECT @m/=min(n),@d/=min(n)FROM(SELECT number FROM spt_values)x(n)WHERE @m%n+@d%n=0 and n>1 END

Try it online
Ungolfed:
use master
DECLARE @ varchar(5) = '12/2'

DECLARE @m int=month('2000/'+@),@d INT=day('2000/'+@)
WHILE @m>0
BEGIN
PRINT
 left(dateadd(d,@m*29,0),3)
 +choose(@m,'uary','uary','ch','il','','e','y','ust',
  'tember','ober','ember','ember')+' '+LEFT(@d,2)
SELECT @m/=min(n),@d/=min(n)
FROM
(
  SELECT number
  FROM spt_values
)x(n)
WHERE
  @m%n+@d%n=0
  and n>1
END

Umm... what are the first two lines doing there???

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ first line is telling which database to use for this script, second line is declaring the input variable. I have not included them in the count as they define where to execute the script and telling what the input variable is

I see a '12/2' on the second line, are you sure you're telling me the truth?

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ I am afraid I don't understand your question

I think you're using a hard-coded date, although I'm not sure if STDIN is supported in SQL and variants... Also, it seems you misspelled September with Septemper. 'temper','ober','ember','ember')+' '+LEFT(@d,2)

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ you can use any valid date to replace that value. Feel free to test the script online

Let us continue this discussion in chat.


text:
Sum It Up with a Digital Triangle
Well, sum it down really.
Write a program or function that takes in a nonempty list of decimal integers (0-9) and outputs a downward pointing "triangle" of digits with the input list at the top where every digit after the first line is the sum of the two digits above it modulo 10.
For example, the input [7, 5, 0, 9] has output
7 5 0 9
 2 5 9
  7 4
   1

because 2 is (7 + 5) mod 10, 5 is (5 + 0) mod 10, 9 is (0 + 9) mod 10, etc. all the way to 1 being (7 + 4) mod 10.
If the list has only one item, then the output matches the input; e.g. an input of [4] will yield
4

Here are some additional examples:
[0]

0

[1, 2]

1 2
 3

[8, 7]

8 7
 5

[0, 0]

0 0
 0

[1, 4, 2]

1 4 2
 5 6
  1

[0, 1, 0]

0 1 0
 1 1
  2

[1, 0, 0, 0]

1 0 0 0
 1 0 0
  1 0
   1

[1, 2, 3, 4]

1 2 3 4
 3 5 7
  8 2
   0

[1, 2, 3, 5, 8]

1 2 3 5 8
 3 5 8 3
  8 3 1
   1 4
    5

[9, 2, 4, 5, 3, 2, 2]

9 2 4 5 3 2 2
 1 6 9 8 5 4
  7 5 7 3 9
   2 2 0 2
    4 2 2
     6 4
      0

Note that in the output:

The first line does not have leading spaces.
Each subsequent line has one more leading space than the line previous.
Digits are separated by a single space.
Each line is allowed to have up to one trailing space.
There may be a single optional trailing newline.
You must use the characters for normal decimal digits (0 through 9).

The shortest code in bytes wins. Tiebreaker is earlier answer.

First I read the title as "Digital Trauma"

BrainF**k, 396 391 bytes
>+>>++++[-<++++++++>]->,----------[++++++++++.>>++++++++[-<++++<------>>]<.,----------]-<+[-<+]->>+[-<<<<<++++++++++.[-]>[-<+>>.<]<[->+<]>+>>>[[->+]->>+<<<+[-<+]->]>+[-<->[[->+]->+>>+<<<<+[-<+]->]<+>->+[->+]->>[->+<]>+>++++++++++>>-<<[-<-[>>]<]<->>>+[-<<<+>>>[-<->]<+++++++++>>>+]++++++++[-<++++<++++++>>]<<<[-<<<<+[-<+]-<+>>+[->+]->>>>+<]>.>.[-]<[-]<<<[->+<]<<+[-<+]>+]>>[-]<<<-<+[-<+]->>+]

I couldn't resist the temptation to do this one. At least the triangle is pointy-side down.
Input comes in as a string of numeric characters followed by a single newline.
Output will contain a single trailing space on every line.
Examples:
$ bf sd.bf
010
0 1 0
 1 1
  2

$ bf sd.bf
123456
1 2 3 4 5 6
 3 5 7 9 1
  8 2 6 0
   0 8 6
    8 4
     2

$ bf sd.bf
9245322
9 2 4 5 3 2 2
 1 6 9 8 5 4
  7 5 7 3 9
   2 2 0 2
    4 2 2
     6 4
      0

Explanation
Since it's rather difficult to explain the code from a functional perspective, we can instead look at it from the perspective of the state of the tape at various times. The core idea here is that the triangle we output is initialized as a tightly-packed (for BF, anyway) array that shrinks in size by 1 every iteration of a loop. Another important thought is that we use 255 to indicate a "placeholder" that we can search for on the tape.
Initialization
This is the easiest step. At the start of the program, we execute the following:
>+>>++++[-<++++++++>]->

This forces the tape into the following state (where >N< indicates the location of the pointer on the tape)
[ 0 1 32 255 >0< 0 0 ...]

The first number here is a "buffer" location. We're not going to use it on a long-term basis, but it's useful to make little operations simpler and for copying data around.
The second number is the number of spaces that we'll be outputting at the start of each line, starting after the first line. The first line will have no leading spaces.
The third number is the space character we output.
The fourth number is a placeholder 255, so that we can get back to this position relatively easily.
Input
From this position, we will read in all of the characters. At the end of this step, we hope to be in the following situation:
[ 0 1 32 255 a b c d e f ... >255< 0 0 ... ]

Where a b c d e f ... indicates the string of numeric characters that was input (not the newline).
We accomplish this with the following:
,----------[++++++++++.>>++++++++[-<++++<------>>]<.,----------]-

There are some nuances to this. First of all, we will output each character as we get them, and then output a space after it. Secondly, we don't want to copy the ASCII value to the tape, we want to copy the actual numeric digit. Third, we want to stop when we hit a newline and leave ourselves in a good place at that time.
Say our input is 6723. Then, upon reading the first 6, our tape looks like this:
[ 0 1 32 255 >54< 0 0 ...]

We check that this value is not equal to 10 (an ASCII newline) with ,----------[++++++++++. We then print out the value and continue by simultaneously subtracting 48 from the input value and adding 32 to the value next to it (>>++++++++[-<++++<------>>]<), leaving us here:
[ 0 1 32 255 6 >32< 0 ...]

Notice how throughout this process we can assume that all digits to the right of our input are 0--this means that we're not in danger of ruining any previous state if we use values to the right to calculate 6 * 8 and 4 * 8.
Now we output the space character we just generated, and take in a new input, deleting the space we calculated there. Eventually, the input will be terminated by a new line and the loop will exit, leaving a 255 where the newline would have been (,----------]-). This is the second placeholder character we will use to navigate the tape. At this point in our scenario, our tape is exactly this:
[ 0 1 32 255 6 7 2 3 >255< 0 0 ... ]

Calculation
The way this works is that the list of digits between our 255 placeholders is going to shrink by one every iteration of the loop. When it only has 1 digit left in it, we're done and should halt immediately (Note that, at this point, every digit in that list has already been output, so we don't have to worry about outputting it again).
We now use this trick to navigate to the first 255 placeholder: <+[-<+]-. This effectively searches the tape to the left for a 255, changing nothing in between. Now that we've moved the pointer, we can check our exit condition: if there's only one digit in the list, then the cell two spaces to the right will hold 255. Thus, we check against that and start a loop: >>+[-<<
The first step in our loop is to output a newline. So we move to the first cell (our buffer cell), add 10 to it and output. The next step is to output all leading space characters. After outputting them, we increment our count for number of leading spaces. These steps are accomplished by the following:
-<<<<<++++++++++.[-]>[-<+>>.<]<[->+<]>+>>>

Which leaves us in this state:
[ 0 2 32 255 >6< 7 2 3 255 0 0 0 0 0 0 ]

Our next step is to copy the first value in the list over, past the second placeholder 255:
[[->+]->>+<<<+[-<+]->]

We essentially do this by hopping back and forth between our placeholder 255s, leaving us here:
[ 0 2 32 255 >0< 7 2 3 255 0 6 0 0 ... ]

We now start a loop, iterating through the rest of the list, stopping when we hit 255 : >+[-<
At this point, the digit to our immediate left is always 0. So, because we love them, we pop a placeholder 255 in there so that we can come back to our place in the list. The next step is to move the second place in the list to locations surrounding where we moved the first place to, past the second placeholder 255. These steps are accomplished by the following:
->
[[->+]->+>>+<<<<+[-<+]->]

Leaving us here: [ 0 2 32 255 255 >0< 2 3 255 7 6 7 0 ]
Now, both the 6 and 7 have been moved to a location where the calculation can occur. We need two copies of the 7 because the next number in the list will need it as well. The 7 immediately after the 255 serves this purpose, whereas the other 7 will be consumed by the calculation.
First, we add the two digits:
<+>->+[->+]->>
[->+<]>

Leaving us here:
[ 0 2 32 255 0 255 2 3 255 7 0 >13< 0 ]

The next combination of steps is the most complicated. We need to see if the number we're pointing to is larger than 10, and if it is, we subtract 10. In reality, what we do is we subtract 10 from it and see if it hits 0 at any point in the subtraction. If it does, we add 10 back on later. At the end of this, we should have the sum modulo 10.
Prepare a 10 to the right
+>++++++++++
Leave yet another 255 for a loop condition later
>>-<<
If the number is greater than 10 end up one space to the left
else one space to the right
[-<-[>>]<]<->
Check if the previous 255 is two spaces to the right and if it is
add 10 back to our sum--we've subtracted too much
>>+[-<<<+>>>[-<->]<+++++++++>>>+]

At this point, we've accomplished the goal. We have the sum modulo 10!
Also, whether or not the number was greater than 10, we'll end up here:
[ 0 2 32 255 0 255 2 3 255 7 0 3 0 0 >0< ]

Our next goals are to output this new sum, follow it with a space, and inject it back into our list. We do this all with our previous techniques of 255-hopping and adding 48 to our sum, so I won't cover it in detail.
++++++++[-<++++<++++++>>]
<<<[-<<<<+[-<+]-<+>>+[->+]->>>>+<]
>.>.

And we're here: [ 0 2 32 255 3 255 2 3 255 7 0 0 51 >32< ]
Notice how we put an additional 255 placeholder after our newly-injected 3 so that we don't lose place in the list. At this point, we have output our sum and its space, so we need to clean up and revert to a state where the next iteration of this loop is going to work. We need to clear out our 51 and 32 cells, move the 7 once to the right, and navigate to our list placeholder so that we can start over.
[-]<[-]<<<[->+<]<<+[-<+]

Now, we're here: [ 0 2 32 255 3 >0< 2 3 255 0 7 0 ... ]
Which is exactly where we want to be for our next iteration. So check for 255 and move on! (>+])
When we get dropped off from the loop, we're going to have a whole new list--made up of the sums from the previous list. The first time, it'll look like this:
 [ 0 2 32 255 3 9 5 0 >0< ]

Now we want to repeat that whole process on our new list, so we plop a 255 down to the left and start all over! We need to do a little bit of cleanup with >>[-]<<, and then drop our placeholder with <-. After that, we're in exactly the same place as we were after input, so we can get away with doing the same checks: <+[-<+]->>+, and boom! We've got our full loop! All we need is the closing bracket, and when it ends we've already output everything, so we're done: ].

Welcome back by the way :) You haven't answered since 2015 :o

@HelkaHomba I know! I still visit with some frequency, but I just couldn't resist writing the code for this one. It's perfect for the language :)

"Perfect for BF" is a concept that elludes me :-)

Jelly, 20 19 18 bytes
Ṛ+2\ṖÐ¿%⁵z”@ṚZGḟ”@

Try it online!
Background
Generating the numbers is straightforward in Jelly. The output is a bit more complicated.
Jelly has a built-in grid atom (G) that displays a 2D list with newlines between rows and spaces between columns. We take the 2D array of numbers (generated with each row reversed), and transpose it with fill value @. After revering the resulting array and transposing again, applying G yield the following.
9 2 4 5 3 2 2
@ 1 6 9 8 5 4
@ @ 7 5 7 3 9
@ @ @ 2 2 0 2
@ @ @ @ 4 2 2
@ @ @ @ @ 6 4
@ @ @ @ @ @ 0

To obtain the desired triangular shape, all we have to do is remove the fill value.
How it works
Ṛ+2\ṖÐ¿%⁵z”@ṚZGḟ”@  Main link. Argument: A (list of integers)

Ṛ                   Reverse A.
    ṖÐ¿             While there's more than one element:
 +2\                  Compute the pairwise sum.
                    Collect all intermediate results in a list.
       %⁵           Take all resulting integers modulo 10.
         z”@        Transpose with fill value '@'.
            Ṛ       Reverse the order of the rows.
             Z      Transpose.
              G     Grid.
               ḟ”@  Filter; remove the fill value.

Pyth - 18 bytes
j.e+*dkjdbP.ueM+Vt

Test Suite.
j                                       Join by newlines
 .e                                     Loop over seq in var b and index in var k
  +                                     Concatenate
   *dk                                  Space repeated k times
    jdb                                 Join b by spaces
  P                                     [:-1] to get rid of empty line
   .u             (Q implicit)          Cumulative fixed point over input (var G)
    eM                                  Mod 10 mapped over list
     +V                                 Vectorized addition
      t(G implict)                      G[1:]
      (G implict)                       Vectorize cuts this off to G[:-1]

05AB1E, 20 19 17 bytes
Code:
DvNð×?T%Ððý,¦‚ø€O

Explanation:
D                     # Duplicate the input.
 v                    # Map over it, running the following len(input) times.
  Nð×                 # Multiply the iteration number with a space.
     ?                # Pop and print without a newline.
      T%              # Take all integers modulo 10.
        Ð             # Triplicate the array.
         ðý,          # Join by spaces and print with a newline.
            ¦         # Remove the first element of the array.
             ‚        # Wrap it up, (pop a, b push [a, b]).
              ø       # Zip.
               €O     # Sum up each element.

Uses the CP-1252 encoding. Try it online!.

Python 3.5, 74 72 71 bytes
f=lambda L,*S:f([sum(x)%10for x in zip(L,L[1:print(*S,*L)]or 1)],'',*S)

Input is a list of integers (e.g. f([1,2,3,5,8])), output is to STDOUT. The %10 and the fact that map returns a map object in Python 3 is a bit annoying, meaning we can't do map(lambda*x:sum(x)%10,L,L[1:]) or similar.
The function errors out, but by then the output would have completed. Thanks to @xsot for -1 byte by finding a good place to stick the print.

I don't have 3.5 installed but this should work: f=lambda L,*S:f([sum(x)%10for x in zip(L,L[1:print(*S,*L)]or 1)],'',*S)

@xsot That is... an amazing use of None!

How does print return something? I don't know of the print function returning.

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ Oh wait, you mean Python's print function returning - yeah it returns None on completion

I mean, how useful is None on slicing?

@EʀɪᴋᴛʜᴇGᴏʟғᴇʀ [1:None] is the same as [1:] so it doesn't do anything useful here, but the important part is that it's a place the print can go without needing to add any bytes

MATL, 32 30 29 28 27 26 25 24 bytes
t"X@qZ"y1X9&VhDTTH&Y+10\

1 Byte saved thanks to @Luis
Try it Online!
Modified version for all test cases
Explanation
        % Implicitly grab input
t       % Duplicate the input
"       % For each element of the input (really just a shortcut to loop numel(input) times)
  X@q   % Determine the current loop index and subtract 1
  Z"    % Create an array of blanks this size (these are the padding to the left)
  y     % Copy the current array of numbers from the stack
  1X9   % Get the pre-defined output format of %.15g from the clipboard
  &V    % Convert the input to it's character representation with single spacing
  h     % Horizontally concatenate the left padding and the numbers
  D     % Display the result (consumes the string)
  TT    % Create a two-element vector of 1's ([1 1])
  H&Y+  % Convolve [1 1] with the array (computes the pair-wise sum)
  10\   % Mod 10 the result
        % Implicitly close for loop

Nice! I was trying to find a way to get the leading spaces. I forgot V allows format spec. You can save 1 byte using Z" instead of O: see this link (I'm having trouble with the format in the comment)

@LuisMendo Thanks for the tip! Yea I got the format spec from D which uses that single-space-between numbers by default.

Actually, 43 bytes
;l;D+#"{:^%d}"%╗W;' j1╟╜f.;pXZ`i+9u@%`MdXWX

Try it online!
This program prints a single trailing newline after the output.
Explanation:
;l;D+#"{:^%d}"%╗W;' j1╟╜f.;pXZ`i+9u@%`MdXWX
;l;D+                                        calculate the width of the field (2L-1 where L = len(input))
     #"{:^%d}"%╗                             push to a list, make a Python new-style format string for centering text, save in reg0
                W;' j1╟╜f.;pXZ`i+9u@%`MdXW   while the top of the stack is truthy:
                 ;' j1╟                        duplicate list, join with spaces, push string to a list
                       ╜f.                     center string and print
                          ;pXZ                 zip list with itself shifted forward by 1 (zip(a,a[1:]))
                              `i+9u@%`M        map: add each pair and mod by 10
                                       dX      discard the last value (which was not added with anything)
                                          X  discard the now-empty list after the loop to avoid printing it

Mathematica, 67 Bytes
MatrixForm@NestList[Mod[Total/@Partition[#,2,1],10]&,#,Length@#-1]&

Example:

CJam, 25 bytes
q~{_2ew::+Af%}h;]eeSff*N*

Try it online!
Explanation
This uses a fairly neat trick to generate the triangle layout.
q~      e# Read and evaluate input.
{       e# While the list of digits is non-empty...
  _2ew  e#   Duplicate and get all sublists of length 2.
  ::+   e#   Sum each pair.
  Af%   e#   Take each result modulo 10.
}h
;]      e# Discard the final empty list and wrap the others in an array.
ee      e# Enumerate the array. E.g. for input `[7 5 0 9]` we now get this:
        e# [[0 [7 5 0 9]]
        e#  [1 [2 5 9]]
        e#  [2 [7 4]]
        e#  [3 [1]]]
Sff*    e# Perform S* on each element at depth two. For the integers from the
        e# enumeration this gives a string of that many spaces, i.e. the correct
        e# indentation. For the lists of digits this inserts a space character
        e# between every two digits, thereby spacing out the digits as necessary.
N*      e# Put linefeeds between the pairs of indentation and digit list.

Haskell, 88 bytes
f=mapM putStrLn.(""%)
s%x@(_:y)=(s++(x>>=(:" ").last.show)):(' ':s)%zipWith(+)x y
_%_=[]

Try it online!
I chose the same I/O format and counted f= to compete fairly with the other Haskell answer.
Replacing the first line by just (""%) would give a 72-byte answer that returns a list of lines.
Instead of writing show.(`mod`10) or [mod(a+b)10|(a,b)<-zip x y], it turns out to be shorter to use last on the result of show, which is kinda cute.

Julia, 60 59 bytes
\(x,s="")=x==[]?"":s*join(x," ")"
"*(diag(x'.+x,1)%10\" "s)

Based on @Sp3000's answer. The function \ accepts an array as input and returns a string.
Try it online!

Perl 6,  65 63 62  61 bytes
{put ' 'x my$++,$_ for @_,{.rotor(2=>-1).map(*.sum%10).list}...1}
{put ' 'x my$++,$_ for @_,{@(.rotor(2=>-1).map(*.sum%10))}...1}
{put ' 'x my$++,$_ for @_,{@(map *.sum%10,.rotor(2=>-1))}...1}
{put ' 'x my$++,$_ for @_,{[map *.sum%10,.rotor(2=>-1)]}...1}
Explanation:
{ # anonymous block that takes the list as input (@_)

  put # print with trailing newline

    ' ' x ( my $ )++, # pad with one more space than previous iteration
    $_                   # the list to print for this iteration
    # The ｢.Str｣ method on a List puts spaces between elements
    # which is what ｢put｣ calls on anything that isn't a Str

  for # do that for every list produced from the following

    @_, # the input list

    { # anonymous block that takes the previous list as input ($_)

      [ # turn the following from a Seq into an Array

        map
          *.sum % 10, # sum the values and modulus 10 of the following:

          # take the previous list 2 at a time, backing up one
          $_.rotor( 2 => -1 )

      ]

    }

    ... # repeatedly call that block until:

    1   # the result is only one element long
}

Example:
my &digital-triangle-sum = {put ' 'x my$++,$_ for @_,{[map *.sum%10,.rotor(2=>-1)]}...1}

for [7,5,0,9], [0,1,0], [1,0,0,0], [9,2,4,5,3,2,2] -> \List {
   digital-triangle-sum List

   put '';
}

7 5 0 9
 2 5 9
  7 4
   1

0 1 0
 1 1
  2

1 0 0 0
 1 0 0
  1 0
   1

9 2 4 5 3 2 2
 1 6 9 8 5 4
  7 5 7 3 9
   2 2 0 2
    4 2 2
     6 4
      0

This is not valid - function submissions have to be reusable arbitrarily often.

@Mego   fixed

Java 7, 230 215 213 bytes
int c=0;void m(int[]a){int l=a.length,j=-1,i=-1;if(l<1)return;int[]x=new int[l-1];while(++j<c)p(" ");for(;++i<l;p(a[i]+" "))if(i<l&i>0)x[i-1]=(a[i-1]+a[i])%10;p("\n");c++;m(x);}<T>void p(T s){System.out.print(s);}

This ended up being a bit longer than I thought.. Maybe it can be golfed a bit more though, since I kinda messed up I think..
Some bytes saved thanks to @GiacomoGarabello.
Ungolfed & test code:
Try it here.
class Main{
  static int c = 0;

  static void m(int[] a){
    int l = a.length,
        j = -1,
        i = -1;
    if(l < 1){
      return;
    }
    int[] x = new int[l-1];
    while(++j < c){
      p(" ");
    }
    for(; ++i < l; p(a[i] + " ")){
      if(i < l & i > 0){
        x[i - 1] = (a[i - 1] + a[i]) % 10;
      }
    }
    p("\n");
    c++;
    m(x);
  }

  static <T> void p(T s){
    System.out.print(s);
  }

  static void printAndReset(int[] a){
    m(a);
    c = 0;
    System.out.println();
  }

  public static void main(String[] a){
    printAndReset(new int[]{ 7, 5, 0, 9 });
    printAndReset(new int[]{ 0 });
    printAndReset(new int[]{ 1, 2 });
    printAndReset(new int[]{ 8, 7 });
    printAndReset(new int[]{ 0, 0 });
    printAndReset(new int[]{ 1, 4, 2 });
    printAndReset(new int[]{ 0, 1, 0 });
    printAndReset(new int[]{ 1, 0, 0, 0 });
    printAndReset(new int[]{ 1, 2, 3, 4 });
    printAndReset(new int[]{ 1, 2, 3, 5, 8 });
    printAndReset(new int[]{ 9, 2, 4, 5, 3, 2, 2 });
  }
}

Output:
7 5 0 9
 2 5 9
  7 4
   1

0

1 2
 3

8 7
 5

0 0
 0

1 4 2
 5 6
  1

0 1 0
 1 1
  2

1 0 0 0
 1 0 0
  1 0
   1

1 2 3 4
 3 5 7
  8 2
   0

1 2 3 5 8
 3 5 8 3
  8 3 1
   1 4
    5

9 2 4 5 3 2 2
 1 6 9 8 5 4
  7 5 7 3 9
   2 2 0 2
    4 2 2
     6 4
      0

Create a function void p(String s){System.out.print(s);} and replace the standard print. For the println use p("\n"). Move the int i and int j near the int c=0; (int c=0,i,j;) and move the print(a[i]+" ") inside the for condition so you can remove the brackets for a total of -11

@GiacomoGarabello I learned this shorter print variant today: <T>void p(T s){System.out.print(s);} instead of void p(String s){System.out.print(s);}.

Wow... 2 bytes closer to Pyth and Jelly! Thanks!

@GiacomoGarabello "2 bytes closer to Pyth and Jelly!" Hehe. 'Always look on the bright side of life.' ;)

Pyke, 21 bytes
lVDm}R$],FsT%)od*pKDP

Try it here!
I'd like to think this method's a little bit different.
[1, 2, 3, 5, 8] - take the input
[2, 4, 6, 10, 16] - double it
[1, 2, 3, 5, 8] - take the input again
[1, 1, 2, 3] - get the deltas
[[2,1], [4,1], [6,2], [10,3]] - transpose them together
[3, 5, 8, 13] - apply addition
[3, 5, 8, 3] - mod 10

TSQL, 198 194 191 bytes
By using GOTO instead of one of the WHILE, I was able to golf 3 characters
Golfed
DECLARE @ varchar(100)= '1 2 3 4 5 6 7'

DECLARE @j INT=1,@i INT=LEN(@)a:
PRINT @
WHILE @i>@j
SELECT
@=STUFF(@,@i-1,2,RIGHT(SUBSTRING(@,@i-2,1)+SUBSTRING(@,@i,1)*1,1)+' '),@i-=2SELECT
@=STUFF(@,@j,1,' '),@j+=1,@i=LEN(@)IF @i>0GOTO a

Try it online(using old script with 2*WHILE)

JavaScript (ES6), 77 bytes
a=a.map((_,i)=>(b=a,a=[a.map((e,j)=>j>i?(e+a[j-1])%10:''),b.join` `)).join`
`

JavaScript (ES6) 147 bytes
a=>{o=0;e=(c=>console.log(' '.repeat(o++)+c.join` `));l=1;while(l){p=0,d=[],e(a),a.map(b=>{p?d.push((v+b)%10):0;p=1,v=b});d.length<2?l=0:a=d};e(d)}

Hmm, I have a couple of ideas, to golf this down

C# 6, 125+31 125+18 = 143 bytes
string f(int[] n,string s="")=>s+string.Join(" ",n)+"\n"+(n.Length>1?f(n.Zip(n.Skip(1),(a,b)=>(a+b)%10).ToArray(),s+" "):"");

The +18 is for using System.Linq;
Thanks to @TheLethalCoder for saving 13 bytes, by pointing out a unnecessary using statement

Vyxal C, 10 bytes
λḢ+Ṫ₀%;↔vṄ

Try it Online!
λ     ;    # Push a lambda
 Ḣ         # Remove first  item
  +        # Vectorised addition to original
   Ṫ       # Remove last item
    ₀%     # For each item, modulo 10
       ↔   # Repeat on input while output is truthy
        vṄ # Foreach, join by spaces
           # (C flag) Center and join by newlines.

-6 thanks to Aaron Miller.
Old version, 16 bytes:
L(ðn*₴DṄ,0p+vtḢṪ

Try it Online!
L(               # Length times
  ðn*            # (iteration number) spaces
     ₴           # Output without a newline
      D          # Triple current array
       Ṅ,        # Output first joined by spaces
         0p      # Prepend a 0 to the second
           +     # Vectorised addition
            vt   # Foreach, get last digit
              ḢṪ # And get rid of first + last items

10 bytes

05AB1E, 11 bytes
A translation of Adnan's answer to modern 05AB1E.
vT%DðýNú,ü+

Try it online!
ú pads a string with a given number of spaces and ü applies a binary function between pairs of adjacent items.

PowerShell Core, 99 69 bytes
($a=$args)|%{"$s$a"
$a=$a|%{($p+$_)%10;$p=$_}|select -skip 1
$s+=" "}

Try it online!
-99 bytes thanks to @mazzy !

in the PowerShell style Try it online! :)

Jelly, 14 bytes
SƝƬ%⁵µ⁶oṚżK€ṖY

Try it online!
Full program which prints the result
How it works
SƝƬ%⁵µ⁶oṚżK€ṖY - Main link. Takes a list L on the left
  Ƭ            - Until reaching a fixed point:
S              -   Take the sum of:
 Ɲ             -     All overlapping pairs
   %⁵          - Mod each by 10
     µ         - Begin a new link with the list of steps as the argument:
      ⁶o       - Replace all elements with spaces
        Ṛ      - Reverse
          K€   - Join each list with spaces
         ż     - Zip together
            Ṗ  - Remove the last line of spaces
             Y - Join on newlines

C, 138 bytes
Golfed
c,d;main(int a,char**b){b++;while(c++,d=0,--a)while(d<a)printf("%*c%c",!d?c:1,*b[d],(d+2>a)*10),++d<a?*b[d-1]=(*b[d-1]+*b[d]-96)%10+48:0;}

Ungolfed
c,d;
main(int a,char**b){
b++;
while(c++,d=0,--a)
    while(d<a)
        printf("%*c%c",
          !d?c:1,      //number of blanks in front of digit
          *b[d],       //digit
          (d+2>a)*10), //returns 10(new line) only for d+1 == a
        ++d<a
          ? *b[d-1]=(*b[d-1]+*b[d]-96)%10+48 //update digit
          :  0;
}

C#, 167 bytes
Im actually pretty proud of this solution, lambda expressions are so fun once you get the hang of them
void f(List<int> a){int x=a.Count;for(int s=0;s<x;s++){Console.WriteLine(new String(' ',s)+string.Join(" ",a));a=a.Take(x-s-1).Select((v,i)=>(a[i+1]+v)%10).ToList();}}

here ungolfed for further improvements:
void f(List<int> a)
{
int x = a.Count;
for (int s = 0; s<x ;s++)
{
    Console.WriteLine(new String(' ',s)+string.Join(" ",a));
    a=a.Take(x-s-1).Select((v,i)=>(a[i+1]+v)%10).ToList();
}
}

try it out here

You can save 2 bytes by using an array for input rather than a list. List<int> a -> int[] a, int x=a.Count -> int x=a.Length, .ToList() -> ToArray()

Python 3, 97 bytes
def f(x):print(*x);x[-1]==''or f(['']+[(x[i]+x[i+1])%10if''!=x[i]else''for i in range(len(x)-1)])

Prints a single trailing newline.
How it works
def f(x):                            function with input of list of numbers
print(*x)                            print the old line of the triangle
x[-1]==''or...                       if no more numbers, stop...
(x[i]+x[i+1])%10if''!=x[i]else''...  ...else compute the next entry in the new line if
                                     possible...
...for i in range(len(x)-1)          ...for all relevant digit pairs...
['']+...                             ...concatenate with empty string to force new leading
                                     space...
f(...)                               ...and pass to function

Try it on Ideone

Haskell, 139 bytes
f=mapM(\(r,s)->putStrLn$r++(s>>=(++" ").show)).zip(iterate(' ':)"").takeWhile(/=[]).iterate g where g(_:[])=[];g(y:p:ys)=mod(y+p)10:g(p:ys)

Takes input as an argument, outputs to STDOUT.
Ungolfed version:
f = mapM (\(r, s) -> putStrLn $ r ++ (s >>= (++ " ") . show))
    . zip (iterate (' ' :) "")
    . takeWhile (/= [])
    . iterate sumTerms
    where sumTerms (_:[]) = []
          sumTerms (y:p:ys) = mod (y+p) 10 : sumTerms (p:ys)

J, 44 bytes
(#\.-#)|."_1#\.(":@{."_1)2(10|+/)\^:(]i.@#)]

Based on this solution.

Javascript (using external library) (198 bytes)
n=>{a=_.From(n);b=a.Write(" ");c=1;while(++c){a=a.BatchAccumulate(2).Where(y=>y.Count()==2).Select(z=>z.Sum()%10);if(a.Count()==0){break;}b+="\r\n"+_.Range(0,c).Write(" ",x=>"")+a.Write(" ")}return b}

Link to lib: https://github.com/mvegh1/Enumerable/
Code explanation: This was easy using the library! Doesn't win in bytes, but the code isn't too verbose and easy to read. So, the input "n' is an array of integers. Load it up into the library, stored in variable "a". "b" is the return string, store the joined string with " " as delimiter into b. c is the current iteration, use this to determine the number of spaces to insert. NOTE: This only seems to work nicely when the input is from 0-9. Then, while true, repeat a certain set of code. That code is to create adjacent batch sets of the current enumerable "a", i.e if we have [1,2,3,4,5,6] we get [1,2],[2,3],[3,4],...[6] ... then filter that so we only have the batches of size 2. Then we map that to a collection of the sums of the batches % 10. If a is empty, we are done, else we add the new line to our return. Finally return...
Picture coming in a few min.

Japt -R, 16 bytes
_ä+ muA}hUÊN m¸û

Try it
_ä+ m%A}hNUÊ m¸û     :Implicit input of array U
_                    :Function taking an array as input
 ä                   :  Consecutive pairs
  +                  :  Reduced by addition
    m                :  Map
     %A              :    Mod 10
       }             :End function
        h            :Run that function
         N           :  Taking the last element of the array of all inputs, and pushing the results to it
          UÊ         :  Until it's length matches the length of U
             m       :Map the final N
              ¸      :   Join with spaces
               û     :Centre pad each with spaces to the length of the longest
                     :Implicit out put joined with newlines

Stax, 14 bytes
üε↕Φ¬ⁿ╣VU6Co'm

Run and debug it

Zsh, 99 80 bytes
a=($@)
for j;{<<<$s$a;for i ({2..$#a})b+=($[(a[i-1]+a[i])%10])
s+=\ ;a=($b);b=;}

try it online!
99 bytes

Java (JDK), 170 165 160 bytes
a->{int i=0,k,j,o=a.length;for(;i++<o;a[o-i]=-1){var s=" ".repeat(i);for(j=0;j<=o-i;)s+=a[j++]+" ";for(k=0;k<o-1;)a[k]=(a[k]+a[++k])%10;System.out.println(s);}}

Try it online!
Thanks to ceilingcat

Pip -s, 20 bytes
Wg&OlPBxg:_+BMP Pg%t

Takes the numbers as command-line arguments. Try it online!
Explanation
We'll be leaning heavily on the -s flag, which sets the list output format to "join on spaces." A list of three integers [1 2 3] is printed as 1 2 3; a list of three empty strings ["" "" ""] is printed as   (two spaces).
Wg&OlPBxg:_+BMP Pg%t
                      g is list of cmdline args; l is []; x is ""; t is 10 (implicit)
Wg                    While g is truthy (nonempty)
  &                   and the following is also truthy...
    lPBx              Append the empty string to l in-place
   O                  and output l (joined on spaces) with no trailing newline
                      The shenanigans with l 1) output 0, 1, 2, etc. spaces at the start of
                      each iteration, and 2) always evaluate as truthy (non-empty list),
                      thereby not affecting the while loop condition
                      Inside the loop:
                 g%t    Take each value in g, mod 10
                P       Print that list (joined on spaces) with a trailing newline
             MP         To each pair of numbers in the list, map this function:
          _               The first number
           +B             plus the second number
        g:              Assign that result back to g


text:
Generalized Birthday Problem
Tonight, my fiancée took me out to dinner to celebrate my birthday. While we were out, I heard Happy Birthday sung to 5 different guests (including myself), in a restaurant full of 50 people. This got me wondering - the original birthday problem (finding the probability that 2 people in a room of N people share the same birthday) is very simple and straightforward. But what about calculating the probability that at least k people out of N people share the same birthday?
In case you're wondering, the probability of at least 5 people out of 50 total people sharing the same birthday is about 1/10000.
The Challenge
Given two integers N and k, where N >= k > 0, output the probability that at least k people in a group of N people share the same birthday. To keep things simple, assume that there are always 365 possible birthdays, and that all days are equally likely.
For k = 2, this boils down to the original birthday problem, and the probability is 1 - P(365, N)/(365)**N (where P(n,k) is the number of k-length permutations formed from n elements). For larger values of k, this Wolfram MathWorld article may prove useful.
Rules

Output must be deterministic, and as accurate as possible for your chosen language. This means no Monte Carlo estimation or Poisson approximation.
N and k will be no larger than the largest representable integer in your chosen language. If your chosen language has no hard maximum on integers (aside from memory constraints), then N and k may be arbitrarily large.
Accuracy errors stemming from floating-point inaccuracies may be ignored - your solution should assume perfectly-accurate, infinite-precision floats.

Test Cases
Format: k, N -> exact fraction (float approximation)
2, 4 -> 795341/48627125 (0.016355912466550306)
2, 10 -> 2689423743942044098153/22996713557917153515625 (0.11694817771107766)
2, 23 -> 38093904702297390785243708291056390518886454060947061/75091883268515350125426207425223147563269805908203125 (0.5072972343239854)
3, 3 -> 1/133225 (7.5060987051979735e-06)
3, 15 -> 99202120236895898424238531990273/29796146005797507000413918212890625 (0.0033293607910766013)
3, 23 -> 4770369978858741874704938828021312421544898229270601/375459416342576750627131037126115737816349029541015625 (0.01270542106874784)
3, 88 -> 121972658600365952270507870814168157581992420315979376776734831989281511796047744560525362056937843069780281314799508374037334481686749665057776557164805212647907376598926392555810192414444095707428833039241/238663638085694198987526661236008945231785263891283516149752738222327030518604865144748956653519802030443538582564040039437134064787503711547079611163210009542953054552383296282869196147657930850982666015625 (0.5110651106247305)
4, 5 -> 1821/17748900625 (1.0259790386313012e-07)
4, 25 -> 2485259613640935164402771922618780423376797142403469821/10004116148447957520459906484225353834116619892120361328125 (0.0002484237064787077)
5, 50 -> 786993779912104445948839077141385547220875807924661029087862889286553262259306606691973696493529913926889614561937/7306010813549515310358093277059651246342214174497508156711617142094873581852472030624097938198246993124485015869140625 (0.00010771867165219201)
10, 11 -> 801/8393800448639761033203125 (9.542757239717371e-23)
10, 20 -> 7563066516919731020375145315161/4825745614492126958810682272575693836212158203125 (1.5672327389589693e-18)
10, 100 -> 122483733913713880468912433840827432571103991156207938550769934255186675421169322116627610793923974214844245486313555179552213623490113886544747626665059355613885669915058701717890707367972476863138223808168550175885417452745887418265215709/1018100624231385241853189999481940942382873878399046008966742039665259133127558338726075853312698838815389196105495212915667272376736512436519973194623721779480597820765897548554160854805712082157001360774761962446621765820964355953037738800048828125 (1.2030611807765361e-10)
10, 200 -> 46037609834855282194444796809612644889409465037669687935667461523743071657580101605348193810323944369492022110911489191609021322290505098856358912879677731966113966723477854912238177976801306968267513131490721538703324306724303400725590188016199359187262098021797557231190080930654308244474302621083905460764730976861073112110503993354926967673128790398832479866320227003479651999296010679699346931041199162583292649095888379961533947862695990956213767291953359129132526574405705744727693754517/378333041587022747413582050553902956219347236460887942751654696440740074897712544982385679244606727641966213694207954095750881417642309033313110718881314425431789802709136766451022222829015561216923212248085160525409958950556460005591372098706995468877542448525403291516015085653857006548005361106043070914396018461580475651719152455730181412523297836008507156692430467118523245584181582255037664477857149762078637248959905010608686740872875726844702607085395469621591502118462813086807727813720703125 (1.21685406174776e-07)

Happy birthday (belated)!

Maybe add a couple of test cases for small numbers?

@LuisMendo I will add some more after I get a few hours of sleep :)

It's worth noting that the probability that people eat at a restaurant is probably not independent of whether it's their birthday, so the probability of five birthdays out of 50 people is probably higher than the Birthday Problem logic would suggest.

@GlenO Good point!

Is the input format in the same order? (n, k) = (2, 4) would be 0, but (k, n) = (2, 4) is ~0.016.

@miles Good catch, thanks! Not sure how I got those flipped.

Jelly, 17 16 bytes
ĠZL
365ṗÇ€<¬µS÷L

Extremely inefficient. Try it online! (but keep N below 3)
How it works
365ṗÇ€<¬µS÷L  Main link. Left argument: N. Right argument: K

365ṗ          Cartesian product; generate all lists of length N that consist of
              elements of [1, ..., 365].
    Ç€        Map the helper link over all generated lists. It returns the highest
              amount of people that share a single birthday.
      <       Compare each result with K.
       ¬      Negate.
        µS÷L  Take the mean by dividing the sum by the length.

ĠZL           Helper link. Argument: A (list of integers)

Ġ             Group the indices have identical values in A.
 Z            Zip; transpose rows with columns.
  L           Take the length of the result, thus counting columns.

"keep N below 3"... isn't that overly restrictive?

@Neil The solution is valid for all inputs, but the online interpreter won't be able to run inputs where N > 3, due to memory and time constraints.

@Mego I was just thinking that because it doesn't make much sense if you don't have k > 1, then given k <= N, if you then want to keep N < 3, that doesn't leave much choice for the values of N and k that you can try.

MATL, 16 bytes
365:Z^!tXM=s>~Ym

First input is N, second is k.
Try it online!
This is an enumeration-based approach, like Dennis' Jelly answer, so input numbers should be kept small due to memory limitations.
365:   % Vector [1 2 ... 365]
Z^     % Take N implicitly. Cartesian power. Gives a 2D array with each
       % "combination" on a row
!      % Transpose
t      % Duplicate
XM     % Mode (most frequent element) of each column
=      % Test for equality, element-wise with broadcast. For each column, gives
       % true for elements equal to that column's mode, false for the rest
s      % Sum of each column. Gives a row vector
>~     % Take k implicitly. True for elements equal or greater than k
Ym     % Mean of each column. Implicitly display

You outgolfed Dennis, good job.

@m654 Let's see when he wakes up :-D

Well, I woke up, but the best I managed was a tie. Jelly really needs a mean atom...

@Dennis I was thinking the same. Maybe a mode atom too?

J, 41 36 bytes
(+/%#)@(<:365&(#~>./@(#/.~)@#:i.@^))

Straight-forward approach similar to the others. Runs into memory issues at n > 3.
Usage
Takes the value of k on the LHS and n on the RHS.
   f =: (+/%#)@(<:365&(#~>./@(#/.~)@#:i.@^))
   0 f 0
0
   0 f 1
1
   1 f 1
1
   0 f 2
1
   1 f 2
1
   2 f 2
0.00273973
   0 f 3
1
   1 f 3
1
   2 f 3
0.00820417
   3 f 3
7.5061e_6

On my pc, using an i7-4770k and the timer foreign 6!:2, computing for n = 3 requires about 25 seconds.
   timer =: 6!:2
   timer '2 f 3'
24.7893
   timer '3 f 3'
24.896

Explanation
(+/%#)@(<:365&(#~>./@(#/.~)@#:i.@^)) Input: k on LHS, n on RHS
          365&                       The number 365
               #~                    Create n copies of 365
                                 ^   Calculate 365^n
                              i.@    The range [0, 1, ..., 365^n-1]
                            #:       Convert each value in the range to base-n and pad
                                     with zeroes to the right so that each has n digits
                     (#/.~)@         Find the size of each set of identical values
                 >./@                Find the max size of each
        <:                           Test each if greater than or equal to k
(+/%#)@                              Apply to the previous result
 +/                                  Find the sum of the values
    #                                Count the number of values
   %                                 Divide the sum by the count and return