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

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

A073360 Nested floor product of n and fractions (k+1)/k for all k>0 (mod 3), divided by 3.

Original entry on oeis.org

1, 4, 9, 20, 29, 44, 69, 104, 121, 180, 241, 284, 349, 420, 521, 664, 701, 860, 1009, 1184, 1301, 1540, 1789, 1964, 2181, 2380, 2701, 3124, 3301, 3704, 4029, 4444, 4809, 5144, 5789, 6340, 6729, 7244, 7981, 8420, 9101
Offset: 1

Views

Author

Paul D. Hanna, Jul 29 2002

Keywords

Examples

			a(2) = 4 since (1/3)[[[[[[2(2/1)](3/2)](5/4)](6/5)](8/7)](9/8)](11/10)](12/11)]
= (1/3)[[[[[4(3/2)](5/4)](6/5)](8/7)](9/8)](11/10)](12/11)]
= (1/3)[[[[6(5/4)](6/5)](8/7)](9/8)](11/10)](12/11)]
= (1/3)[[[[7(6/5)](8/7)](9/8)](11/10)](12/11)]
= (1/3)[[[[8(8/7)](9/8)](11/10)](12/11)]
= (1/3)[[[[9(9/8)](11/10)](12/11)]
= (1/3)[[[[10(11/10)](12/11)]
= 4.
Note that the denominators consist of positive integers not == 0 mod 3.
		

Crossrefs

Cf. A073359.

Formula

a(n)=(1/3)[...[[[[n(2/1)](3/2)](5/4)](6/5)]...(k+1)/k]..., k>0 (mod 3), where [x] = floor of x; this infinite nested floor product will eventually level-off at a(n).

A073361 Nested floor product of n and fractions (k+1)/k for all k>0 (mod 4), divided by 4.

Original entry on oeis.org

1, 5, 15, 31, 65, 105, 151, 275, 420, 631, 695, 1050, 1411, 1685, 2385, 2941, 3425, 4410, 5326, 6995, 7350, 9316, 10880
Offset: 1

Views

Author

Paul D. Hanna, Jul 29 2002

Keywords

Examples

			a(1)=1 since (1/4)[[[[1(2/1)](3/2)](4/3)](6/5)]=(1/4)[4(6/5)]=1
		

Crossrefs

Formula

a(n)=(1/3)[...[[[[n(2/1)](3/2)](4/3)](6/5)]...(k+1)/k]..., k>0 (mod 4), where [x] = floor of x; this infinite nested floor product will eventually level-off at a(n).

A278484 Main diagonal of A278482.

Original entry on oeis.org

0, 2, 6, 12, 18, 26, 38, 48, 62, 78, 90, 108, 132, 146, 180, 206, 222, 252, 288, 306, 348, 386, 398, 458, 480, 528, 566, 612, 648, 708, 762, 806, 842, 926, 948, 1008, 1092, 1110, 1188, 1260, 1320, 1358, 1470, 1482, 1578, 1692, 1718, 1806, 1898, 1932, 2022, 2160, 2186, 2268, 2366, 2478, 2532, 2702, 2738, 2798, 2966, 3018
Offset: 0

Views

Author

Antti Karttunen, Nov 23 2016 after David W. Wilson's posting on SeqFan list Nov 22 2016

Keywords

Crossrefs

Main diagonal of A278482 (and A278483).
Partial sums of A278484.

Programs

  • Mathematica
    a[n_]:= Fold[Floor@Times@##&,Prepend[Table[(k + 1)/k, {k, n, 1, -1}], n]] (* Ethan Beihl, Nov 29 2016 *)

Formula

By definition, a(n) = A278482(n,n).
a(n) = A000960(n + 1) - 1.
a(n) = 2*A073359(n). [Observed by Arie Groeneveld on SeqFan list, Nov 22 2016.] [Conjectural, true for n <= 2000 David W. Wilson, Nov 23 2016]

A073362 Nested floor product of n and fractions (k+1)/k for all k>0 (mod 5), divided by 5.

Original entry on oeis.org

1, 6, 19, 48, 109, 234, 355, 552, 1009, 1518, 2371, 3804, 4141, 6342, 8803, 12096, 14389, 18438, 24043, 27720, 36397, 45366, 60499, 75876, 80137, 97566, 114931, 140892, 166321, 205926, 218587, 266664, 292429, 342006, 394651, 477336, 481429
Offset: 1

Views

Author

Paul D. Hanna, Jul 29 2002

Keywords

Examples

			a(1)=1 since (1/5)[[[[1(2/1)](3/2)](4/3)](5/4)]=1
		

Crossrefs

Programs

  • Mathematica
    f[n_] := Block[{k = 1, p = n}, While[q = Floor[p*(k + 1)/k]; q != p, p = q; k++; If[ Mod[k, 5] == 0, k++ ]]; p/5]; Table[ f[n], {n, 1, 37}] (* Robert G. Wilson v *)

Formula

a(n)=(1/5)[...[[[[n(2/1)](3/2)](4/3)](5/4)](7/6)]...(k+1)/k]..., k>0 (mod 5), where [x] = floor of x; this infinite nested floor product will eventually level-off at a(n).

Extensions

More terms from Robert G. Wilson v, Dec 27 2003

A073363 Nested floor product of n and fractions (k+1)/k for all k>0 (mod 6), divided by 6.

Original entry on oeis.org

1, 7, 28, 84, 175, 421, 847, 1288, 1939, 3780, 5656, 9247, 15148, 22099, 25375, 39676, 54607, 75208, 90559, 129360, 166321, 209832, 240268, 320719, 399595, 536956, 672672, 816733, 906444, 1115275, 1321741, 1595832, 1908088, 2323944
Offset: 1

Views

Author

Paul D. Hanna, Jul 29 2002

Keywords

Comments

When is a(n) not divisible by 7?

Examples

			a(1)=1 since (1/6)[[[[1(2/1)](3/2)](4/3)](5/4)](6/5)]=1
		

Crossrefs

Formula

a(n)=(1/6)[...[[[[[[n(2/1)](3/2)](4/3)](5/4)](6/5)](8/7]...(k+1)/k]..., k>0 (mod 6), where [x] = floor of x; this infinite nested floor product will eventually level-off at a(n).

A099072 First differences of A000960, divided by 2.

Original entry on oeis.org

1, 2, 3, 3, 4, 6, 5, 7, 8, 6, 9, 12, 7, 17, 13, 8, 15, 18, 9, 21, 19, 6, 30, 11, 24, 19, 23, 18, 30, 27, 22, 18, 42, 11, 30, 42, 9, 39, 36, 30, 19, 56, 6, 48, 57, 13, 44, 46, 17, 45, 69, 13, 41, 49, 56, 27, 85, 18, 30, 84, 26, 64, 26, 64, 47, 54, 45, 94, 17, 36, 85, 60, 23, 79, 98
Offset: 1

Views

Author

N. J. A. Sloane, Nov 15 2004

Keywords

Crossrefs

Programs

  • Mathematica
    del[lst_, k_] := lst[[ Select[ Range[ Length[ lst]], Mod[ #, k] != 0 &]]]; For[ k = 2; s = Range[10000], k <= Length[s], k++, s = del[s, k]]; (Drop[s, 1] - Drop[s, -1])/2

Formula

a(n) = A073359(n+1) - A073359(n), (conjectured, n>1). - Bill McEachen, Dec 22 2024

Extensions

More terms from Robert G. Wilson v, Nov 15 2004
Showing 1-7 of 7 results.