{"action":"created","issue":{"url":"https://api.github.com/repos/akc/hops/issues/4","repository_url":"https://api.github.com/repos/akc/hops","labels_url":"https://api.github.com/repos/akc/hops/issues/4/labels{/name}","comments_url":"https://api.github.com/repos/akc/hops/issues/4/comments","events_url":"https://api.github.com/repos/akc/hops/issues/4/events","html_url":"https://github.com/akc/hops/issues/4","id":183556265,"number":4,"title":"Partition function seems odd","user":{"login":"bawolk","id":375816,"avatar_url":"https://avatars.githubusercontent.com/u/375816?v=3","gravatar_id":"","url":"https://api.github.com/users/bawolk","html_url":"https://github.com/bawolk","followers_url":"https://api.github.com/users/bawolk/followers","following_url":"https://api.github.com/users/bawolk/following{/other_user}","gists_url":"https://api.github.com/users/bawolk/gists{/gist_id}","starred_url":"https://api.github.com/users/bawolk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bawolk/subscriptions","organizations_url":"https://api.github.com/users/bawolk/orgs","repos_url":"https://api.github.com/users/bawolk/repos","events_url":"https://api.github.com/users/bawolk/events{/privacy}","received_events_url":"https://api.github.com/users/bawolk/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-10-17T23:43:43Z","updated_at":"2016-10-19T17:00:36Z","closed_at":null,"body":"Suppose I wish to find the number of partitions of 99 restricted to the summands 1, 5, 10, and 25.  I naively try:\r\n```\r\n$ hops --prec=100 'PARTITION({1,5,10,25})'\r\n{\"hops\":\"PARTITION({1,5,10,25})\",\"seq\":[1,1,1,1]}\r\n```\r\nI first thought that this has to do with your use of `Indet` as a tool for exploration.  However, even if the {1,5,10,25} represents a truncation of a possibly infinite series, any further terms would involve a degree greater than 25.  So it would seem that at a minimum the function `h` in the where clause should use the maximum of cs instead of `length cs`.  Implementing this yields:\r\n```\r\n$ hops --prec=100 'PARTITION({1,5,10,25})'\r\n{\"hops\":\"PARTITION({1,5,10,25})\",\"seq\":[1,1,1,1,2,2,2,2,2,4,4,4,4,4,6,6,6,6,6,9,9,9,9,9,13]}\r\n```\r\nBetter, but there should be some way to get this series to its full precision, so I can determine the coefficient of x^99.  Also note what happens if I naively use square brackets:\r\n```\r\n$ hops --prec=100 'PARTITION([1,5,10,25])'\r\n{\"hops\":\"PARTITION({1,5,10,25})\",\"seq\":[]}\r\n```\r\nThis occurs because the square bracket series contains zeros, which causes the empty series to result.  We can avoid this by filtering out the zero coefficients.  Implementing that yields:\r\n```\r\n$ hops --prec=100 'PARTITION([1,5,10,25])'\r\n{\"hops\":\"PARTITION({1,5,10,25})\",\"seq\":[1,1,1,1,2,2,2,2,2,4,4,4,4,4,6,6,6,6,6,9,9,9,9,9,13]}\r\n```\r\nWould it make sense to use the full precision if square brackets are used, but keep the current result if curly brackets are used?  I think the documentation should be improved even if the current approach is retained.\r\n"},"comment":{"url":"https://api.github.com/repos/akc/hops/issues/comments/254875536","html_url":"https://github.com/akc/hops/issues/4#issuecomment-254875536","issue_url":"https://api.github.com/repos/akc/hops/issues/4","id":254875536,"user":{"login":"bawolk","id":375816,"avatar_url":"https://avatars.githubusercontent.com/u/375816?v=3","gravatar_id":"","url":"https://api.github.com/users/bawolk","html_url":"https://github.com/bawolk","followers_url":"https://api.github.com/users/bawolk/followers","following_url":"https://api.github.com/users/bawolk/following{/other_user}","gists_url":"https://api.github.com/users/bawolk/gists{/gist_id}","starred_url":"https://api.github.com/users/bawolk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bawolk/subscriptions","organizations_url":"https://api.github.com/users/bawolk/orgs","repos_url":"https://api.github.com/users/bawolk/repos","events_url":"https://api.github.com/users/bawolk/events{/privacy}","received_events_url":"https://api.github.com/users/bawolk/received_events","type":"User","site_admin":false},"created_at":"2016-10-19T17:00:36Z","updated_at":"2016-10-19T17:00:36Z","body":"The reason I took a look at partition is that I was looking for ways to use your existing transforms to provide the functionality I needed to create the generating functions used in Analytic Combinatorics.  Part of the difficulty is that the OEIS transforms sometimes ignore the zeroth coefficient.  Thus PARTITION gives a series [P(1), P(2), ... ], where P(n) is the coefficient of x^n.  There really should be a zeroth coefficient equal to 1.  This came up when I used EULER to create the multiset functionality.  I had to do a little tinkering: `MSET(B) = RIGHT(EULER(LEFT(B)))`\r\n\r\nThe problem is that some users might want to rely on PARTITION being identical with the OEIS version.  I suppose we could warn them.  Should I do a pull request to change PARTITION to yield a full precision series starting with P(0)?  If you are thinking of starting over, count me in.  I have lots of free time.\r\n\r\nAlso, I would like to add the functionality of pulling out a specific coefficient.  We might use a new operator `(#)` like this:\r\n```\r\n $ hops '1/(1-[0,1,1])'\r\n{\"hops\":\"1/(1-[0,1,1])\",\"seq\":[1,1,2,3,5,8,13,21,34,55,89,144,233,377,610]}\r\n$ hops '(1/(1-[0,1,1]))#4'\r\n{\"hops\":\"1/(1-[0,1,1])\",\"seq\":[5]}\r\n```\r\nI suppose we could also allow multiple coefficients to be selected:\r\n```\r\n$ hops '(1/(1-[0,1,1]))#[4, 6]'\r\n{\"hops\":\"1/(1-[0,1,1])\",\"seq\":[5, 13]}\r\n```\r\nAny thoughts?"}}
{"actor":{"display_login":"bawolk"}}