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-10 of 11 results. Next

A000960 Flavius Josephus's sieve: Start with the natural numbers; at the k-th sieving step, remove every (k+1)-st term of the sequence remaining after the (k-1)-st sieving step; iterate.

Original entry on oeis.org

1, 3, 7, 13, 19, 27, 39, 49, 63, 79, 91, 109, 133, 147, 181, 207, 223, 253, 289, 307, 349, 387, 399, 459, 481, 529, 567, 613, 649, 709, 763, 807, 843, 927, 949, 1009, 1093, 1111, 1189, 1261, 1321, 1359, 1471, 1483, 1579, 1693, 1719, 1807, 1899, 1933, 2023
Offset: 1

Views

Author

Keywords

Comments

a(n) is never divisible by 2 or 5. - Thomas Anton, Nov 01 2018

Examples

			Start with
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 ... (A000027) and delete every second term, giving
1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 ... (A005408) and delete every 3rd term, giving
1 3 7 9 13 15 19 21 25 27 ... (A056530) and delete every 4th term, giving
1 3 7 13 15 19 25 27 ... (A056531) and delete every 5th term, giving
.... Continue forever and what's left is the sequence.
(The array formed by these rows is A278492.)
For n = 5, 5^2 = 25, go down to a multiple of 4 giving 24, then to a multiple of 3 = 21, then to a multiple of 2 = 20, then to a multiple of 1 = 19, so a(5) = 19.
		

References

  • V. Brun, Un procédé qui ressemble au crible d'Ératosthène, Analele Stiintifice Univ. "Al. I. Cuza", Iasi, Romania, Sect. Ia Matematica, 1965, vol. 11B, pp. 47-53.
  • Problems 107, 116, Nord. Mat. Tidskr. 5 (1957), 114-116.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Cf. A119446 for triangle whose leading diagonal is A119447 and this sequence gives all possible values for A119447 (except A119447 cannot equal 1 because prime(n)/n is never 1).
Cf. A100617 (a left inverse), A100618.
Cf. A278169 (characteristic function).
Main diagonal of A278492, leftmost column of A278505, positions of zeros in A278528 & A278529.

Programs

  • Haskell
    a000960 n = a000960_list !! (n-1)
    a000960_list = sieve 1 [1..] where
       sieve k (x:xs) = x : sieve (k+1) (flavius xs) where
          flavius xs = us ++ flavius vs where (u:us,vs) = splitAt (k+1) xs
    -- Reinhard Zumkeller, Oct 31 2012
    
  • Maple
    S[1]:={seq(i,i=1..2100)}: for n from 2 to 2100 do S[n]:=S[n-1] minus {seq(S[n-1][n*i],i=1..nops(S[n-1])/n)} od: A:=S[2100]; # Emeric Deutsch, Nov 17 2004
  • Mathematica
    del[lst_, k_] := lst[[Select[Range[Length[lst]], Mod[ #, k] != 0 &]]]; For[k = 2; s = Range[2100], k <= Length[s], k++, s = del[s, k]]; s
    f[n_] := Fold[ #2*Ceiling[ #1/#2 + 1] &, n, Reverse@Range[n - 1]]; Array[f, 60] (* Robert G. Wilson v, Nov 05 2005 *)
  • PARI
    a(n)=local(A=n,D);for(i=1,n-1,D=n-i;A=D*ceil(A/D+1));return(A) \\ Paul D. Hanna, Oct 10 2005
    
  • Python
    def flavius(n):
        L = list(range(1,n+1));j=2
        while j <= len(L):
            L = [L[i] for i in range(len(L)) if (i+1)%j]
            j+=1
        return L
    flavius(100)
    # Robert FERREOL, Nov 08 2015

Formula

Let F(n) = number of terms <= n. Andersson, improving results of Brun, shows that F(n) = 2 sqrt(n/Pi) + O(n^(1/6)). Hence a(n) grows like Pi*n^2 / 4.
To get n-th term, start with n and successively round up to next 2 multiples of n-1, n-2, ..., 1 (compare to Mancala sequence A002491). E.g.: to get 11th term: 11->30->45->56->63->72->80->84->87->90->91; i.e., start with 11, successively round up to next 2 multiples of 10, 9, .., 1. - Paul D. Hanna, Oct 10 2005
As in Paul D. Hanna's formula, start with n^2 and successively move down to the highest multiple of n-1, n-2, etc., smaller than your current number: 121 120 117 112 105 102 100 96 93 92 91, so a(11) = 91, from moving down to multiples of 10, 9, ..., 1. - Joshua Zucker, May 20 2006
Or, similarly for n = 5, begin with 25, down to a multiple of 4 = 24, down to a multiple of 3 = 21, then to a multiple of 2 = 20 and finally to a multiple of 1 = 19, so a(5) = 19. - Joshua Zucker, May 20 2006
This formula arises in A119446; the leading term of row k of that triangle = a(prime(k)/k) from this sequence. - Joshua Zucker, May 20 2006
a(n) = 2*A073359(n-1) + 1, cf. link to posts on the SeqFan list. - M. F. Hasler, Nov 23 2016
a(n) = 1 + A278484(n-1). - Antti Karttunen, Nov 23 2016, after David W. Wilson's posting on SeqFan list Nov 22 2016

Extensions

More terms and better description from Henry Bottomley, Jun 16 2000
Entry revised by N. J. A. Sloane, Nov 13 2004
More terms from Paul D. Hanna, Oct 10 2005

A002491 Smallest number of stones in Tchoukaillon (or Mancala, or Kalahari) solitaire that make use of n-th hole.

Original entry on oeis.org

1, 2, 4, 6, 10, 12, 18, 22, 30, 34, 42, 48, 58, 60, 78, 82, 102, 108, 118, 132, 150, 154, 174, 192, 210, 214, 240, 258, 274, 282, 322, 330, 360, 372, 402, 418, 442, 454, 498, 510, 540, 570, 612, 622, 648, 672, 718, 732, 780, 802, 840, 870, 918
Offset: 1

Views

Author

Keywords

Comments

To get n-th term, start with n and successively round up to next multiple of n-1, n-2, ..., 1.
Generated by a sieve: start with [ 1..n ]; keep first number, drop every 2nd, keep first, drop every 3rd, keep first, drop every 4th, etc.
Comment from Don Knuth, Jun 08 2021, added by N. J. A. Sloane, Jun 09 2021: (Start)
I have put together a preliminary exposition of the results of Broline and Loeb (1995), in what's currently called Exercise 11 (on page 7) and its answer (on pages 9 and 10) of the Bipartite Matching document.
Unfortunately, I believe this paper erred when it claimed to have proved the conjecture of Erdős and Jabotinsky about the sharpness of approximation to n^2/pi. When they computed the sum of I_M in the proof of Theorem 9, they expressed it as f(M-1)^2/4M + O(f(M-1)). That's correct; but the error gets quite large, and when summed gives O(n^(3/2)), not O(n).
By summing over only part of the range, and using another estimate in the rest, I believe one can get an overall error bound O(n^(4/3)), thus matching the result of Erdős and Jabotinsky but not improving on it. (End)

Examples

			To get 10th term: 10->18->24->28->30->30->32->33->34->34.
		

References

  • Y. David, On a sequence generated by a sieving process, Riveon Lematematika, 11 (1957), 26-31.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, Section 1.4.7.
  • V. Gautheron, Chapter 3.II.5: La Tchouka, in Wari et Solo: le Jeu de calculs africain (Les Distracts), Edited by A. Deledicq and A. Popova, CEDIC, Paris, 1977, 180-187.
  • D. E. Knuth, Bipartite Matching, The Art of Computer Programming, Vol. 4, Pre-fascicle 14A, June 8, 2021, http://cs.stanford.edu/~knuth/fasc14a.ps.gz. See Sect. 7.5.1, Exercise 11.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Haskell
    a002491 n = a002491_list !! (n-1)
    a002491_list = sieve 1 [1..] where
       sieve k (x:xs) = x : sieve (k+1) (mancala xs) where
          mancala xs = us ++ mancala vs where (us,v:vs) = splitAt k xs
    -- Reinhard Zumkeller, Oct 31 2012
    
  • Maple
    # A002491
    # program due to B. Gourevitch
    a := proc(n)
    local x,f,i,y;
      x := n; f := n;
      for i from x by -1 to 2 do
         y := i-1;
         while y < f do
           y := y+i-1
         od;
      f := y
      od
    end:
    seq(a(n), n = 2 .. 53);
  • Mathematica
    f[n_] := Fold[ #2*Ceiling[ #1/#2 + 0] &, n, Reverse@Range[n - 1]]; Array[f, 56] (* Robert G. Wilson v, Nov 05 2005 *)
    del[list_, k_] := Delete[list, Table[{i}, {i, k, Length[list], k}]]; a[n_] := Last@NestWhile[{#[[1]] + 1, del[Rest@#[[2]], #[[1]] + 1], Append[#[[3]], First@#[[2]]]} &, {1,Range[n], {}}, #[[2]] =!= {} &]; a[1000] (* Birkas Gyorgy, Feb 26 2011 *)
    Table[1 + First@FixedPoint[{Floor[#[[1]]*(#[[2]] + 1/2)/#[[2]]], #[[2]] + 1} &, {n, 1}, SameTest -> (#1[[1]] == #2[[1]] &)], {n, 0, 30}] (* Birkas Gyorgy, Mar 07 2011 *)
    f[n_]:=Block[{x,p},For[x=p=1, p<=n, p++, x=Ceiling[(n+2-p)x/(n+1-p)]];x] (* Don Knuth, May 27 2021 *)
  • PARI
    a(n)=forstep(k=n-1,2,-1, n=((n-1)\k+1)*k); n \\ Charles R Greathouse IV, Mar 29 2016

Formula

Equals A007952(n) + 1 or equally A108696(n) - 1.
A130747(a(n)) = 1. - Reinhard Zumkeller, Jun 23 2009
a(n+1) = 1 + [..[[[[n*3/2]5/4]7/6]9/8]...(2k+1)/2k]...]. - Birkas Gyorgy, Mar 07 2011
Limit_{n -> oo} n^2/a(n) = Pi (see Brown). - Peter Bala, Mar 12 2014
It appears that a(n)/2 = A104738(n-1). - Don Knuth, May 27 2021

A113743 Generalized Mancala solitaire (A002491); to get n-th term, start with n and successively round up to next 6 multiples of n-1, n-2, ..., 1.

Original entry on oeis.org

1, 7, 19, 37, 61, 87, 123, 163, 207, 253, 307, 373, 447, 511, 589, 673, 763, 843, 949, 1087, 1179, 1309, 1393, 1531, 1693, 1807, 1933, 2119, 2263, 2439, 2559, 2761, 2967, 3147, 3327, 3499, 3691, 3883, 4123, 4309, 4603, 4783, 5067, 5209, 5539, 5763, 6013
Offset: 1

Views

Author

Paul D. Hanna, Oct 12 2005

Keywords

Examples

			a(1)=1: 1;
a(2)=7: 2->7;
a(3)=19: 3->14->19;
a(4)=37: 4->21->32->37;
a(5)=61: 5->28->45->56->61;
a(6)=87: 6->35->56->72->82->87;
a(7)=123: 7->42->70->92->108->118->123;
a(8)=163: 8->49->84->110->132->147->158->163;
a(9)=207: 9->56->91->126->155->176->192->202->207;
a(10)=253: 10->63->104->140->174->200->220->237->248->253.
		

Crossrefs

Cf. {k=-1..12} A000012, A002491, A000960 (Flavius Josephus's sieve), A112557, A112558, A113742, A113743, A113744, A113745, A113746, A113747, A113748; det. A113749.

Programs

  • Mathematica
    f[n_] := Fold[ #2*Ceiling[ #1/#2 + 5] &, n, Reverse@Range[n - 1]]; Array[f, 47]
  • PARI
    a(n)=local(A=n,D);for(i=1,n-1,D=n-i;A=D*ceil(A/D+5));A

Formula

a(4*n-3) = A112558(5*n-4), a(8*n-7) = A000960(15*n-14), for n>=1.

Extensions

Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, May 31 2007

A113746 Generalized Mancala solitaire (A002491); to get n-th term, start with n and successively round up to next 9 multiples of n-1, n-2, ..., 1, for n>=1.

Original entry on oeis.org

1, 10, 28, 54, 90, 132, 180, 240, 318, 394, 480, 570, 672, 778, 898, 1042, 1174, 1332, 1474, 1632, 1812, 1992, 2160, 2340, 2580, 2760, 3018, 3252, 3502, 3720, 3972, 4222, 4498, 4818, 5118, 5382, 5718, 6022, 6378, 6672, 7038, 7378, 7714, 8112, 8430, 8850
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. {k=-1..12} A000012, A002491, A000960 (Flavius Josephus's sieve), A112557, A112558, A113742, A113743, A113744, A113745, A113746, A113747, A113748; det. A113749.

Programs

  • Mathematica
    f[n_] := Fold[ #2*Ceiling[ #1/#2 + 8] &, n, Reverse@Range[n - 1]]; Array[f, 46]

A113749 Consider the generalized Mancala solitaire (A002491); to get n-th term, start with n and successively round up to next k multiples of n-1, n-2, ..., 1, for n>=1. Now construct the array, t, such that t(n,k) is the n-th and successively rounding up to the next k multiples. This sequence is the presentation of that array by reading the antidiagonals.

Original entry on oeis.org

1, 1, 1, 1, 2, 1, 1, 3, 4, 1, 1, 4, 7, 6, 1, 1, 5, 10, 13, 10, 1, 1, 6, 13, 18, 19, 12, 1, 1, 7, 16, 25, 30, 27, 18, 1, 1, 8, 19, 30, 39, 42, 39, 22, 1, 1, 9, 22, 37, 48, 61, 58, 49, 30, 1, 1, 10, 25, 42, 61, 72, 79, 78, 63, 34, 1, 1, 11, 28, 49, 70, 87, 102, 103, 102, 79, 42, 1, 1, 12, 31
Offset: 1

Views

Author

Keywords

Comments

The determinant of t(i,j), i=1..n, j=1..n, n=1..inf. is: 1,1,0,0,0,0, ...,.
The determinant of t(i,j), i=1..n, j=-1..n-2, n=1..inf. is: 1,1,0,0,0,0, ...,.

Examples

			1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, ...,.
1, 2, 4, 6, 10, 12, 18, 22, 30, 34, 42, 48, 58, 60, 78, ...,.
1, 3, 7, 13, 19, 27, 39, 49, 63, 79, 91, 109, 133, 147, 181, ...,.
1, 4, 10, 18, 30, 42, 58, 78, 102, 118, 150, 174, 210, 240, 274, ...,.
1, 5, 13, 25, 39, 61, 79, 103, 133, 169, 207, 241, 289, 331, 387, ...,.
1, 6, 16, 30, 48, 72, 102, 132, 168, 210, 258, 318, 360, 418, 492, ...,.
1, 7, 19, 37, 61, 87, 123, 163, 207, 253, 307, 373, 447, 511, 589, ...,.
1, 8, 22, 42, 70, 102, 142, 192, 240, 298, 360, 438, 510, 612, 708, ...,.
1, 9, 25, 49, 79, 121, 163, 219, 279, 349, 423, 507, 589, 687, 807, ...,.
1, 10, 28, 54, 90, 132, 180, 240, 318, 394, 480, 570, 672, 778, 898, ...,.
1, 11, 31, 61, 99, 147, 207, 271, 349, 439, 529, 643, 751, 867,1009, ...,.
1, 12, 34, 66, 108, 162, 228, 298, 382, 480, 588, 708, 838, 972,1114, ...,.
		

Crossrefs

Cf. {k=-1..12} A000012, A002491, A000960 (Flavius Josephus's sieve), A112557, A112558, A113742, A113743, A113744, A113745, A113746, A113747, A113748.

Programs

  • Mathematica
    f[n_, k_] := Fold[ #2*Ceiling[ #1/#2 + k] &, n, Reverse@Range[n - 1]]; Table[f[n - k + 1, k], {n, -1, 11}, {k, n, -1, -1}] // Flatten

A112557 Smallest number of stones in Tchoukaillon (or Mancala, or Kalahari) solitaire which make use of (2*n-1)-th hole for n>=1; a bisection of A002491.

Original entry on oeis.org

1, 4, 10, 18, 30, 42, 58, 78, 102, 118, 150, 174, 210, 240, 274, 322, 360, 402, 442, 498, 540, 612, 648, 718, 780, 840, 918, 990, 1054, 1122, 1200, 1278, 1392, 1428, 1548, 1632, 1714, 1834, 1882, 2040, 2118, 2242, 2314, 2434, 2580, 2662, 2760, 2922, 3054
Offset: 1

Views

Author

Paul D. Hanna, Oct 10 2005

Keywords

Examples

			To get 10th term: 10->36->56->70->84->95->104->111->116->118.
To get 5th term: 5->16->24->28->30; since a(5) = A002491(9), compare with process used by A002491:
A002491(9) = 9->16->21->24->25->28->30->30->30.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Fold[ #2 * Ceiling[ #1/#2 + 2] &, n, Reverse @ Range[n - 1]]; Array[ f, 49] (* Bobby R. Treat (drbob(at)bigfoot.com), Oct 11 2005 *)
  • PARI
    a(n)=local(A=n,D);for(i=1,n-1,D=n-i;A=D*ceil(A/D+2));A

Formula

To get n-th term, start with n and successively round up to next 3 multiples of n-1, n-2, ..., 1 (compare to method used by A002491). Surprisingly, a(n) = A002491(2*n-1).

A112558 Generalized Mancala solitaire (A002491); to get n-th term, start with n and successively round up to next 4 multiples of n-1, n-2, ..., 1, for n>=1.

Original entry on oeis.org

1, 5, 13, 25, 39, 61, 79, 103, 133, 169, 207, 241, 289, 331, 387, 447, 481, 553, 613, 687, 763, 819, 927, 979, 1093, 1179, 1261, 1347, 1471, 1539, 1693, 1759, 1899, 2019, 2161, 2263, 2367, 2527, 2703, 2779, 2967, 3073, 3199, 3373, 3529, 3691, 3841, 3987, 4203
Offset: 1

Views

Author

Paul D. Hanna, Oct 12 2005

Keywords

Examples

			a(1)=1: 1;
a(2)=5: 2->5;
a(3)=13: 3->10->13;
a(4)=25: 4->15->22->25;
a(5)=39: 5->20->30->36->39;
a(6)=61: 6->25->40->51->58->61;
a(7)=79: 7->30->45->60->69->76->79;
a(8)=103: 8->35->54->70->84->93->100->103;
a(9)=133: 9->40->63->84->100->112->123->130->133;
a(10)=169: 10->45->72->98->120->135->148->159->166->169.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Fold[#2*Ceiling[#1/#2 + 3] &, n, Reverse@ Range[n - 1]]; Array[f, 49]
  • PARI
    a(n)=local(A=n,D);for(i=1,n-1,D=n-i;A=D*ceil(A/D+3));A

Formula

a(2*n-1) = A000960(3*n-2), where A000960 is Flavius Josephus's sieve.

A113742 Generalized Mancala solitaire (A002491); to get n-th term, start with n and successively round up to next 5 multiples of n-1, n-2, ..., 1, for n>=1.

Original entry on oeis.org

1, 6, 16, 30, 48, 72, 102, 132, 168, 210, 258, 318, 360, 418, 492, 540, 622, 714, 780, 870, 972, 1054, 1174, 1260, 1392, 1488, 1590, 1714, 1848, 2022, 2118, 2292, 2398, 2580, 2718, 2878, 3054, 3234, 3360, 3570, 3754, 3948, 4114, 4318, 4498, 4710, 4932
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. {k=-1..12} A000012, A002491, A000960 (Flavius Josephus's sieve), A112557, A112558, A113743, A113744, A113745, A113746, A113747, A113748; det. A113749.

Programs

  • Mathematica
    f[n_] := Fold[ #2*Ceiling[ #1/#2 + 4] &, n, Reverse@Range[n - 1]]; Array[f, 47]

A113745 Generalized Mancala solitaire (A002491); to get n-th term, start with n and successively round up to next 8 multiples of n-1, n-2, ..., 1, for n>=1.

Original entry on oeis.org

1, 9, 25, 49, 79, 121, 163, 219, 279, 349, 423, 507, 589, 687, 807, 927, 1027, 1171, 1309, 1453, 1579, 1743, 1909, 2101, 2263, 2479, 2703, 2851, 3073, 3279, 3499, 3807, 3973, 4239, 4543, 4767, 5067, 5293, 5563, 5893, 6159, 6547, 6799, 7189, 7419, 7839
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. {k=-1..12} A000012, A002491, A000960 (Flavius Josephus's sieve), A112557, A112558, A113742, A113743, A113744, A113746, A113747, A113748, A113749.

Programs

  • Mathematica
    f[n_] := Fold[ #2*Ceiling[ #1/#2 + 7] &, n, Reverse@Range[n - 1]]; Array[f, 46]

A113747 Generalized Mancala solitaire (A002491); to get n-th term, start with n and successively round up to next 10 multiples of n-1, n-2, ..., 1, for n>=1.

Original entry on oeis.org

1, 11, 31, 61, 99, 147, 207, 271, 349, 439, 529, 643, 751, 867, 1009, 1143, 1309, 1471, 1651, 1807, 2019, 2223, 2439, 2629, 2851, 3109, 3363, 3619, 3879, 4179, 4429, 4759, 5067, 5329, 5667, 6013, 6387, 6723, 7069, 7407, 7839, 8283, 8593, 9039, 9423, 9889
Offset: 1

Views

Author

Keywords

Crossrefs

Cf. {k=-1..12} A000012, A002491, A000960 (Flavius Josephus's sieve), A112557, A112558, A113742, A113743, A113744, A113745, A113746, A113748, A113749.

Programs

  • Mathematica
    f[n_] := Fold[ #2*Ceiling[ #1/#2 + 9] &, n, Reverse@Range[n - 1]]; Array[f, 46]
Showing 1-10 of 11 results. Next