writer needs sequences

Antti Karttunen karttu at megabaud.fi
Fri Feb 21 19:01:12 CET 2003



"N. J. A. Sloane" wrote:
> 

> >From laurentdorey at wanadoo.fr  Thu Feb 20 21:10:44 2003
> >I can give you an example of the kind of things I am looking for : I did this one last week

> >-01-02-03-04-05-06-07-08-09-10-01-03-07-05-01-03-10-01-03-07-05-01-03-10-01-04-09-09-09-09-08-
> 07-05-06-03-07-02-05-01-05-01-03-07-05-01-04-03-03-07-02-07-09-09-09-08-05-01-03-10-01-04-09-08-07-02-05-06- and so on...
> >   > > *******************************+02+04+08+06+02+07+01+02+04+08+06+02+07+01+03+05+10+10+10+09+09+
> 08+01+07+04+05+03+06+04+06+02+04+08+06+03+09+10+04+05+05+02+10+10+09+07+06+02+07+01+03+05+09+09+05+03+01+07+ and so on...

>> Looking at the top line first (the one with no + sign), I first took
>> a simple serie from 01 to 10, then started to continue another one but
>> added this rule : From the point of the second 01, the value of the next
>> number is determined by adding this number to the number at the right of
>> the former occurence of this first number in the line : 01 was followed by 02,
>> so 01+02 then 03 is the next number. 03 was followed by 04, so 03+04 then 07
>> is the next number. etc...

>> Then I noticed that a second sequence could be found by writting the numbers
>> added to construct the first sequence : this corresponds to the bottom line
>> (the one with the + signs), starting at the second 01 of the first serie)

I noticed either a mistake or a part of a hidden rule in above,
as I interpreted first that you always take the term to the right
of the _last possible_ occurrence of the previous term, i.e.
as you add to the third occurrence of 3 7, which occurred after its
second occurrence, but then after 01-03-10-01 he adds 02 (to the right
of the _first occurrence_ of 01), not 03 which occurs after 01's
third occurrence.

Anyhow, I constructed two sequences like these, always taking the
summand from the _last possible_ position. It's no suprise that
they are periodic.



%I A080867
%S A080867 0,1,2,3,4,5,6,7,8,9,0,1,3,7,5,1,4,9,9,8,7,2,5,6,3,0,1,5,1,6,9,7,9,6,5,6,1,7,6,7,
%T A080867 3,3,6,3,9,5,1,8,5,6,9,4,3,2,7,0,1,9,3,5,1,0,1,1,2,9,2,1,3,8,3,1,4,7,7,4,1,5,6,5,
%U A080867 1,6,1,7,1,8,1,9,1,0,1,1,2,3,4,5,6,7,8,9,0,1,3,7,5,1,4,9,9,8,7,2,5,6,3,0,1,5,1,6
%N A080867 Dorey's period-90 sequence. (Periodic from a(1)=1 onward).
%F A080867 a(n<12) = n mod 10, a(n>11) = a(n-1)+a(i+1) mod 10, where i (< n-1) is the first position to left of n-1 where a(n-1) occurs.
%R A080867
%O A080867 0,3
%K A080867 nonn,base,new
%A A080867 Laurent Dorey (laurentdorey at wanadoo.fr) & Antti Karttunen (my_firstname.my_surname at iki.fi) Feb 21 2003.
%Y A080867 Cf. A080868.
%D A080867
%p A080867 A080867 := proc(n) option remember; local i,u; if(n < 12) then RETURN(n mod 10); else u := A080867(n-1); for i from n-2 by -1 to 0 do if(A080867(i) = u) then RETURN((A080867(i+1)+u) mod 10); fi; od; fi; RETURN(-1); end;



%I A080868
%S A080868 1,1,1,1,1,1,1,1,1,1,1,2,4,8,6,3,5,0,9,9,5,3,1,7,7,1,4,6,5,3,8,2,7,9,1,5,6,9,1,6,
%T A080868 0,3,7,6,6,6,7,7,1,3,5,9,9,5,3,1,8,4,2,6,9,1,0,1,7,3,9,2,5,5,8,3,3,0,7,7,4,1,9,6,
%U A080868 5,5,6,4,7,3,8,2,9,1,0,1,1,1,1,1,1,1,1,1,1,2,4,8,6,3,5,0,9,9,5,3,1,7,7,1,4,6,5,3
%N A080868 First differences of A080867, modulo 10.
%F A080868 a(n) = A080867(n+1)-A080867(n) mod 10
%C A080868 Periodic from a(1)=1 onward, with a period of 90 terms.
%O A080868 0,12
%K A080868 nonn,base,new
%A A080868 Laurent Dorey (laurentdorey at wanadoo.fr) & Antti Karttunen (my_firstname.my_surname at iki.fi) Feb 21 2003.
%D A080868
%p A080868 A080868 := n -> ((A080867(n+1)-A080867(n)) mod 10);

------------------------------------------------------------------------------------------------

Please ask Laurent whether he wants his name or address to appear on A-line!


For those who like better indentation, the Maple-procedure looks actually like this:


A080867 := proc(n) option remember; local i,u;
  if(n < 12) then RETURN(n mod 10);
  else
   u := A080867(n-1);
   for i from n-2 by -1 to 0
    do
       if(A080867(i) = u) then RETURN((A080867(i+1)+u) mod 10); fi;
    od;
  fi;
  RETURN(-1); # Jamais!
end;



Maybe one could take alternatively the summand from the first and
the last possible positions, or use other "heuristic" to break
the periodicity.


BTW, I sent him links and 1024 terms from A007814, A001511,
A006519, and a reference to A028354 (Prague clock sequence),
plus also various links to campanological web-sites.


Salut,

Antti Karttunen





More information about the SeqFan mailing list