[seqfan] Re: Code

Alonso Del Arte alonso.delarte at gmail.com
Fri Jun 23 21:44:15 CEST 2017


Just my two cents: the best Mathematica programs are both clear and
concise. If there's no way to do it concisely, at least do it clearly.

And then there are Mathematica programs in the OEIS which are neither clear
nor concise. Consider, for example, the octagonal numbers:

Table[3n^2 - 2n, {n, 0, 39}]

Short and sweet. That's almost the same as what Harvey has for A567. But
apparently there's also a way to use three variables (a, b, c) and juggle
them cleverly to obtain the list of octagonal numbers. It works but it's
not at all clear.

Maybe it wasn't in A567, but it's still in some other entries. Joerg and I
have deleted a bunch of those, but I'm sure there's more of them.

Al

On Thu, Jun 22, 2017 at 2:12 AM, <israel at math.ubc.ca> wrote:

> All the polynomial equations with integer coefficients relating F_n and
> F_{n+1} are generated by  G(F_n, F_{n+1}) = F_n^2 + F_n F_{n+1} - F_{n+1}^2
> + (-1)^n = 0
> This particular identity is just   G(F_n, F_{n+1))(F_n^3+2 F_n^2
> F_{n+1}-F_{n+1}^3-(-1)^n (F_n + F_{n+1})) = 0
>
> Cheers,
> Robert
>
> On Jun 21 2017, Peter Lawrence wrote:Here's one way of generating
> recurrences of this type. Suppose you have a polynomial expression P(F_n,
> F_{n+1}) = 0. With phi = (1+sqrt(5))/2, F_n = (phi^n - (-1)^n
> phi^(-n))/sqrt(5) and F_{n+1} = (phi^(n+1) + (-1)^n phi^(-n-1))/sqrt(5)
>
>
>
> Hans,
>>         As I am not familiar with Mathematica (I'm just a C/C++
>> programmer), would it be too much to ask for an explanation of this
>> formula, in other words not a proof of its correctness, but rather the
>> details of how it computes, what algorithm is being specified here ? Are
>> F(n) and F(n+1) inputs, and if so then what is the output, F(n+2) ?
>>
>> Thanks,
>> Peter Lawrence.
>>
>>
>> On Jun 21, 2017, at 3:51 PM, seqfan-request at list.seqfan.eu wrote:
>>>
>>> Message: 17 Date: Wed, 21 Jun 2017 15:32:01 -0400 From: Hans Havermann <
>>> gladhobo at bell.net <mailto:gladhobo at bell.net>> To: Sequence Fanatics
>>> Discussion list <seqfan at list.seqfan.eu <mailto:seqfan at list.seqfan.eu>>
>>> Subject: [seqfan] Code Message-ID: <C6CC6D76-FE75-4251-ACCC-61CCD
>>> 0F6C652 at bell.net <mailto:C6CC6D76-FE75-4251-ACCC-61CCD0F6C652 at bell.net>>
>>> Content-Type: text/plain; charset=us-ascii
>>>
>>> I presume that the inclusion of code in sequences is to be able to
>>> generate/verify/extend that sequence. Simpler and faster is better.
>>> Browsing the OEIS today I chanced upon this Mathematica code for Fibonacci
>>> numbers < https://oeis.org/A000045 <https://oeis.org/A000045> >:
>>>
>>> Table[Fibonacci[n]^5 - Fibonacci[1 + n] + 3 Fibonacci[n]^4 Fibonacci[1 +
>>> n] + Fibonacci[n]^3 Fibonacci[1 + n]^2 - 3 Fibonacci[n]^2 Fibonacci[1 +
>>> n]^3 - Fibonacci[n] Fibonacci[1 + n]^4 + Fibonacci[1 + n]^5, {n, 1, 10}]
>>>
>>> It's an interesting Fibonacci identity worthy perhaps of mention in the
>>> comments (if it isn't already there) but I'm not sure it ought to be where
>>> it is.
>>>
>>
>>
>> --
>> Seqfan Mailing list - http://list.seqfan.eu/
>>
>>
>>
> --
> Seqfan Mailing list - http://list.seqfan.eu/
>



-- 
Alonso del Arte
Author at SmashWords.com
<https://www.smashwords.com/profile/view/AlonsoDelarte>
Musician at ReverbNation.com <http://www.reverbnation.com/alonsodelarte>



More information about the SeqFan mailing list