easy q. about apparent duplicate

N. J. A. Sloane njas at research.att.com
Sat Jun 16 22:51:42 CEST 2007


On 6/16/07, N. J. A. Sloane <njas at research.att.com> wrote:
> Sorry!   Transposition error!    What I meant to say was:
>
> Dear Seqfans,  could someone look at the pair A087852 and A087853
> and determine when they first differ?
> (I'm assuming they really are different)

Both these sequences are broken, in my opinion.

In each case, once you arrive at n = 8, you get the recursion saying
a(8) = |a(a(7)) - 12| or |a(a(a(7))) - 12|.
But a(7) = 8, so then this says a(8) is defined (recursively?) in terms of a(8).

maybe there's a self consistent solution out there somewhere, but if
you read the accompanying BASIC program, all he did was assume that
a(n) = 0 in that case (uninitialized spot in the array defaults to 0,
I guess?) which is why he gets 12 here for the final result -- using
an array lookup instead of a true recursive call in the program hid
the error.

Hence in both sequences all the terms after the 7th are simply
(mis-)calculated as floor(n*phi).

> A087851 is also of the same type.

The program (given with the sequence) shows that you are to assume
a(1) = 1 and a(2) = 1 ... under the more natural-seeming assumption
that a(1) = 1 only, I got 1 2 2 4 4 5 6 6 8 8 9 10 11 11 13 12 15 14
16 16 17 18 19 19 21 21 22 23 23 25 25 26 27 28 28 30 29 32 31 33 33
34 35 36 36 38 38 39 40 40 42 42 43 44 44 46 46 47 48 49 49 51 50 53
52 54 54 56 55 58 56 60 58 61 60 62 62 64 63 66 65 67 67 68 69 70 70
72 72 73 74 74 76 76 77 78 78 80 80 81 for the sequence.

New %F line is below.

--Joshua

%F A087851 a(1) = a(2) = 1; For n > 2, a(n) = |a(n-1)-floor(n*phi)|
%A A087851 Joshua Zucker (joshua.zucker at stanfordalumni.org), Jun 16 2007




So, I will merge the two entries, using your formula,
%F A087851 a(1) = a(2) = 1; For n > 2, a(n) = |a(n-1)-floor(n*phi)|

In that case, the values that are given now are correct, right?

Concerning your more natural-seeming assumption, this seems
to give Clark Kimberlings sequence,

%S A129229 0,1,2,2,4,4,5,6,6,8,8,9,10,11,11,13,12,15,14,16,16,17,18,19,19,21,21,22,
%T A129229 23,23,25,25,26,27,28,28,30,29,32,31,33,33,34,35,36,36,38,38,39,40,40,
%U A129229 42,42,43,44,44,46,46,47,48,49,49,51,50,53,52,54,54,56,55,58,56,60,58
%N A129229 a(n)=Floor(n*r)-a(n-1), where r is the golden mean, (1+sqrt(5))/2.



Many thanks for clearing up this mess!

Neil





More information about the SeqFan mailing list