Hofstadter Q sequence: Difference between revisions
Content added Content deleted
m ({{out}}) |
(Updated second D entry) |
||
Line 448: | Line 448: | ||
<lang d>import std.stdio, std.algorithm, std.range, std.array; |
<lang d>import std.stdio, std.algorithm, std.range, std.array; |
||
⚫ | |||
struct Q { |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
nothrow static this() { |
|||
s ~= [ |
s ~= s.data[i - s.data[i - 1]] + s.data[i - s.data[i - 2]]; |
||
⚫ | |||
} |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
s ~= s.data[i - s.data[i - 1]] + s.data[i - s.data[i - 2]]; |
|||
⚫ | |||
} |
|||
} |
} |
||