This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Collatz | |
def initialize(observer) | |
@observer = observer | |
@lengths = Hash.new | |
end | |
def length(num) | |
len = @lengths[num] | |
if !len |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The following iterative sequence is defined for the set of positive integers: | |
# Given a number n in the Collatz sequence, | |
# if n is even, the next number in the sequence is n/2 | |
# if n is odd, the next number in the sequence is 3n + 1 | |
# Applying the rule above with the starting number 13, we generate the following sequence: | |
# 13 40 20 10 5 16 8 4 2 1 It can be seen that this sequence (starting at 13 and | |
# finishing at 1) contains 10 terms. Although it has not been proved yet |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0 0x0000003eafc35c39 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 | |
resultvar = 0 | |
pid = 9552 | |
selftid = 9552 | |
#1 0x0000003eafc37348 in __GI_abort () at abort.c:89 | |
save_stage = 2 | |
act = {__sigaction_handler = {sa_handler = 0x7fffe35180a8, sa_sigaction = 0x7fffe35180a8}, sa_mask = {__val = {269238112115, 139966439121016, 64, 4294967295, 269236765939, 4, 140737007142160, | |
12403688816, 140737007142240, 568745990, 0, 0, 0, 21474836480, 139966434291712, 269238123912}}, sa_flags = 2044879046, | |
sa_restorer = 0x7f4c79e26280 <IndexerJob::update(std::shared_ptr<IndexerJob> const&)::__PRETTY_FUNCTION__>} | |
sigs = {__val = {32, 0 <repeats 15 times>}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#0 0x0000003eafc35c39 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 | |
#1 0x0000003eafc37348 in __GI_abort () at abort.c:89 | |
#2 0x0000003eafc2eb96 in __assert_fail_base (fmt=0x3eafd7bd88 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7f4c79e260c6 "!(flags & Complete)", | |
file=file@entry=0x7f4c79e26078 "/home/kevin/Source/System/rtags/src/IndexerJob.cpp", line=line@entry=64, | |
function=function@entry=0x7f4c79e26280 <IndexerJob::update(std::shared_ptr<IndexerJob> const&)::__PRETTY_FUNCTION__> "bool IndexerJob::update(const std::shared_ptr<IndexerJob>&)") at assert.c:92 | |
#3 0x0000003eafc2ec42 in __GI___assert_fail (assertion=0x7f4c79e260c6 "!(flags & Complete)", file=0x7f4c79e26078 "/home/kevin/Source/System/rtags/src/IndexerJob.cpp", line=64, | |
function=0x7f4c79e26280 <IndexerJob::update(std::shared_ptr<IndexerJob> const&)::__PRETTY_FUNCTION__> "bool IndexerJob::update(const std::shared_ptr<IndexerJob>&)") at assert.c:101 | |
#4 0x00007f4c79c1b380 in I |