known (coincidental ?) artifact ?

Alexander Povolotsky apovolot at gmail.com
Mon Jan 14 13:48:01 CET 2008


Hi,

Below is the PARI/GP program, which for all n (n>1) acts as someFunction(n),
mentioned by me in the previous email.
It takes "n" as an input and returns back "s=n" - but it does it not in the
direct trivial assignment way, but rather via using intermediate
computations, involving, described by me in the previous email,
interchanging 6 or 4 periodicity pattern and also computing floor(n*n/10)+10
.

alex(n) =
 { local( u = 1, t=0,l=0, s=0, i=0);
  for(j=1,n,
   i=i++;
   print1("before loop1");
   print1("i="i" ");
   if(n<=7,t=7-n);
   if(n<=7,break);
   if(i<=7,next(1));
   for (k = 1, 6,
     print1("loop1");
     if(k!=1,i++);
     print1("i="i" ");
     print1("l="l" ");
     t = t + l;
     print1("t="t" ");
     if(i>=n,break);
       );
   if(i>=n,break);
   print1("l="l" ");
     i++;
     if(i>=14,l=l+1);
   for (k = 1, 4,
     print1("loop2");
     if(k!=1,i++);
     print1("i="i" ");
     print1("l="l" ");
     t = t + l;
     print1("t="t" ");
    if(i>=n,break);
   );
  if(i>=n,break);
  if(i>=14,l++);
  print1("l="l" ");
  );
   print1("n="n" ");
   print1("i="i" ");
  print1("t="t" ");
  s=floor(((floor(n*n/10)+10) -t )/2);
  print1("s="s" ");
 }

Thanks,
Best Regards,
Alexander R. Povolotsky

On Jan 11, 2008 2:27 PM, Alexander Povolotsky <apovolot at gmail.com> wrote:

> Thanks for the reply,  Franklin,
>
> Could you also explain why the pattern (at least up to n=60) keeps
> steadily alternating between 4 terms and 6 terms in the each two consecutive
> groups, with the difference remaining the same within each such 4-term or
> 6-term group (while during the switch from the 4-group to the 6-group and
> then back to the next 4-group, etc. the difference is getting bumped by 1)
> ?
> How you explain the fact that the sum of number of terms for each two
> consecutive groups is  4+ 6= 10 ?
>
> Note that if the pattern indeed could be described as discuseed in the
> predictable manner,
> then one could resolve the iteration and derive the following formula (non
> trivial identity ?)
>
> n = (floor(n*n/10)+10 - someFunction(n) ) /2
>
> Thanks,
> Alexander R. Povolotsky
>
> On 1/11/08, franktaw at netscape.net <franktaw at netscape.net> wrote:
> >
> > It's pretty much obvious.
> >
> > First of all, simple arithmetic lets us simplify the expression to
> >
> > a(n) = floor(n^2/10) - floor((n-1)^2/10) + 2
> >
> > The "+ 2" obviously doesn't affect the pattern of differences,
> > so what we are really looking at is the pattern of differences in
> > floor(n^2)/10.   Since the final digit of n^2 depends only
> > on n modulo 10, and the difference in the squares is 2n-1, this
> > will have a pattern of changes depending only on the final
> > digit.
> >
> > Franklin T. Adams-Watters
> >
> > -----Original Message-----
> > From: Alexander Povolotsky apovolot at gmail.com
> > .
> > Consider calculating (in decimal system):
> >
> > floor(n*n/10) + 10
> >
> > and then looking between the  difference of calculated above and
> > "doubled" value of n :
> >
> > (floor(n*n/10) + 10)  - 2*n
> >
> > and then look at the differences between in above expression for two
> > consecutive integers n and (n-1)
> >
> > a(n) = ((floor(an*n/10) + 10) - 2*n) - ((floor((n-1)*(n-1)/10) + 10 -
> > 2*(n-1))
> > ...
> >
> > So you could notice that starting from a(4) and on - the difference is
> > kept the same for first 4 terms and then the difference gets
> > incremented by 1 and as such is kept constant for next 6 terms, then it
> > increments by 1 again and is kept the same for 4 terms, etc, etc ....
> > ...
> > Is this well known and/or obvious ?
> > ____________________________________________________________________
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.seqfan.eu/pipermail/seqfan/attachments/20080114/c3f404ad/attachment-0001.htm>


More information about the SeqFan mailing list