Module integer_sequences.sequences

Expand source code
EXAMPLE_LOG_AS_INTS = [
    (1, 2, 3, 4),
    (1, 3, 2, 4),
]
"""An example XES trace converted to integers."""

FIB = [
    1,
    1,
    2,
    3,
    5,
    8,
    13,
    21,
    34,
    55,
    89,
    144,
    233,
    377,
    610,
    987,
    1597,
    2584,
    4181,
    6765,
    10946,
    17711,
    28657,
    46368,
    75025,
    121393,
    196418,
    317811,
    514229,
    832040,
    1346269,
    2178309,
    3524578,
    5702887,
    9227465,
    14930352,
    24157817,
    39088169,
    63245986,
    102334155,
    165580141,
    267914296,
    433494437,
    701408733,
    1134903170,
    1836311903,
    2971215073,
    4807526976,
    7778742049,
    12586269025,
    20365011074,
    32951280099,
    53316291173,
    86267571272,
    139583862445,
    225851433717,
    365435296162,
    591286729879,
    956722026041,
    1548008755920,
    2504730781961,
    4052739537881,
    6557470319842,
    10610209857723,
    17167680177565,
    27777890035288,
    44945570212853,
    72723460248141,
    117669030460994,
    190392490709135,
    308061521170129,
    498454011879264,
    806515533049393,
    1304969544928657,
    2111485077978050,
    3416454622906707,
    5527939700884757,
    8944394323791464,
    14472334024676221,
    23416728348467685,
    37889062373143906,
    61305790721611591,
    99194853094755497,
    160500643816367088,
    259695496911122585,
    420196140727489673,
    679891637638612258,
    1100087778366101931,
    1779979416004714189,
    2880067194370816120,
    4660046610375530309,
    7540113804746346429,
    12200160415121876738,
    19740274219868223167,
    31940434634990099905,
    51680708854858323072,
    83621143489848422977,
    135301852344706746049,
    218922995834555169026,
    354224848179261915075,
]
"""First 100 digits in the fibonacci sequence."""

PASCAL = [
    1,
    1,
    1,
    1,
    2,
    1,
    1,
    3,
    3,
    1,
    1,
    4,
    6,
    4,
    1,
    1,
    5,
    10,
    10,
    5,
    1,
    1,
    6,
    15,
    20,
    15,
    6,
    1,
    1,
    7,
    21,
    35,
    35,
    21,
    7,
    1,
    1,
    8,
    28,
    56,
    70,
    56,
    28,
    8,
    1,
    1,
    9,
    36,
    84,
    126,
    126,
    84,
    36,
    9,
    1,
    1,
    10,
    45,
    120,
    210,
    252,
    210,
    120,
    45,
    10,
    1,
    1,
    11,
    55,
    165,
    330,
    462,
    462,
    330,
    165,
    55,
    11,
    1,
    1,
    12,
    66,
    220,
    495,
    792,
    924,
    792,
    495,
    220,
    66,
    12,
    1,
    1,
    13,
    78,
    286,
    715,
    1287,
    1716,
    1716,
    1287,
]
"""First 100 digits in the sequence given by the triangle of pascal."""

CATALAN = [
    1,
    1,
    2,
    5,
    14,
    42,
    132,
    429,
    1430,
    4862,
    16796,
    58786,
    208012,
    742900,
    2674440,
    9694845,
    35357670,
    129644790,
    477638700,
    1767263190,
    6564120420,
    24466267020,
    91482563640,
    343059613650,
    1289904147324,
    4861946401452,
    18367353072152,
    69533550916004,
    263747951750360,
    1002242216651368,
    3814986502092304,
    14544636039226909,
    55534064877048198,
    212336130412243110,
    812944042149730764,
    3116285494907301262,
    11959798385860453492,
    45950804324621742364,
    176733862787006701400,
    680425371729975800390,
    2622127042276492108820,
    10113918591637898134020,
    39044429911904443959240,
    150853479205085351660700,
    583300119592996693088040,
    2257117854077248073253720,
    8740328711533173390046320,
    33868773757191046886429490,
    131327898242169365477991900,
    509552245179617138054608572,
    1978261657756160653623774456,
    7684785670514316385230816156,
    29869166945772625950142417512,
    116157871455782434250553845880,
    451959718027953471447609509424,
    1759414616608818870992479875972,
    6852456927844873497549658464312,
    26700952856774851904245220912664,
    104088460289122304033498318812080,
    405944995127576985730643443367112,
    1583850964596120042686772779038896,
    6182127958584855650487080847216336,
    24139737743045626825711458546273312,
    94295850558771979787935384946380125,
    368479169875816659479009042713546950,
    1440418573150919668872489894243865350,
    5632681584560312734993915705849145100,
    22033725021956517463358552614056949950,
    86218923998960285726185640663701108500,
    337485502510215975556783793455058624700,
    1321422108420282270489942177190229544600,
    5175569924646105559418940193995065716350,
    20276890389709399862928998568254641025700,
    79463489365077377841208237632349268884500,
    311496878311103321137536291518809134027240,
    1221395654430378811828760722007962130791020,
    4790408930363303911328386208394864461024520,
    18793142726809884575211361279087545193250040,
    73745243611532458459690151854647329239335600,
    289450081175264899454283846029490767264392230,
    1136359577947336271931632877004667456667613940,
    4462290049988320482463241297506133183499654740,
    17526585015616776834735140517915655636396234280,
    68854441132780194707888052034668647142985206100,
    270557451039395118028642463289168566420671280440,
    1063353702922273835973036658043476458723103404520,
    4180080073556524734514695828170907458428751314320,
    16435314834665426797069144960762886143367590394940,
    64633260585762914370496637486146181462681535261000,
    254224158304000796523953440778841647086547372026600,
    1000134600800354781929399250536541864362461089950800,
    3935312233584004685417853572763349509774031680023800,
    15487357822491889407128326963778343232013931127835600,
    60960876535340415751462563580829648891969728907438000,
    239993345518077005168915776623476723006280827488229600,
    944973797977428207852605870454939596837230758234904050,
    3721443204405954385563870541379246659709506697378694300,
    14657929356129575437016877846657032761712954950899755100,
    57743358069601357782187700608042856334020731624756611000,
    227508830794229349661819540395688853956041682601541047340,
    896519947090131496687170070074100632420837521538745909320,
]
"""First 100 catalan numbers."""

RECAMAN = [
    0,
    1,
    3,
    6,
    2,
    7,
    13,
    20,
    12,
    21,
    11,
    22,
    10,
    23,
    9,
    24,
    8,
    25,
    43,
    62,
    42,
    63,
    41,
    18,
    42,
    17,
    43,
    16,
    44,
    15,
    45,
    14,
    46,
    79,
    113,
    78,
    114,
    77,
    39,
    78,
    38,
    79,
    37,
    80,
    36,
    81,
    35,
    82,
    34,
    83,
    33,
    84,
    32,
    85,
    31,
    86,
    30,
    87,
    29,
    88,
    28,
    89,
    27,
    90,
    26,
    91,
    157,
    224,
    156,
    225,
    155,
    226,
    154,
    227,
    153,
    228,
    152,
    75,
    153,
    74,
    154,
    73,
    155,
    72,
    156,
    71,
    157,
    70,
    158,
    69,
    159,
    68,
    160,
    67,
    161,
    66,
    162,
    65,
    163,
    64,
]
"""First 100 digits in the recaman sequence."""


UP = [
    1,
    2,
    3,
    4,
    5,
    6,
    7,
    8,
    9,
    10,
    11,
    12,
    13,
    14,
    15,
    16,
    17,
    18,
    19,
    20,
    21,
    22,
    23,
    24,
    25,
    26,
    27,
    28,
    29,
    30,
    31,
    32,
    33,
    34,
    35,
    36,
    37,
    38,
    39,
    40,
    41,
    42,
    43,
    44,
    45,
    46,
    47,
    48,
    49,
    50,
    51,
    52,
    53,
    54,
    55,
    56,
    57,
    58,
    59,
    60,
    61,
    62,
    63,
    64,
    65,
    66,
    67,
    68,
    69,
    70,
    71,
    72,
    73,
    74,
    75,
    76,
    77,
    78,
    79,
    80,
    81,
    82,
    83,
    84,
    85,
    86,
    87,
    88,
    89,
    90,
    91,
    92,
    93,
    94,
    95,
    96,
    97,
    98,
    99,
    100,
]
"""First 100 digits in the sequence as generated by `range_up`, with sane defaults.
Created with Excel, so this testcase assumes correctness of Excel."""

DOWN = [
    100,
    99,
    98,
    97,
    96,
    95,
    94,
    93,
    92,
    91,
    90,
    89,
    88,
    87,
    86,
    85,
    84,
    83,
    82,
    81,
    80,
    79,
    78,
    77,
    76,
    75,
    74,
    73,
    72,
    71,
    70,
    69,
    68,
    67,
    66,
    65,
    64,
    63,
    62,
    61,
    60,
    59,
    58,
    57,
    56,
    55,
    54,
    53,
    52,
    51,
    50,
    49,
    48,
    47,
    46,
    45,
    44,
    43,
    42,
    41,
    40,
    39,
    38,
    37,
    36,
    35,
    34,
    33,
    32,
    31,
    30,
    29,
    28,
    27,
    26,
    25,
    24,
    23,
    22,
    21,
    20,
    19,
    18,
    17,
    16,
    15,
    14,
    13,
    12,
    11,
    10,
    9,
    8,
    7,
    6,
    5,
    4,
    3,
    2,
    1,
]
"""First 100 digits in the sequence as generated by `range_down`, with sane defaults.
Created with Excel, so this testcase assumes correctness of Excel."""

LONGTERM = [
    1,
    2,
    3,
    4,
    5,
    6,
    8,
    11,
    15,
    20,
    26,
    34,
    45,
    60,
    80,
    106,
    140,
    185,
    245,
    325,
    431,
    571,
    756,
    1001,
    1326,
    1757,
    2328,
    3084,
    4085,
    5411,
    7168,
    9496,
    12580,
    16665,
    22076,
    29244,
    38740,
    51320,
    67985,
    90061,
    119305,
    158045,
    209365,
    277350,
    367411,
    486716,
    644761,
    854126,
    1131476,
    1498887,
    1985603,
    2630364,
    3484490,
    4615966,
    6114853,
    8100456,
    10730820,
    14215310,
    18831276,
    24946129,
    33046585,
    43777405,
    57992715,
    76823991,
    101770120,
    134816705,
    178594110,
    236586825,
    313410816,
    415180936,
    549997641,
    728591751,
    965178576,
    1278589392,
    1693770328,
    2243767969,
    2972359720,
    3937538296,
    5216127688,
    6909898016,
    9153665985,
    12126025705,
    16063564001,
    21279691689,
    28189589705,
    37343255690,
    49469281395,
    65532845396,
    86812537085,
    115002126790,
    152345382480,
    201814663875,
    267347509271,
    354160046356,
    469162173146,
    621507555626,
    823322219501,
    1090669728772,
    1444829775128,
    1913991948274,
]
"""First 100 digits in the long_term_dependency sequence, with sane defaults.
Created with Excel, so this testcase assumes correctness of Excel."""

LONGTERM_SINGLE = [
    1,
    2,
    3,
    4,
    5,
    5,
    10,
    15,
    20,
    25,
    25,
    50,
    75,
    100,
    125,
    125,
    250,
    375,
    500,
    625,
    625,
    1250,
    1875,
    2500,
    3125,
    3125,
    6250,
    9375,
    12500,
    15625,
    15625,
    31250,
    46875,
    62500,
    78125,
    78125,
    156250,
    234375,
    312500,
    390625,
    390625,
    781250,
    1171875,
    1562500,
    1953125,
    1953125,
    3906250,
    5859375,
    7812500,
    9765625,
    9765625,
    19531250,
    29296875,
    39062500,
    48828125,
    48828125,
    97656250,
    146484375,
    195312500,
    244140625,
    244140625,
    488281250,
    732421875,
    976562500,
    1220703125,
    1220703125,
    2441406250,
    3662109375,
    4882812500,
    6103515625,
    6103515625,
    12207031250,
    18310546875,
    24414062500,
    30517578125,
    30517578125,
    61035156250,
    91552734375,
    122070312500,
    152587890625,
    152587890625,
    305175781250,
    457763671875,
    610351562500,
    762939453125,
    762939453125,
    1525878906250,
    2288818359375,
    3051757812500,
    3814697265625,
    3814697265625,
    7629394531250,
    11444091796875,
    15258789062500,
    19073486328125,
    19073486328125,
    38146972656250,
    57220458984375,
    76293945312500,
    95367431640625,
]
"""First 100 digits in the long_term_single_dependency sequence, with sane defaults.
Created with Excel, so this testcase assumes correctness of Excel"""

SHORTTERM_SINGLE = [
    1,
    7,
    49,
    343,
    2401,
    16807,
    117649,
    823543,
    5764801,
    40353607,
    282475249,
    1977326743,
    13841287201,
    96889010407,
    678223072849,
    4747561509943,
    33232930569601,
    232630513987207,
    1628413597910449,
    11398895185373143,
    79792266297612001,
    558545864083284007,
    3909821048582988049,
    27368747340080916343,
    191581231380566414401,
    1341068619663964900807,
    9387480337647754305649,
    65712362363534280139543,
    459986536544739960976801,
    3219905755813179726837607,
    22539340290692258087863249,
    157775382034845806615042743,
    1104427674243920646305299201,
    7730993719707444524137094407,
    54116956037952111668959660849,
    378818692265664781682717625943,
    2651730845859653471779023381601,
    18562115921017574302453163671207,
    129934811447123020117172145698449,
    909543680129861140820205019889143,
    6366805760909027985741435139224001,
    44567640326363195900190045974568007,
    311973482284542371301330321821976049,
    2183814375991796599109312252753832343,
    15286700631942576193765185769276826401,
    107006904423598033356356300384937784807,
    749048330965186233494494102694564493649,
    5243338316756303634461458718861951455543,
    36703368217294125441230211032033660188801,
    256923577521058878088611477224235621321607,
    1798465042647412146620280340569649349251249,
    12589255298531885026341962383987545444758743,
    88124787089723195184393736687912818113311201,
    616873509628062366290756156815389726793178407,
    4318114567396436564035293097707728087552248849,
    30226801971775055948247051683954096612865741943,
    211587613802425391637729361787678676290060193601,
    1481113296616977741464105532513750734030421355207,
    10367793076318844190248738727596255138212949486449,
    72574551534231909331741171093173785967490646405143,
    508021860739623365322188197652216501772434524836001,
    3556153025177363557255317383565515512407041673852007,
    24893071176241544900787221684958608586849291716964049,
    174251498233690814305510551794710260107945042018748343,
    1219760487635835700138573862562971820755615294131238401,
    8538323413450849900970017037940802745289307058918668807,
    59768263894155949306790119265585619217025149412430681649,
    418377847259091645147530834859099334519176045887014771543,
    2928644930813641516032715844013695341634232321209103400801,
    20500514515695490612229010908095867391439626248463723805607,
    143503601609868434285603076356671071740077383739246066639249,
    1004525211269079039999221534496697502180541686174722466474743,
    7031676478883553279994550741476882515263791803223057265323201,
    49221735352184872959961855190338177606846542622561400857262407,
    344552147465294110719732986332367243247925798357929806000836849,
    2411865032257058775038130904326570702735480588505508642005857943,
    16883055225799411425266916330285994919148364119538560494041005601,
    118181386580595879976868414312001964434038548836769923458287039207,
    827269706064171159838078900184013751038269841857389464208009274449,
    5790887942449198118866552301288096257267888893001726249456064921143,
    40536215597144386832065866109016673800875222251012083746192454448001,
    283753509180010707824461062763116716606126555757084586223347181136007,
    1986274564260074954771227439341817016242885890299592103563430267952049,
    13903921949820524683398592075392719113700201232097144724944011875664343,
    97327453648743672783790144527749033795901408624680013074608083129650401,
    681292175541205709486531011694243236571309860372760091522256581907552807,
    4769045228788439966405717081859702655999169022609320640655796073352869649,
    33383316601519079764840019573017918591994183158265244484590572513470087543,
    233683216210633558353880137011125430143959282107856711392134007594290612801,
    1635782513474434908477160959077878011007714974754996979744938053160034289607,
    11450477594321044359340126713545146077054004823284978858214566372120240027249,
    80153343160247310515380886994816022539378033762994852007501964604841680190743,
    561073402121731173607666208963712157775646236340963964052513752233891761335201,
    3927513814852118215253663462745985104429523654386747748367596265637242329346407,
    27492596703964827506775644239221895731006665580707234238573173859460696305424849,
    192448176927753792547429509674553270117046659064950639670012217016224874137973943,
    1347137238494276547832006567721872890819326613454654477690085519113574118965817601,
    9429960669459935834824045974053110235735286294182581343830598633795018832760723207,
    66009724686219550843768321818371771650147004059278069406814190436565131829325062449,
    462068072803536855906378252728602401551029028414946485847699333055955922805275437143,
]
"""First 100 digits in the short_term_single_dependency sequence, with constant being 7.
Cannot be recreated with Excel due to precision issues - coded up instead."""

Global variables

var CATALAN

First 100 catalan numbers.

var DOWN

First 100 digits in the sequence as generated by range_down, with sane defaults. Created with Excel, so this testcase assumes correctness of Excel.

var EXAMPLE_LOG_AS_INTS

An example XES trace converted to integers.

var FIB

First 100 digits in the fibonacci sequence.

var LONGTERM

First 100 digits in the long_term_dependency sequence, with sane defaults. Created with Excel, so this testcase assumes correctness of Excel.

var LONGTERM_SINGLE

First 100 digits in the long_term_single_dependency sequence, with sane defaults. Created with Excel, so this testcase assumes correctness of Excel

var PASCAL

First 100 digits in the sequence given by the triangle of pascal.

var RECAMAN

First 100 digits in the recaman sequence.

var SHORTTERM_SINGLE

First 100 digits in the short_term_single_dependency sequence, with constant being 7. Cannot be recreated with Excel due to precision issues - coded up instead.

var UP

First 100 digits in the sequence as generated by range_up, with sane defaults. Created with Excel, so this testcase assumes correctness of Excel.