Re: [Jprogramming] newbie question about indexing/tabling

2019-07-13 Thread Raul Miller
Larger pentagonal numbers are further apart. Here, after 1827553 pentagonal numbers, they're too far apart for adjacent numbers to be closer together. (Note that this also limits the search space--though being slightly liberal with bounds and testing blocks at a time might work to keep interprete

Re: [Jprogramming] newbie question about indexing/tabling

2019-07-13 Thread Skip Cave
Yes, Pascal found the same two pentagonal numbers I found: *pn=.3 :'y*(1-~3*y)%2'* * p=:pn>:i.5000x* Paschal's solution: P(2166)-P(1019) *2166 1019{p* *7042750 1560090* My solution: *]n=.m#p2* *1560090 7042750* The question is, do these two pentagonal numbers have the smallest D? Skip

Re: [Jprogramming] newbie question about indexing/tabling

2019-07-13 Thread Louis de Forcrand
Quick correction: the answer given by Pascal is not 1019 but P(2166)-P(1019), and my email should use that instead of 1019 wherever it is mentioned. Sorry for the noise, Louis > On 14 Jul 2019, at 01:58, Louis de Forcrand wrote: > > I’m with Skip here: how do y’all guarantee that your brute-fo

Re: [Jprogramming] newbie question about indexing/tabling

2019-07-13 Thread Louis de Forcrand
I’m with Skip here: how do y’all guarantee that your brute-force answers (which search through a list of the first few pentagonal numbers) actually return the pair with the smallest _difference_? How do you know there isn’t a pair outside your search range, where each number in the pair is much