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.

A104705 First terms in the rearrangements of integer numbers (see comments).

Original entry on oeis.org

1, 2, 3, 1, 4, 2, 1, 5, 6, 1, 2, 3, 1, 7, 2, 1, 8, 4, 1, 2, 3, 1, 9, 2, 1, 10, 11, 1, 2, 3, 1, 12, 2, 1, 4, 5, 1, 2, 3, 1, 13, 2, 1, 14, 6, 1, 2, 3, 1, 4, 2, 1, 15, 16, 1, 2, 3, 1, 17, 2, 1, 18, 4, 1, 2, 3, 1, 5, 2, 1, 7, 19, 1, 2, 3, 1, 20, 2, 1, 4, 8, 1, 2, 3, 1, 6, 2, 1, 21, 22, 1, 2, 3, 1, 4, 2, 1, 5, 23
Offset: 1

Views

Author

Zak Seidov, Mar 19 2005

Keywords

Comments

Take the sequence of natural numbers:
s0=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,
Move the first term s(1)=1 to prime[s(1)]=2 places to the right:
s1=2,3,1,4,5,6,7,8,9,10,11,12,13,14,15,16,
Move the first term s(1)=2 to prime[s(1)]=3 places to the right:
s2=3,1,4,2,5,6,7,8,9,10,11,12,13,15,16,
Repeating the procedure we get successively:
s3=1,4,2,5,6,3,7,8,9,10,11,12,13,15,16,
s4=4,2,1,5,6,3,7,8,9,10,11,12,13,15,16,
s5=2,1,5,6,3,7,8,4,9,10,11,12,13,15,16,
s6=1,5,6,2,3,7,8,4,9,10,11,12,13,15,16,
s7=5,6,1,2,3,7,8,4,9,10,11,12,13,15,16,
s8=6,1,2,3,7,8,4,9,10,11,12,5,13,15,16,
..................................................................
s100=2,3,1,24,9,4,25,26,27,6,5,7,28,29,30,10,8,31,32,11,33,34,35,36,
37,38,12,39,40,41,42,13,43,44,14,45,46,47,48,15,49,50,51,52,53,54,
16,55,56,57,58,59,60,17,61,62,18,63,64,65,66,67,68,19,69,70,71,72,
20,73,74,21,75,76,77,78,79,80,22,81,82,83,84,23,85,86,87,88,89,90,
The sequence A104705 gives the first terms in the rearrangements s0,s1,s2,...,s100.

Programs

  • Mathematica
    s=Range[100];bb={1};Do[s=Drop[Insert[s, s[[1]], 2+Prime[s[[1]]]], 1];bb=Append[bb, s[[1]]], {i, 100}];bb