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.

Previous Showing 11-20 of 24 results. Next

A048859 A sieve: keep the first 2 numbers, delete the next 3 numbers; keep the next 3 numbers, delete the next 4 numbers; keep the next 4 numbers, delete the next 5 numbers; and so on. In other words, keep the next k numbers and delete the next k+1 numbers, for k = 2, 3, ...

Original entry on oeis.org

1, 2, 6, 7, 8, 13, 14, 15, 16, 22, 23, 24, 25, 26, 33, 34, 35, 36, 37, 38, 46, 47, 48, 49, 50, 51, 52, 61, 62, 63, 64, 65, 66, 67, 68, 78, 79, 80, 81, 82, 83, 84, 85, 86, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128
Offset: 1

Views

Author

Charles T. Le (charlestle(AT)yahoo.com)

Keywords

Examples

			List the natural numbers: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, ...
Keep the first two numbers 1, 2 and delete the next three numbers 3, 4, 5.
Keep the next three numbers 6, 7, 8 and delete the next four numbers 9, 10, 11, 12. And so on.
		

References

  • C. Dumitrescu & V. Seleacu, editors, Some Notions and Questions in Number Theory, Vol. I, Erhus Publ., Glendale, 1994.
  • M. Le, On the Smarandache n-ary Sieve, Smarandache Notions Journal, Vol. 10, No. 1-2-3, 1999, 146-147.
  • F. Smarandache, Properties of Numbers, 1972.

Crossrefs

Programs

  • Haskell
    a048859 n = a048859_list !! (n-1)
    a048859_list = f 2 [1..] where
       f k xs = us ++ f (k + 1) (drop (k + 1) vs)
                where (us, vs) = splitAt k xs
    -- Reinhard Zumkeller, May 16 2014
  • Mathematica
    ss[n_]:=Module[{c=n^2+4n+1},Range[c,c+n+1]]; Flatten[Array[ss,10,0]] (* Harvey P. Dale, Sep 10 2014 *)

Extensions

Corrected and revised by the author, Mar 24 2004
More terms from Bernardo Boncompagni Jul 27 2004
Offset changed by Reinhard Zumkeller, May 16 2014

A073047 Least k such that x(k)=0 where x(1)=n and x(k)=k*floor(x(k-1)/k).

Original entry on oeis.org

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

Views

Author

Benoit Cloitre, Aug 31 2002; revised May 03 2003

Keywords

Comments

Length of n-th run of consecutive identical terms is given by A028913 - Ralf Stephan.

Examples

			If x(1)=4, x(2)= 2*floor(4/2)=4, x(3)=3*floor(4/3)=3; x(4)=4*floor(3/4)=0 hence a(4)=4.
		

Crossrefs

Programs

  • Maple
    f:= proc(n,k) option remember;
      if n = 0 then return k-1 fi;
      procname(k*floor(n/k),k+1)
    end proc:
    map(f, [$1..100], 1); # Robert Israel, Jul 25 2019
  • Mathematica
    a[n_] := Module[{x}, x[1] = n; x[k_] := x[k] = k Floor[x[k-1]/k]; For[k = 1, True, k++, If[x[k] == 0, Return[k]]]];
    Array[a, 100] (* Jean-François Alcover, Jun 07 2020 *)
  • PARI
    a(n)=if(n<0,0,s=n; c=1; while(s-s%c>0,s=s-s%c; c++); c)

Formula

Presumably a(n) = sqrt(Pi*n)+O(1).

A108696 Generated by a sieve: see comments.

Original entry on oeis.org

1, 2, 3, 5, 7, 11, 13, 19, 23, 31, 35, 43, 49, 59, 61, 79, 83, 103, 109, 119, 133, 151, 155, 175, 193, 211, 215, 241, 259, 275, 283, 323, 331, 361, 373, 403, 419, 443, 455, 499, 511, 541, 571, 613, 623, 649, 673, 719, 733, 781, 803, 841, 871, 919
Offset: 1

Views

Author

David Applegate, Oct 11 2007

Keywords

Comments

Start with the natural numbers:
1 2 3 4 5 6 7 8 9 10 11 ...
Accept the 2nd number, 2 and erase every 2nd number after it, giving:
1 2 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 ...
Accept the 3rd number, 3 and erase every 3rd number after it, giving:
1 2 3 5 7 11 13 17 19 23 25 29 31 35 ...
Accept the 4th number, 5 and erase every 4th number after it, giving:
1 2 3 5 7 11 13 19 23 25 31 35 ...
Repeat!

Crossrefs

Equals A007952 + 2 or equally A002491(n) + 1.

Programs

  • Haskell
    a108696 n = a108696_list !! (n-1)
    a108696_list = 1 : sieve' 2 [2..] where
       sieve' n (x:xs) = x : (sieve' (n+1) $ sieving xs) where
          sieving xs = (take (n-1) xs) ++ (sieving $ drop n xs)
    -- Reinhard Zumkeller, Jul 04 2011
  • Tcl
    source /tclutils/utils.tcl
    set l [range 0 10000]; set z z
    for {set i 2} {$i*2 <= [llength $l]} {incr i} {
    set k [expr {[llength $l]-1}]
    set k [expr {$k - ($k % $i)}]
    while {$k > $i} {
    set l [lreplace $l $k $k]
    incr k -$i
    }
    puts "after $i: length [llength $l], prefix [join [lrange $l 0 10] { }]"
    }
    

A140060 Array of quotients.

Original entry on oeis.org

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

Views

Author

Clark Kimberling, May 03 2008

Keywords

Comments

1. k divides Q(n,k) for each k.
2. The numbers in row n are distinct if and only if n is a term of the Sieve of Tchoukaillon (or Mancala, or Kalahari), A007952.

Examples

			First 8 rows:
1
2 2
3 2
4 4 3
5 4 3
6 6 6 4
7 6 6 4
8 8 6 4
For row 5: Q(5,1)=5, Q(5,2)=2*[5/2]=4, Q(5,3)=3*[4/3]=3.
		

Crossrefs

Cf. A140061.

Formula

For n>=1, for k=1,2,...,A082447(n), Q(n,1)=n, Q(n,k)=k*Floor(Q(n,k-1)/k).

A204539 a(n) is the number of integers N=4k whose "basin" sequence (cf. comment) ends in n^2.

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 4, 2, 4, 3, 5, 1, 9, 2, 10, 3, 5, 7, 9, 2, 10, 9, 9, 2, 13, 9, 8, 4, 20, 4, 15, 6, 15, 8, 12, 6, 22, 6, 15, 15, 21, 5, 13, 12, 23, 7, 24, 11, 19, 15, 24, 6, 30, 6, 26, 7, 27, 26, 13, 6, 33, 27, 30, 5, 13, 30, 30, 5, 37, 15, 26, 28, 32, 7, 17, 25, 54, 9, 30, 21, 41, 25
Offset: 2

Views

Author

Colm Fagan, Jan 16 2012

Keywords

Comments

The "basin" (analogous to river basins, for reasons set out below) is the number of positive integers N=4k which end in the "sea" at n^2. The "sea" of N is found as follows:
Starting out with N, in step i=1,2,3,..., stop if you have reached N=(i+1)^2 (the "sea" of N), otherwise set N to the next higher, odd or even (according to the parity of i), multiple of i+2, and go to step i+1.
Partial sums of this sequence appear to be A104738 (with a shift in offset). This has been confirmed for at least the first 4000 terms, but it is not at all clear why this is the case. - Ray Chandler, Jan 20 2012
After the first term, this sequence agrees with A028914 except for offset. Therefore this sequence is related to A028913, A007952, A002491 and A108696 dealing with the sieve of Tchoukaillon (or Mancala, or Kalahari). - Ray Chandler, Jan 20 2012

Examples

			For integers N=4,8,12,16,... we have the following sequences:
  {4}
  {8, 9}   (8 -> the next higher odd multiple of 3, which is 9 -> STOP)
  {12, 15, 16}  (12 -> 3*5=15 -> 4*4=16 -> STOP)
  {16, 21, 24, 25}
  {20, 21, 24, 25}
  {24, 27, 32, 35, 36}
  {28, 33, 40, 45, 48, 49}
  {32, 33, 40, 45, 48, 49}
  {36, 39, 40, 45, 48, 49}
  ...
Thus there is 1 integer N=4k ending in the sea at 2^2, whence basin a(2)=1, and idem for 3 and 4.
The two integers 16 and 20 end at 5^2, so the basin of 5 is a(5)=2.
There is again a(6)=1 integer ending in 6^2, while the basin of 7 are the 3 integers 28, 32, and 36, which all merge into the "river" that enters the "sea" in 7^2=49.
Thus the first 6 terms in the sequence are 1, 1, 1, 2, 1, 3.
Take N=100 as an example: the next integer on the same line is the next higher odd multiple of 3, i.e., smallest 3*(2m+1) > 100, which is 105. The next number is the least even multiple of 4, 4*(2m) = 112, etc., leading to 115 = 5*(2m+1), followed by 120 = 6*(2m), 133 = 7*(2m+1), 144 = 8*2m (where we have a square, but not the square of 8), 153 =9*(2m+1), 160 = 10*2m, 165 = 11*(2m+1), 168 = 12*(2m) and finally 169 = 13*13.
		

Crossrefs

Essentially the same as A028914.

Programs

  • Mathematica
    cumul[n_Integer] := Module[{den1 = n, num = n^2, den2}, While[num > 4 && den1 != 2, num = num - 1; den1 = den1 - 1; den2 = Floor[num/den1]; If[Not[EvenQ[den1 + den2]], den2 = den2 - 1]; num = den1 den2]; Return[num/4]]; basin[2] := 1; basin[n_Integer] := cumul[n] - cumul[n - 1]; Table[basin[n], {n, 2, 75}] (* Alonso del Arte, Jan 19 2012 *)
  • PARI
    bs(n,s,m=2)={while(n>m^2,n=(n\m+++2-bittest(n\m-m,0))*m; s & print1(n","));n}
    n=4; for(c=2,50, for(k=1,9e9, bs(n+=4)==c^2 || print1(k",")||break)) \\ M. F. Hasler, Jan 20 2012

A140061 Triangle of quotients.

Original entry on oeis.org

1, 3, 2, 5, 4, 3, 9, 8, 6, 4, 11, 10, 9, 8, 5, 17, 16, 15, 12, 10, 6, 21, 20, 18, 16, 15, 12, 7, 29, 28, 27, 24, 20, 18, 14, 8, 33, 32, 30, 28, 25, 24, 21, 16, 9, 41, 40, 39, 36, 35, 30, 28, 24, 18, 10, 47, 46, 45, 44, 40, 36, 35, 32, 27, 20, 11, 57, 56, 54, 52, 50, 48, 42, 40, 36
Offset: 1

Views

Author

Clark Kimberling, May 03 2008

Keywords

Comments

Column 1 is essentially A007952. - Clark Kimberling, Aug 27 2008

Examples

			First 6 rows:
1
3 2
5 4 3
9 8 6 4
11 10 9 8 5
17 16 15 12 10 6
		

Crossrefs

Cf. A140060.
Cf. A007952.

Programs

  • Mathematica
    Flatten@Table[Reverse@FoldList[#2*Floor[#1/#2+1]&,i,Reverse@Range[i-1]],{i,10}] (* Birkas Gyorgy, Feb 26 2011 *)

Formula

The triangular subarray of A140060 consisting of rows whose terms are distinct. If n is the first term in a row (i.e., if n is a term of A082447), then Q(n,1)=n, Q(n,k)=k*Floor(Q(n,k-1)/k).

A357431 Triangle read by rows where each term in row n is the next greater multiple of n..1.

Original entry on oeis.org

1, 2, 3, 3, 4, 5, 4, 6, 8, 9, 5, 8, 9, 10, 11, 6, 10, 12, 15, 16, 17, 7, 12, 15, 16, 18, 20, 21, 8, 14, 18, 20, 24, 27, 28, 29, 9, 16, 21, 24, 25, 28, 30, 32, 33, 10, 18, 24, 28, 30, 35, 36, 39, 40, 41, 11, 20, 27, 32, 35, 36, 40, 44, 45, 46, 47
Offset: 1

Views

Author

Tamas Sandor Nagy, Sep 28 2022

Keywords

Comments

Row n has length n and columns are numbered k = 1..n.
Row n begins with n which is trivially divisible by n. This is followed by the least number greater than n that is divisible by n-1. Next comes the least number that is greater than this preceding one and is divisible by n-2. Then it continues the same way until the last one is reached, which is trivially divisible by 1.
The end-most terms of the rows are A007952.

Examples

			Triangle begins:
  n/k|  1   2   3   4   5   6   7
  --------------------------------
  1  |  1;
  2  |  2,  3;
  3  |  3,  4,  5;
  4  |  4,  6,  8,  9;
  5  |  5,  8,  9, 10, 11;
  6  |  6, 10, 12, 15, 16, 17;
  7  |  7, 12, 15, 16, 18, 20, 21;
  ...
For row n=6, the numbers of the chain, and below them their divisors are:
  6 10 12 15 16 17
  6  5  4  3  2  1
		

Crossrefs

Cf. A357417 (row sums), A357498, A007952 (right diagonal).

Programs

  • Mathematica
    row[n_] := Module[{k = n, s = Table[0, n], r}, s[[1]] = n;Do[k++; k += If[(r = Mod[k, i]) == 0, 0, i - Mod[k, i]]; s[[n+1-i]] = k, {i, n - 1, 1, -1}]; s]; Array[row, 11] // Flatten (* Amiram Eldar, Sep 28 2022 *)
  • PARI
    row(n) = my(v=vector(n)); v[1] = n; for (k=2, n, v[k] = v[k-1] + (n-k+1) - (v[k-1] % (n-k+1));); v; \\ Michel Marcus, Nov 16 2022

Formula

T(n,1) = n.
T(n,k) = T(n,k-1) + (n-k+1) - (T(n,k-1) mod (n-k+1)), for k >= 2.
T(n,n) = A007952(n).

A357498 Triangle read by rows where each term in row n is the next greater multiple of n..1 divided by n..1.

Original entry on oeis.org

1, 1, 3, 1, 2, 5, 1, 2, 4, 9, 1, 2, 3, 5, 11, 1, 2, 3, 5, 8, 17, 1, 2, 3, 4, 6, 10, 21, 1, 2, 3, 4, 6, 9, 14, 29, 1, 2, 3, 4, 5, 7, 10, 16, 33, 1, 2, 3, 4, 5, 7, 9, 13, 20, 41, 1, 2, 3, 4, 5, 6, 8, 11, 15, 23, 47, 1, 2, 3, 4, 5, 6, 8, 10, 13, 18, 28, 57
Offset: 1

Views

Author

Tamas Sandor Nagy, Oct 01 2022

Keywords

Comments

This triangle is related to A357431. Terms there are divisible by n..1 and here that division is performed, leaving the respective multiple of each.
Row n has length n and columns are numbered k = 1..n corresponding to multiples n..1.
Row n begins with n/n = 1. The end-most terms of the rows are A007952.

Examples

			Triangle begins:
  n/k|  1   2   3   4   5   6   7
  --------------------------------
  1  |  1;
  2  |  1,  3;
  3  |  1,  2,  5;
  4  |  1,  2,  4,  9;
  5  |  1,  2,  3,  5, 11;
  6  |  1,  2,  3,  5,  8, 17;
  7  |  1,  2,  3,  4,  6, 10, 21;
  ...
For row n=6, we have:
  A357431 row  6 10 12 15 16 17
  divided by   6  5  4  3  2  1
  results in   1  2  3  5  8 17
		

Crossrefs

Cf. A358435 (row sums), A357431, A007952 (right diagonal).

Programs

  • Mathematica
    row[n_] := Module[{k = n, s = Table[0, n], r}, s[[1]] = 1; Do[k++; k += If[(r = Mod[k, i]) == 0, 0, i - Mod[k, i]]; s[[n + 1 - i]] = k/i, {i, n - 1, 1, -1}]; s]; Array[row, 12] // Flatten (* Amiram Eldar, Oct 01 2022 *)
  • PARI
    row(n) = my(v=vector(n)); v[1] = n; for (k=2, n, v[k] = v[k-1] + (n-k+1) - (v[k-1] % (n-k+1));); vector(n, k, v[k]/(n-k+1)); \\ Michel Marcus, Nov 16 2022

Formula

T(n,k) = A357431(n,k) / (n-k+1).
T(n,1) = 1.
T(n,k) = (T(n,k-1)*(n-k+2) + (n-k+1) - (T(n,k-1)*(n-k+2)) mod (n-k+1))/(n-k+1), for k >= 2.
T(n,n) = A007952(n).

A386520 Column sums of the triangle in A386755.

Original entry on oeis.org

1, 5, 13, 13, 31, 35, 57, 61, 85, 85, 111, 99, 235, 89, 353, 173, 171, 341, 343, 229, 489, 423, 415, 435, 661, 525, 535, 559, 1161, 427, 931, 653, 1201, 787, 941, 885, 1629, 537, 1443, 1839, 1723, 931, 1119, 1525, 2415, 741, 2257, 2327, 1947, 2005, 2767, 1131, 3181, 1055, 3131, 2147
Offset: 1

Views

Author

Tamas Sandor Nagy, Jul 24 2025

Keywords

Comments

It appears that A007952(n) is the index of the row where n first appears.
It appears that A007952(n)-1 is the index of the row where the last nonzero term of the n-th column is seen. - Michel Marcus, Aug 02 2025

Examples

			Triangle whose columns are summed.
  m/n| 1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20
  ----------------------------------------------------------------
   1 | 1
   2 |    1
   3 |    2  1
   4 |    2     1
   5 |       3  2  1
   6 |       3  2     1
   7 |       3        2  1
   8 |       3        2     1
   9 |          4     3     2  1
  10 |          4     3     2     1
  11 |             5        4  3  2  1
  12 |             5        4  3  2     1
  13 |             5        4  3        2  1
  14 |             5        4  3        2     1
  15 |             5        4           3     2  1
  16 |             5        4           3     2     1
  17 |                6           5     4        3  2  1
  18 |                6           5     4        3  2     1
  19 |                6           5     4        3        2  1
  20 |                6           5     4        3        2     1
  ...
The completed column for n=5 is definitely fully visible here because in column 6 for n=6 the divisor k=6 already appeared. That means that column 5 cannot have more divisors in it under the last k=5 in row 17 because in that row only k=7 may follow k=6 in theory, but 7 does not divide 5. So, all similarly proven, definitely fully visible completed columns in this sample array are readily summable by sight. E.g. column 5: a(5) = 1 + 5 + 5 + 5 + 5 + 5 + 5 = 31.
		

Crossrefs

Cf. A386755.
Cf. A007952 (row number where k=n first appears).

Programs

  • PARI
    \\ uses row(n) from A386755
    a(n) = my(ok=1, k=1, last=-1, s=0, r); while(ok, r=row(k); if (#r >= n, s+=r[n]); k++; if (#r>=n, if ((last==n) && (r[n]==0), ok = 0, last = r[n]))); s; \\ Michel Marcus, Aug 02 2025
    
  • PARI
    \\ uses row(n) from A386755
    lista(nn) = my(ok=1, k=1, vlast=vector(nn,i,-1), vs=vector(nn)); while(ok, my(r=row(k)); for (i=1, nn, if (#r>=i, vs[i]+=r[i])); k++; my(nbok=0); for (i=1, nn, if (#r>=i, if ((vlast[i]==i) && (r[i]==0), nbok++, vlast[i] = r[i]))); if (nbok == nn, ok = 0);); vs; \\ Michel Marcus, Aug 02 2025

A141262 Mancala numbers that are prime numbers.

Original entry on oeis.org

3, 5, 11, 17, 29, 41, 47, 59, 101, 107, 131, 149, 173, 191, 239, 257, 281, 359, 401, 509, 569, 647, 839, 929, 1277, 1427, 1487, 1847, 1931, 2039, 2339, 2579, 2939, 4451, 4457, 4799, 4931, 5231, 5381, 5717, 5741, 6029, 6317, 6833, 7451, 7547, 7901, 9011, 9437
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 21 2008

Keywords

Comments

Intersection of A007952 and A000040.

Crossrefs

Programs

  • Mathematica
    f[n_] := Fold[#2*Floor[#1/#2 + 1] &, n, Reverse@ Range[n - 1]]; a007952=Array[f, 170] ;Select[a007952,PrimeQ] (* James C. McMahon, Jul 19 2025 *)
Previous Showing 11-20 of 24 results. Next