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.

Showing 1-3 of 3 results.

A128754 Permutation of positive integers obtained by swapping n-th natural number with the (n-g)-th sequentially, where g=prime(n+1)-prime(n)-1.

Original entry on oeis.org

4, 3, 6, 9, 8, 11, 1, 2, 12, 15, 16, 13, 18, 7, 5, 21, 30, 23, 22, 17, 19, 25, 10, 27, 34, 29, 32, 31, 20, 24, 36, 37, 42, 39, 46, 47, 33, 26, 35, 41, 44, 43, 28, 53, 48, 51, 50, 49, 62, 55, 56, 61, 66, 38, 14, 59, 52, 45, 68, 63, 40, 67, 64, 57, 72, 71, 70, 73, 74, 77, 80, 79
Offset: 1

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu or ferencadorjan(AT)gmail.com), Mar 24 2007

Keywords

Comments

By numerical explorations up to 50k terms, it seems to be an "infinite braid", i.e. it consists of a single infinite cycle, without any fixed points or closed cycles.

Crossrefs

Inverse of A128755, Cf. A128756, A128757.

Programs

  • PARI
    {pperm(n)= /* Returns a vector with n terms of the sequence */
    local(m,q,v,x,j,ap);j=n+prime(n+6)-prime(n);v=vector(j);x=vector(n);
    for(i=1,j,v[i]=i);for(i=1,j,ap=prime(i+1)-prime(i)-1;q=v[i];v[i]=v[i-ap];v[i-ap]=q);
    for(i=1,n,x[i]=v[i]);return(x)}

A128755 Inverse of A128754.

Original entry on oeis.org

7, 8, 2, 1, 15, 3, 14, 5, 4, 23, 6, 9, 12, 55, 10, 11, 20, 13, 21, 29, 16, 19, 18, 30, 22, 38, 24, 43, 26, 17, 28, 27, 37, 25, 39, 31, 32, 54, 34, 61, 40, 33, 42, 41, 58, 35, 36, 45, 48, 47, 46, 57, 44, 78, 50, 51, 64, 76, 56, 74, 52, 49, 60, 63, 77, 53, 62, 59, 83, 67, 66, 65
Offset: 1

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu or ferencadorjan(AT)gmail.com), Mar 24 2007

Keywords

Comments

Seemingly the inversion maintains the characteristics of being an "infinite braid".

Crossrefs

Inverse of A128754, Cf. A128756, A128757.

Programs

  • PARI
    {pinverse(v)= /* Permutation inverse of a positive sequence */
    local(n,m,x);n=matsize(v)[2]; x=vector(n);
    for(i=1,n,if(v[i]<=n,x[v[i]]=i)); return(x)}
    pinverse(A128754)

A128756 Permutation sequence related to lucky numbers A000959: starting with the integers, for n = 1, 2, 3, ... swap the n-th and the (n-g)-th element, where g = A000959(n+1) - A000959(n) - 1.

Original entry on oeis.org

6, 3, 14, 7, 2, 11, 12, 9, 1, 5, 4, 15, 20, 17, 26, 21, 22, 23, 36, 10, 19, 31, 8, 13, 32, 27, 16, 29, 34, 33, 48, 30, 28, 39, 42, 41, 44, 35, 37, 43, 24, 45, 52, 47, 50, 51, 58, 55, 25, 67, 56, 53, 38, 63, 62, 54, 64, 61, 40, 77, 66, 71, 68, 18, 70, 59, 78, 79, 74, 85, 65, 46
Offset: 1

Views

Author

Ferenc Adorjan (fadorjan(AT)freemail.hu or ferencadorjan(AT)gmail.com), Mar 24 2007

Keywords

Comments

Similarly to A128754, this sequence also shows the characteristics of an "infinite braid".

Crossrefs

Inverse of A128757. Cf. A128754, A128755 and A000959.

Programs

  • PARI
    {vperm(z)=local(n,j,g); /* Permutation of positive integers: starting with the sequence of positive integers, for i = 1, 2, 3,..., swap the i-th term with max(i-g(i),1)-th term, where g(i) = z[i+1]-z[i]-1. */
      j=length(z)-1; n=j-z[j]+z[j-6]; v=[1..j];
      for(i=1,j, g=min(z[i+1]-z[i]-1,i-1); [v[i],v[i-g]]=[v[i-g],v[i]]);
      return(v[1..n])}
    a=vperm(A000959_upto(10^3))

Extensions

Edited by M. F. Hasler, Jan 09 2020
Showing 1-3 of 3 results.