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.

A099507 a(n) is such that A099506(a(n)) = n.

Original entry on oeis.org

1, 4, 2, 6, 17, 3, 10, 5, 12, 7, 14, 53, 9, 8, 11, 22, 13, 24, 15, 26, 99, 103, 28, 107, 30, 19, 32, 111, 16, 23, 18, 25, 42, 20, 29, 46, 31, 48, 33, 50, 209, 35, 211, 56, 37, 58, 217, 39, 60, 21, 41, 64, 43, 66, 245, 45, 72, 47, 74, 49, 27, 51, 34, 267, 80, 36, 82, 277, 38, 57
Offset: 1

Views

Author

Mark Hudson (mrmarkhudson(AT)hotmail.com), Oct 20 2004

Keywords

Comments

a(199) > 10^6 if it exists. - Robert Israel, Jun 17 2015

Examples

			Gives the positions in the sequence A099506 at which the integers n>0 appear. That sequence begins: 1,3,6,2,8,4,... so a(1)=1, a(2)=4, a(3)=2, etc.
		

Crossrefs

Cf. A099506.

Programs

  • MATLAB
    N = 10^6;
    M = 10*N;  % search up to A099506(N) while A099507 < M
    % returns 0 for entries not found
    B = zeros(1, M);
    A = zeros(1, N);
    A(1) = 1;
    B(1) = 1;
    for n = 2:N
      t = mod(-A(n-1)-1,n)+1;
      bm = t + [0:floor((M-t)/n)]*n;
      bz = find(B(bm)==0,1);
      if numel(bz)==0
          break
      end
      m = t + n*(bz-1);
      A(n) = m;
      B(m) = n;
    end;
    B(1:1000) % Robert Israel, Jun 17 2015