{"id":16778747,"url":"https://github.com/ritvik19/integer-sequence-learning","last_synced_at":"2025-10-18T23:06:48.569Z","repository":{"id":104587564,"uuid":"218519570","full_name":"Ritvik19/Integer-Sequence-Learning","owner":"Ritvik19","description":null,"archived":false,"fork":false,"pushed_at":"2020-05-12T05:31:50.000Z","size":47544,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T06:14:53.117Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ritvik19.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-10-30T12:12:22.000Z","updated_at":"2020-05-21T08:48:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"e6c26161-5d10-48d9-b7a0-6bcfcce1bca3","html_url":"https://github.com/Ritvik19/Integer-Sequence-Learning","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ritvik19%2FInteger-Sequence-Learning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ritvik19%2FInteger-Sequence-Learning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ritvik19%2FInteger-Sequence-Learning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ritvik19%2FInteger-Sequence-Learning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ritvik19","download_url":"https://codeload.github.com/Ritvik19/Integer-Sequence-Learning/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243922279,"owners_count":20369376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T07:28:34.930Z","updated_at":"2025-10-18T23:06:48.502Z","avatar_url":"https://github.com/Ritvik19.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Integer-Sequence-Learning\n\n## Current Status\n\n35.35% solved\n\nSequence Type | Percentage\n:---|---:\nlinear recurrence relations | 29.04 %\npolynomial sequences | 2.59 %\ntriplets | 0.33 %\nmiscellaneous  | 6.41 %\nsubsequence repetition | 0.31 %\nnon linear recurrence relations | 15.92 %\n\n___\n## Linear Recurrence Relations\n\n**2nd order recurrence relation**\n\nA second order recurrence relation is of the form:\n\n            a(n+2) = c0*a(n) + c1*a(n+1)\n\nwhere the coefficients `c0` and `c1` are constant.\n\nFor example, the Fibonacci sequence an+2=an+an+1 is a second order recurrence sequence with coefficients (1,1) .\n\n**3rd order recurrence relation**\n\nA third order recurrence relation is of the form:\n\n            a(n+3) = c0*a(n) + c1*a(n+1) + c2*a(n+2)\n\nwhere the coefficients `c0`, `c1` and `c2` are constant.\n\n### Detect Recurrence Relations\n\nGiven a sequence `an` , let's say we want to verify whether it's given by a 3rd order recurrence relation. In other words, we check if it's possible to find constants `c0`, `c1`, `c2` so that\n\n            a(n+3) = c0*a(n) + c1*a(n+1) + c2*a(n+2)\n\nis satified. To find possible `c0`, `c1`, `c2`, since there are 3 unknowns, we need at least 3 equations. Let's set the equations using `a3`, `a4`, `a5` as follows:\n\n            a3 = c0*a0 + c1*a1 + c2*a2\n            a4 = c0*a1 + c1*a2 + c2*a3\n            a5 = c0*a2 + c1*a3 + c2*a4\n\nthen we solve for (`c0`, `c1`, `c2`). Once the coefficients (`c0`, `c1`, `c2`) are found, we check whether the next terms `a6`, `a7`... satisfy the recurrence relation.\n\n---\n\n## Polynomial Sequences\n\n**1st order polynomial sequence**\n\nThe nth term of a 1st order polynomial sequence is given as\n\n            an = c0*n^0 + c1*n^1\n\nwhere the coefficients `c0` and `c1` are constant.\n\n**2nd order polynomial sequence**\n\nThe nth term of a 2nd order polynomial sequence is given as\n\n            an = c0*n^0 + c1*n^1 + c2*n^2\n\nwhere the coefficients `c0`, `c1` and `c2` are constant.\n\n### Detect Polynomial Sequence\n\nGiven a sequence `an` , let's say we want to verify whether it's given by a 2nd order polynomial sequence. In other words, we check if it's possible to find constants `c0`, `c1`, `c2` so that\n\n            an = c0*n^0 + c1*n^1 + c2*n^2\n\nis satified. To find possible `c0`, `c1`, `c2`, since there are 3 unknowns, we need at least 3 equations. Let's set the equations using `a0`, `a1`, `a2` as follows:\n\n            a0 = c0*1 + c1*0 + c2*0\n            a1 = c0*1 + c1*1 + c2*1\n            a2 = c0*1 + c1*2 + c2*4\n\nthen we solve for (`c0`, `c1`, `c2`). Once the coefficients (`c0`, `c1`, `c2`) are found, we check whether the next terms `a3`, `a4`... satisfy the recurrence relation.\n\n---\n\n## Tiplets\n\n### Sum Triplets\n\nSequences of the form\n\n            a(3n) = a(3n-1) + a(3n-2)\n\n### Product Triplets\n\nSequences of the form\n\n            a(3n) = a(3n-1) * a(3n-2)\n\n### Difference Triplets\n\nSequences of the form\n\n            a(3n) = a(3n-1) - a(3n-2)\n                        or\n            a(3n) = a(3n-2) - a(3n-1)\n\n### Pythagorean Triplets\n\nSequences of the form\n\n            a(3n) = sqrt(sq(a(3n-1)) + sq(a(3n-2)))\n\n---\n\n### Unit Sequences\n\nSequences with only one unique number\n\n---\n\n### Sequences with Sum of digits as difference\n\nSequences of the form\n        \n            a(n+1) = a(n) + sum_of_digits(a(n))\n            \n\n---\n\n### Mode Fallback\n\nSequences predicted with their most common term\n\n---\n\n### Subsequence Repetition\n\nSequences that are repetition of some subsequences\n\n\n---\n\n## Non Linear Recurrence Relations\n\n*         a(n) = c0 + c1*n + c2*a(n-1)\n*         a(n) = c0 + c1*n + c2*n^2 + c3*a(n-1)\n*         a(n) = c0 + c1*n + c2*n^2 +  c3*n^3 +c4*a(n-1)\n\n*         a(n) = c0 + c1*n + c2*a(n-1) + c3*a(n-2)\n*         a(n) = c0 + c1*n + c2*n^2 + c3*a(n-1) + c4*a(n-2)\n*         a(n) = c0 + c1*n + c2*n^2 +  c3*n^3 +c4*a(n-1) + c5*a(n-2)\n\n*         a(n) = c0 + c1*n + c2*a(n-1) + c3*a(n-2) + c4*a(n-1)*a(n-2)\n*         a(n) = c0 + c1*n + c2*n^2 + c3*a(n-1) + c4*a(n-2) + c5*a(n-1)*a(n-2)\n*         a(n) = c0 + c1*n + c2*n^2 +  c3*n^3 +c4*a(n-1) + c5*a(n-2) + c6*a(n-1)*a(n-2)\n\n*         a(n) = c0 + c1*n + c2*a(n-1) + c3*a(n-2) + c4*a(n-3)\n*         a(n) = c0 + c1*n + c2*n^2 + c3*a(n-1) + c4*a(n-2) + c5*a(n-3)\n*         a(n) = c0 + c1*n + c2*n^2 +  c3*n^3 +c4*a(n-1) + c5*a(n-2) + c6*a(n-3)\n\n*         a(n) = c0 + c1*n + c2*a(n-1) + c3*a(n-2) + c4*a(n-3) + c5*a(n-1)*a(n-2) + c6*a(n-2)*a(n-3) + c7*a(n-3)*a(n-1)\n*         a(n) = c0 + c1*n + c2*n^2 + c3*a(n-1) + c4*a(n-2) + c5*a(n-3) + c6*a(n-1)*a(n-2) + c7*a(n-2)*a(n-3) + c8*a(n-3)*a(n-1)\n*         a(n) = c0 + c1*n + c2*n^2 +  c3*n^3 +c4*a(n-1) + c5*a(n-2) + c6*a(n-3) + c7*a(n-1)*a(n-2) + c8*a(n-2)*a(n-3) + c9*a(n-3)*a(n-1)\n\n*         a(n) = c0 + c1*n + c2*a(n-1) + c3*a(n-2) + c4*a(n-3) + c5*a(n-1)*a(n-2) + c6*a(n-2)*a(n-3) + c7*a(n-3)*a(n-1) + c8*a(n-1)*a(n-2)*a(n-3)\n*         a(n) = c0 + c1*n + c2*n^2 + c3*a(n-1) + c4*a(n-2) + c5*a(n-3) + c6*a(n-1)*a(n-2) + c7*a(n-2)*a(n-3) + c8*a(n-3)*a(n-1) + c9*a(n-1)*a(n-2)*a(n-3)\n*         a(n) = c0 + c1*n + c2*n^2 +  c3*n^3 +c4*a(n-1) + c5*a(n-2) + c6*a(n-3) + c7*a(n-1)*a(n-2) + c8*a(n-2)*a(n-3) + c9*a(n-3)*a(n-1) + c10*a(n-1)*a(n-2)*a(n-3)\n---\n## References:\n\n- [Dataset | Kaggle](https://www.kaggle.com/c/integer-sequence-learning/data)\n- [Recurrrence Relation | Kaggle](https://www.kaggle.com/ncchen/recurrence-relation)\n- [Online Encyclopedia of Integer Sequences](https://oeis.org/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fritvik19%2Finteger-sequence-learning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fritvik19%2Finteger-sequence-learning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fritvik19%2Finteger-sequence-learning/lists"}