[seqfan] Re: Nice nontrivial integer sequence
M. F. Hasler
oeis at hasler.fr
Mon Mar 6 16:59:43 CET 2023
Looking at the log plot of the values up to a(96)
(last value anticipated(?) in Arthur's blog post and confirmed by Brendan
in his impressive computation),
cf. oeis.org/A360447/a360447.gif,
I have to say that, in spite of my initial irrational hope of getting a
permutation,
it looks rather probable that we have a subsequence of "late birds",
a(0) = 0, a(1) = 1, a(2) = 4, a(3) = 11, a(6) = 18, a(7) = 61, a(8) = 165,
a(40) = 269, a(44) = 911, a(45) = 2464, a(46) = 11409, a(47) = 20354, a(48)
= 90361,
a(50) = 160368, a(54) = 390743, a(56) = 621118, a(57) = 2714847,
a(80) = 4808576, a(90) = 16519457,
( a(91) = 61269252, a(94) = 106019047, a(95) = 362806936, a(96) =
1345208697 ... ?),
such that all terms which will eventually get "stabilized" after any of
these, are strictly larger.
So, I have to say that, in spite of my initial enthusiasm / irrational hope
of getting a permutation of the nonnegative integers,
it might be very far from being a permutation of the nonnegative or
positive integers as Arthur wrote at the beginning of his blog post.
- Maximilian
On Mon, Mar 6, 2023 at 12:06 AM Arthur O'Dwyer <arthur.j.odwyer at gmail.com>
wrote:
> I confirm these results, using a C++ program that I wrote without looking
> at Christian's C program. (Now I've looked, and I think we converged to the
> same basic data structures... except that Christian doesn't even need to
> store the list of `i` values? Ah, yes, now I see; that's clever. Updated
> mine.)
> https://quuxplusone.github.io/blog/2023/03/05/oeis-a360447/
> has my C++ program and results up to a(96), at which point I, also, run out
> of memory.
>
> –Arthur
>
> On Thu, Mar 2, 2023 at 7:15 AM Christian Sievers <seqfan at duvers.de> wrote:
>
> > Hello,
> >
> > it seems like the list doesn't allow attachments, so I put (the latest
> > version of) my program at the end of this mail.
> >
> > For the next billion terms I changed the type to unsigned integers.
> > To go even further one could use (unsigned) *long* ints, but that's too
> > much for my 32G memory.
> >
> > My only new results (still took only 48 seconds) are these:
> >
> > stable no. 96 is 1345208697 after 1708015633 terms
> > 2 is at 4091
> > after 2000000000 terms:
> > 2 is at 4222
> >
> > All the best
> > Christian
> > ------------------------------------------------
> >
> > #include<stdio.h>
> > #include<stdlib.h>
> > #include<assert.h>
> >
> > #define N 2000000000
> >
> > typedef unsigned int T;
> >
> > T *next;
> > T *sum;
> >
> > void update_sum(T n, T o){
> > T s, d, od, tp;
> > s = n+o;
> > d = (n>o) ? n-o : o-n;
> > tp=2*sum[s];
> > if(!tp){
> > sum[s]=n;
> > return;
> > }
> > od = (s>tp) ? s-tp : tp-s;
> > if (d<od)
> > sum[s]=n;
> > }
> >
> > void report(T s, T i){
> > static T count=1;
> > printf("stable no. %u is %u after %u terms\n", ++count, s, i);
> > }
> >
> > void report2(void){
> > T p,c;
> > p=c=1;
> > while(p!=2){
> > p=next[p];
> > ++c;
> > }
> > printf("2 is at %u\n", c);
> > }
> >
> > int main(void){
> > T last,stable,need,i,p,q;
> > next=calloc(N+1u, sizeof(T));
> > assert(next);
> > sum=calloc(2u*N, sizeof(T));
> > assert(sum);
> > last=1;
> > stable=1;
> > need=5;
> > for(i=2; i<=N; ++i){
> > p=sum[i];
> > if(p){
> > q=next[p];
> > next[p]=i;
> > next[i]=q;
> > update_sum(p,i);
> > update_sum(i,q);
> > if (p==stable)
> > need=p+i;
> > } else {
> > next[last]=i;
> > update_sum(last,i);
> > last=i;
> > }
> > if (i==need){
> > while(i>=need){
> > stable=next[stable];
> > need=stable+next[stable];
> > report(stable,i);
> > }
> > report2();
> > }
> > }
> > printf("after %u terms:\n", N);
> > report2();
> > }
> >
> > --
> > Seqfan Mailing list - http://list.seqfan.eu/
> >
>
> --
> Seqfan Mailing list - http://list.seqfan.eu/
>
More information about the SeqFan
mailing list