cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A104663 Position of n in A105822.

Original entry on oeis.org

1, 2, 3, 6, 4, 11, 8, 5, 26, 9, 12, 7, 15, 17, 33, 43, 10, 25, 16, 19, 13, 32, 39, 21, 61, 175, 22, 20, 57, 37, 95, 14, 18, 50, 27, 40, 34, 110, 29, 24, 171, 23, 64, 28, 46, 203, 45, 31, 137, 91, 134, 35, 58, 30, 90, 54, 69, 106, 38, 73, 360, 296, 67, 88, 48, 70, 526, 109, 124
Offset: 1

Views

Author

Zak Seidov, Apr 22 2005

Keywords

Comments

Is A105822 a permutation of the positive integers?

Crossrefs

Cf. A105822.

Programs

  • Maple
    N:= 1000: # to go up to the first entry missing in A105822(1 .. N)
    A:= 'A':
    a[1]:= 1: a[2]:= 2:
    A[1]:= 1: A[2]:= 2:
    for n from 3 to N do
      ds:= map(t -> rhs(op(t)), [msolve(x^2=a[n-1]^2, 4*a[n-2])]);
      xmin:= infinity;
      for d in ds do
        found:= false;
        for y from floor((a[n-1]-d)/(4*a[n-2]))+1 do
          xy:= 4*a[n-2]*y + d;
          cand:= (xy^2 - a[n-1]^2)/(4*a[n-2]);
          if cand >= xmin then found:= false; break fi;
          if not assigned(A[cand]) then found:= true; break fi;
        od:
        if found then xmin:= cand;  fi;
      od:
      a[n]:= xmin;
      A[xmin]:= n;
    od:
    M:= min(select(t -> not assigned(A[t]), [$1..N+1])):
    seq(A[i],i=1..M-1); # Robert Israel, May 11 2015

Extensions

Definition corrected by N. J. A. Sloane, Aug 29 2008