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.

User: Sander G. Huisman

Sander G. Huisman's wiki page.

Sander G. Huisman has authored 5 sequences.

A358166 a(1) = 13; for n > 1, if a(n-1) is even, then a(n) = a(n-1)/2; otherwise, a(n) = a(n-1) + prime(a(n-1)).

Original entry on oeis.org

13, 54, 27, 130, 65, 378, 189, 1318, 659, 5592, 2796, 1398, 699, 5972, 2986, 1493, 13996, 6998, 3499, 36102, 18051, 218932, 109466, 54733, 730334, 365167, 5622764, 2811382, 1405691, 23685544, 11842772, 5921386, 2960693, 52246474, 26123237, 521463688, 260731844, 130365922, 65182961, 1364229390
Offset: 1

Author

Sander G. Huisman, Nov 01 2022

Keywords

Comments

Does this sequence become cyclic? All the sequences defined the same as this one but with 1 <= a(1) <= 12 are known to become cyclic.
a(81) = 1977693361846020549, so calculating a(82) will require calculating the 1977693361846020549th prime.

Examples

			a(1) = 13 is odd, so a(2) = 13 + prime(13) = 13 + 41 = 54.
a(2) = 54 is even, so a(3) = a(2)/2 = 54/2 = 27.
a(3) = 27 is odd, so a(4) = 27 + prime(27) = 27 + 103 = 130, etc.
		

Crossrefs

Programs

  • Mathematica
    NestList[If[EvenQ[#], #/2, # + Prime[#]] &, 13, 40]
  • PARI
    lista(nn) = my(va = vector(nn)); va[1] = 13; for (n=2, nn, if (va[n-1] % 2, va[n] = va[n-1] + prime(va[n-1]), va[n] = va[n-1]/2);); va; \\ Michel Marcus, Nov 12 2022

A355295 Number of distinct board states reachable in n jumps in European Peg Solitaire.

Original entry on oeis.org

1, 4, 17, 92, 495, 2475, 11771, 52226, 212527, 789228, 2640323, 7870055, 20730606, 47916748, 96715832, 170154214, 260956703, 349541944, 410294786, 423631649, 385887175, 310724581, 221398196, 139580751, 77748102, 38162987, 16445627, 6178002, 2007607, 559163, 131269, 25378, 4012, 481, 36, 4
Offset: 0

Author

Sander G. Huisman, Jun 27 2022

Keywords

Examples

			The beginning state is missing the peg just above the center, as an initial state with the center peg removed does not yield any valid solutions where 1 peg is remaining.
       * * *
     * * * * *
   * * * O * * *
   * * * * * * *
   * * * * * * *
     * * * * *
       * * *
The next move yields the next 4 states:
       * * *             * * *             * O *             * * *
     * * * * *         * * * * *         * * O * *         * * * * *
   * O O * * * *     * * * * * * *     * * * * * * *     * * * * O O *
   * * * * * * *     * * * O * * *     * * * * * * *     * * * * * * *
   * * * * * * *     * * * O * * *     * * * * * * *     * * * * * * *
     * * * * *         * * * * *         * * * * *         * * * * *
       * * *             * * *             * * *             * * *
		

Crossrefs

A341195 Squares visited by knight moves on a diagonally back and forth numbered board in two quadrants and moving to the lowest available unvisited square at every step.

Original entry on oeis.org

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

Author

Sander G. Huisman, Feb 06 2021

Keywords

Comments

Board is numbered as follows:
. 17 16 5 4 1 2 9 10 . .
. . 18 15 6 3 8 11 24 . .
. . . 19 14 7 12 23 . . .
. . . . 20 13 22 . . . .
. . . . . 21 . . . . .
. . . . . . . . . . .
This sequence is finite: At step 4408 square 4077 is visited, after which there are no unvisited squares within one knight move.

Crossrefs

Programs

  • Mathematica
    (* Version 12.0 or higher needed *)
    ClearAll[ShowRoute,MakeMove,FindSequence]
    knightjump=Select[Tuples[Range[-2,2],2],Norm[#]==Sqrt[5]&];
    ShowRoute[output_Association]:=Module[{colors},colors=(ColorData["Rainbow"]/@Subdivide[Length[output["Coordinates"]]-1.0]);
    Graphics[{Line[output["Coordinates"],VertexColors->colors],Disk[Last@output["Coordinates"],0.2],Style[Disk[Last[output["Coordinates"]]+#,0.2]&/@knightjump,Purple]}]]
    MakeMove[spiral_Association,visited_List]:=Module[{poss,hj},poss=Table[Last[Last[visited]]+hj,{hj,knightjump}];
    poss=DeleteMissing[{spiral[#],#}&/@poss,1,\[Infinity]];
    poss=Select[poss,FreeQ[visited[[All,2]],Last[#]]&];
    If[Length[poss]>0,First[TakeSmallestBy[poss,First,1]],Missing[]]]
    FindSequence[start_:{0,0},grid_]:=Module[{positions,j,next},positions={{grid[start],start}};
    PrintTemporary[Dynamic[j]];
    Do[next=MakeMove[grid,positions];
    If[next=!=Missing[],AppendTo[positions,next],Break[];],{j,\[Infinity]}];
    <|"Coordinates"->positions[[All,2]],"Indices"->positions[[All,1]]|>]
    grid=ResourceFunction["LatticePointsArrangement"]["DiagonalZigZagEastQ34",20000];
    grid=Association[MapIndexed[#1->#2[[1]]&,grid]];
    ShowRoute[fs=FindSequence[{0,0},grid]]
    fs
    fs["Indices"]
    ListPlot[fs["Indices"]]

A337170 Squares visited by knight moves on a diagonally back and forth numbered board and moving to the lowest available unvisited square at every step.

Original entry on oeis.org

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

Author

Sander G. Huisman, Jan 28 2021

Keywords

Comments

Board is numbered as follows:
1 3 4 10 11 .
2 5 9 12 . .
6 8 13 19 . .
7 14 18 . . .
15 17 . . . .
16 . . . . .
This sequence is finite: At step 343 square 276 is visited, after which there are no unvisited squares within one knight move.

Crossrefs

Programs

  • Mathematica
    ClearAll[ShowRoute,MakeMove,FindSequence]
    knightjump=Select[Tuples[Range[-2,2],2],Norm[#]==Sqrt[5]&];
    ShowRoute[output_Association]:=Module[{colors},colors=(ColorData["Rainbow"]/@Subdivide[Length[output["Coordinates"]]-1.0]);
    Graphics[{Line[output["Coordinates"],VertexColors->colors],Disk[Last@output["Coordinates"],0.2]}]]
    MakeMove[spiral_Association,visited_List]:=Module[{poss,hj},poss=Table[Last[Last[visited]]+hj,{hj,knightjump}];
    poss=DeleteMissing[{spiral[#],#}&/@poss,1,\[Infinity]];
    poss=Select[poss,FreeQ[visited[[All,2]],Last[#]]&];
    If[Length[poss]>0,First[TakeSmallestBy[poss,First,1]],Missing[]]]
    FindSequence[start_:{0,0},grid_]:=Module[{positions,j,next},positions={{grid[start],start}};
    PrintTemporary[Dynamic[j]];
    Do[next=MakeMove[grid,positions];
    If[next=!=Missing[],AppendTo[positions,next],Break[];],{j,\[Infinity]}];
    <|"Coordinates"->positions[[All,2]],"Indices"->positions[[All,1]]|>]
    grid=ResourceFunction["LatticePointsArrangement"]["DiagonalZigZagEastQ4",10000];
    grid=Association[MapIndexed[#1->#2[[1]]&,grid]];
    ShowRoute[fs=FindSequence[{0,0},grid]]
    fs
    fs["Indices"]
    ListPlot[fs["Indices"]]

A339132 Milk shuffle of the binary representation of n.

Original entry on oeis.org

0, 1, 2, 3, 2, 3, 6, 7, 2, 3, 6, 7, 10, 11, 14, 15, 2, 3, 6, 7, 18, 19, 22, 23, 10, 11, 14, 15, 26, 27, 30, 31, 2, 3, 6, 7, 18, 19, 22, 23, 34, 35, 38, 39, 50, 51, 54, 55, 10, 11, 14, 15, 26, 27, 30, 31, 42, 43, 46, 47, 58, 59, 62, 63, 2, 3, 6, 7, 18, 19, 22, 23
Offset: 0

Author

Sander G. Huisman, Nov 24 2020

Keywords

Examples

			For n = 19 we take the binary representation without leading zeros: 10011.
We now shuffle the binary digits around according to A209279, which can be interpreted as a so-called milk shuffle.
For five digits the n-th digits gets moved around as follows: 1,2,3,4,5 => 3,2,4,1,5.
This reshuffling can be thought of taking the middle number, and then alternatingly taking digits from the left and then the right until all digits are taken.
We now apply this reshuffling to our binary digits of 19: 00111.
This is now reinterpreted into a decimal number: 7.
		

Crossrefs

Cf. A330090 (shuffle bits low to high).
Cf. A209279 (1-based shuffle), A332104 (0-based shuffle).

Programs

  • Mathematica
    milk[list_]:=Table[list[[{i,-i}]],{i,Length[list]/2}]//milkPost[#,list]&//Reverse//Flatten
    milkPost[x_,list_]:=x/;EvenQ[Length[list]]
    milkPost[x_,list_]:=Join[x,{list[[(Length[list]+1)/2]]}]
    Table[FromDigits[milk@IntegerDigits[i,2],2],{i,0,500}]
    (*OR*)
    Table[FromDigits[ResourceFunction["Shuffle"][IntegerDigits[i,2],"Milk"],2], {i,0,500}]