Output Sequence by Dan

m = {1 => ""}\x0d
r = 1\x0d
rd = {1 => 0}\x0d
(1..100).each do |c|\x0d
  mof = c % 5 == 0\x0d
  mot = c % 3 == 0\x0d
  if mot && !mof    \x0d
    rd[r] += 1\x0d
    c.to_s.length.times { m[r] << " "} unless rd[r] == 2\x0d
    r += 1\x0d
  end\x0d
  \x0d
  if mof && !mot\x0d
    c.to_s.length.times { m[r] << " "}  \x0d
    r -= 1\x0d
  end\x0d
  if m[r].nil?\x0d
    m[r] = ""\x0d
    rd[r] = 0\x0d
    (m[r-1].to_s.length - c.to_s.length).times { m[r] << " " }\x0d
  end\x0d
  c.to_s.length.times { m[r-1] << " " } unless r == 1 ||  mot ||  rd[r-1] == 2\x0d
  c.to_s.length.times { m[r+1] << " " } unless m[r+1].nil? ||  mof\x0d
   \x0d
   m[r] << c.to_s\x0d
end\x0d
\x0d
(1..15).each {|i| puts m[i].to_s}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return top