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-4 of 4 results.

A104738 Positions of records in A104706.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 11, 15, 17, 21, 24, 29, 30, 39, 41, 51, 54, 59, 66, 75, 77, 87, 96, 105, 107, 120, 129, 137, 141, 161, 165, 180, 186, 201, 209, 221, 227, 249, 255, 270, 285, 306, 311, 324, 336, 359, 366, 390, 401, 420, 435, 459, 465, 495, 501, 527, 534
Offset: 1

Views

Author

Zak Seidov, Mar 21 2005

Keywords

Comments

The entries in this sequence are the same as the partial sums of the independently derived A204539, for reasons unknown at present. - Colm Fagan, Jan 23 2012

Crossrefs

See A002491 for a conjectured connection to this sequence.

Programs

  • BASIC
    n=n+1; temp1=n^2; for k=(n-1) step -1 to 2; temp2=int(temp1/k); temp1=k*temp2; if int((temp2+k)/2))*2<>(temp2+k) then temp1=temp1-k; next k; a(n-1)=temp1/4 ' Colm Fagan, Nov 08 2015
    
  • MATLAB
    function [ A ] = A104738( N )
    % Produce a(1) : a(N)
    M = N;
    R = [1:M];
    v = 1;
    A = 1;
    count = 1;
    n = 1;
    while count < N
        n = n+1;
        if 2*R(1)+1 > M
            R = [R, (M+1):M+N];
        end
        R = [R(2:2*R(1)+1), R(1), R((2*R(1)+2) : M)];
        if R(1) > v
            A = [A, n];
            v = R(1);
            count = count+1;
        end
    end
    end;
    A104738(100)
  • Mathematica
    A104706 = NestList[Rest[Insert[#, #[[1]], 2 + 2 #[[1]]]]&, Range[m = 1000], m][[All, 1]];
    rec = 0; Reap[For[k = 1, k <= Length[A104706], k++, ak = A104706[[k]]; If[ak > rec, rec = ak; Sow[k]]]][[2, 1]] (* Jean-François Alcover, Apr 11 2019, after Birkas Gyorgy in A104706 *)
  • PARI
    a(n) = {n++; temp1 = n^2; forstep (k= n-1, 2, -1, temp2 = temp1\k; temp1 = k*temp2; if (((temp2+k)\2)*2 != (temp2+k), temp1 -= k)); temp1/4;} \\ after Basic; Michel Marcus, Dec 04 2015
    

Extensions

Extended by Ray Chandler, Jan 19 2012

A028920 Pit harvesting sequence for winning solitaire Tchoukaillon (or Mancala).

Original entry on oeis.org

1, 2, 1, 3, 1, 4, 1, 2, 1, 5, 1, 6, 1, 2, 1, 3, 1, 7, 1, 2, 1, 8, 1, 4, 1, 2, 1, 3, 1, 9, 1, 2, 1, 10, 1, 5, 1, 2, 1, 3, 1, 11, 1, 2, 1, 4, 1, 12, 1, 2, 1, 3, 1, 6, 1, 2, 1, 13, 1, 14, 1, 2, 1, 3, 1, 4, 1, 2, 1, 5, 1, 7, 1, 2, 1, 3, 1, 15, 1, 2, 1, 16, 1, 4, 1, 2, 1, 3, 1, 8, 1, 2, 1, 6, 1, 5, 1, 2, 1, 3, 1, 17, 1
Offset: 0

Views

Author

Keywords

Comments

From Benoit Cloitre, Mar 09 2007: (Start)
The sequence can be constructed as follows using parentheses (NP means "term not in parentheses"):
Start from the positive integers:
1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,...
Step 1: put the least NP "1" in parentheses and every 2 terms giving:
(1),2,(3),4,(5),6,(7),8,(9),10,(11),12,(13),14,(15),16,(17),18,(19),...
Step 2: put the least NP "2" in 2 parentheses and every 3 NP giving:
(1),((2)),(3),4,(5),6,(7),((8)),(9),10,(11),12,(13),((14)),(15),16,(17),...
so that between 2 consecutives ((x)) there are 2 NP.
Step 3: put the least NP "4" in 3 parentheses and every 4 NP giving:
(1),((2)),(3),(((4))),(5),6,(7),((8)),(9),10,(11),12,(13),((14)),(15),(((16))),...
so that between 2 consecutives (((x))) there are 3 NP.
Step 4: put the least NP "6" in 4 parentheses and every 5 NP giving:
(1),((2)),(3),(((4))),(5),((((6)))),(7),((8)),(9),10,(11),12,(13),((14)),(15),(((16))),...
so that between 2 consecutives ((((x)))) there are 4 NP.
Iterating the process indefinitely yields:
(1),((2)),(3),(((4))),(5),((((6)))),(7),((8)),(9),(((((10))))),(11),...
Count the parentheses:
1,2,1,3,1,4,1,2,1,5,1,... - this is the sequence.
(End)
From Benoit Cloitre, Jul 26 2007: (Start)
A simpler way to construct the sequence: start from
1,,1,,1,,1,,1,,1,,1,_,1,... where 1's are spaced by one hole;
fill first hole with 2 and leave 2 holes between two 2's giving
1,2,1,,1,,1,2,1,,1,,1,2,1,...;
fill new first hole with 3 and leave 3 holes between two 3's giving
1,2,1,3,1,,1,2,1,,1,_,1,2,1,3...;
iterating the process indefinitely yields the sequence.
(End)
Ordinal transform of A130747. - Benoit Cloitre, Aug 03 2007
Although this sequence and A130747 are not fractal sequences (according to Kimberling's definition), we say they are "mutual fractal sequences" since the ordinal transform of one gives the other. - Benoit Cloitre, Aug 03 2007
The smallest n with a(n) = k is circa k^2/Pi.
The element n >= 0 occurs in this sequence with limiting density 1/(n*(n+1)).

Crossrefs

Programs

  • Mathematica
    n = 15; Fold[If[Length@Position[#1, 0] > 0, ReplacePart[#1,First /@ Partition[Position[#1, 0], #2 + 1, #2 + 1, {1, 1}] -> #2], #1] &,  Flatten@Array[{1, 0} &, n], Range[2, 2 n]] (* Birkas Gyorgy, Feb 26 2011 *)
  • PARI
    a(n) = {ok = 0; m = 1; while (!ok, if ((n%(m+1) == 0), ok = 1, n = n*m\(m+1); m++);); m;} \\ Michel Marcus, Dec 06 2015

Formula

a(2n+1) = 1 + A104706(n+1), a(2n) = 1. - Benoit Cloitre, Mar 09 2007
The sieve of A007952 processes n in the a(n)-th pass. a(A007952(n)) = n+1.

Extensions

Additional comments from David W. Wilson, Feb 25 2010

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

Original entry on oeis.org

1, 2, 3, 4, 1, 5, 6, 7, 1, 2, 8, 9, 1, 10, 3, 11, 1, 2, 12, 13, 1, 4, 14, 15, 1, 2, 16, 3, 1, 5, 17, 18, 1, 2, 19, 6, 1, 20, 4, 3, 1, 2, 21, 22, 1, 7, 23, 24, 1, 2, 25, 5, 1, 3, 8, 26, 1, 2, 4, 27, 1, 28, 9, 29, 1, 2, 3, 6, 1, 30, 31, 10, 1, 2, 32, 4, 1, 5, 3, 33, 1, 2, 34, 7, 1, 11, 35, 36, 1, 2
Offset: 1

Views

Author

Zak Seidov, Mar 20 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,17,18,19,20,
Move the first term s(1)=1 to 3*1=3 places to the right:
s1=2,3,4,1,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,
Move the first term s(1)=2 to 3*2=6 places to the right:
s2={3,4,1,5,6,7,2,8,9,10,11,12,13,14,15,16,17,18,19,20,
Repeating the procedure we get successively:
s3={4,1,5,6,7,2,8,9,10,3,11,12,13,14,15,16,17,18,19,20,
s4={1,5,6,7,2,8,9,10,3,11,12,13,4,14,15,16,17,18,19,20,
s5={5,6,7,1,2,8,9,10,3,11,12,13,4,14,15,16,17,18,19,20,
s6={6,7,1,2,8,9,10,3,11,12,13,4,14,15,16,5,17,18,19,20,
s7={7,1,2,8,9,10,3,11,12,13,4,14,15,16,5,17,18,19,6,20,
........................................................................
s100=1,5,39,3,2,40,13,41,42,4,43,9,14,7,44,45,46,6,15,47,10,48,49,16,8,50,
51,52,11,17,53,54,55,18,56,12,57,58,19,59,60,61,20,62,63,64,21,65,66,67,22,
68,69,70,23,71,72,73,24,74,75,76,25,77,78,79,26,80,81,82,27,83,84,85,28,86,
87,88,29,89,90,91,30,92,93,94,31,95,96,97,32,98,99,100,33,101,102,103,34,
104,105,106,35,107,108,109,36,110,111,112,37,113,114,115,38,116,117,
The sequence A104717 gives the first terms in the rearrangements s0,s1,s2,...,s100. Cf. A104705, A104706

Crossrefs

Programs

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

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

Original entry on oeis.org

1, 2, 1, 3, 2, 1, 4, 5, 3, 2, 1, 6, 7, 4, 8, 9, 10, 11, 5, 3, 2, 1, 12, 13, 6, 14, 15, 16, 17, 7, 4, 18, 19, 8, 20, 21, 22, 23, 9, 24, 25, 26, 27, 28, 29, 10, 30, 31, 11, 5, 3, 2, 1, 32, 33, 34, 35, 36, 37, 12, 38, 39, 40, 41, 13, 6, 42, 43, 14, 44, 45, 46, 47, 15, 48, 49, 50, 51, 52, 53
Offset: 1

Views

Author

Zak Seidov, Mar 21 2005

Keywords

Comments

Take the sequence of natural numbers: s0=1,2,3,4,5,6,7,8,9,10,11, Repeating the procedure: "Move the first term s(1) after s(1)-th prime": we get successively: s1=2,1,3,4,5,6,7,8,9,10,11, s2=1,3,2,4,5,6,7,8,9,10,11, s3=3,2,1,4,5,6,7,8,9,10,11, s4=2,1,4,5,3,6,7,8,9,10,11, s5=1,4,5,3,2,6,7,8,9,10,11, ............................................................ s100=8,68,69,70,71,20,72,73,21,74,75,76,77,78,79,22,80,81,82, 83,23,9,84,85,86,87,88,89,24,90,91,92,93,94,95,96,97,25,98,99, 100,101,26,102,103,27,104,105,106,107,28,108,109,29,10,110, The sequence A104741 gives the first terms in the rearrangements s0,s1,s2,... Cf. A104705, A104706, A104717

Crossrefs

Showing 1-4 of 4 results.