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

A299763 a(n) = 1 + A182986(n).

Original entry on oeis.org

1, 3, 4, 6, 8, 12, 14, 18, 20, 24, 30, 32, 38, 42, 44, 48, 54, 60, 62, 68, 72, 74, 80, 84, 90, 98, 102, 104, 108, 110, 114, 128, 132, 138, 140, 150, 152, 158, 164, 168, 174, 180, 182, 192, 194, 198, 200, 212, 224, 228, 230, 234, 240, 242, 252, 258, 264, 270, 272, 278, 282, 284
Offset: 1

Views

Author

Omar E. Pol, Mar 14 2018

Keywords

Comments

Are these the indices of the rows of A299762 where there is a record?

Crossrefs

First differences are in A054541.
Essentially the same as A008864, A028815, A055670, A135731, A175216.

Programs

Formula

a(n) = A028815(n-1) - [n=1].
a(n) = A008864(n-1) for n >= 2, with a(1) = 1.

A358683 a(n) is the sum of all divisors of all positive integers k where A182986(n) < k <= prime(n), n >= 1.

Original entry on oeis.org

4, 4, 13, 20, 58, 42, 97, 59, 134, 259, 104, 342, 248, 140, 282, 498, 542, 230, 623, 438, 269, 722, 517, 854, 1256, 646, 320, 672, 390, 730, 2767, 815, 1348, 428, 2361, 524, 1564, 1553, 1002, 1729, 1670, 728, 2980, 702, 1227, 668, 4125, 4172, 1477, 790, 1500, 2246, 986, 3859, 2601, 2470, 2630
Offset: 1

Views

Author

Omar E. Pol, Nov 26 2022

Keywords

Comments

a(n) has a symmetric representation as shown in the example.

Examples

			a(1) = sigma(1) + sigma(2) = 1 + 3 = 4.
a(2) = sigma(3) = 4.
a(3) = sigma(4) + sigma(5) = 7 + 6 = 13.
a(4) = sigma(6) + sigma(7) = 12 + 8 = 20.
a(5) = sigma(8) + sigma(9) + sigma(10) + sigma(11) = 15 + 13 + 18 + 12 = 58.
a(6) = sigma(12) + sigma(13) = 28 + 14 = 42.
...
a(40) = sigma(168) + sigma(169) + sigma(170) + sigma(171) + sigma(172) + sigma(173) = 480 + 183 + 324 + 260 + 308 + 174 = 1729.
Illustration of initial terms using the Dyck paths described in A237593:
.
.  n  prime(n)  a(n)            Diagram
.                      _ _ _ _ _ _ _ _ _ _ _ _ _
.                     |   | |   |   |       |   |
.  1     2       4    |_ _|_|   |   |       |   |
.  2     3       4    |_ _|  _ _|   |       |   |
.                     |     |    _ _|       |   |
.  3     5      13    |_ _ _|  _|           |   |
.                     |       |        _ _ _|   |
.  4     7      20    |_ _ _ _|      _|    _ _ _|
.                     |            _|     |
.                     |           |      _|
.                     |           |  _ _|
.  5    11      58    |_ _ _ _ _ _| |
.                     |             |
.  6    13      42    |_ _ _ _ _ _ _|
.
The diagram of a(40) = 1729 is too large to include.
		

Crossrefs

Programs

  • Mathematica
    {Total@ DivisorSigma[1, Range[2]]}~Join~Array[Total@ DivisorSigma[1, Range[Prime[# - 1] + 1, Prime[#]]] &, 56, 2] (* Michael De Vlieger, Nov 29 2022 *)
  • PARI
    A358683(n) = sum(k=if(1==n,1,1+prime(n-1)),prime(n),sigma(k)); \\ Antti Karttunen, Nov 29 2022

Formula

a(n) = Sum_{k=1+A182986(n)..A182986(n+1)} A000203(k), n >= 1.

A054541 Sum of first n terms equals n-th prime.

Original entry on oeis.org

2, 1, 2, 2, 4, 2, 4, 2, 4, 6, 2, 6, 4, 2, 4, 6, 6, 2, 6, 4, 2, 6, 4, 6, 8, 4, 2, 4, 2, 4, 14, 4, 6, 2, 10, 2, 6, 6, 4, 6, 6, 2, 10, 2, 4, 2, 12, 12, 4, 2, 4, 6, 2, 10, 6, 6, 6, 2, 6, 4, 2, 10, 14, 4, 2, 4, 14, 6, 10, 2, 4, 6, 8, 6, 6, 4, 6, 8, 4, 8, 10, 2, 10, 2, 6, 4, 6, 8, 4, 2, 4, 12, 8, 4, 8, 4, 6
Offset: 1

Views

Author

G. L. Honaker, Jr., Apr 09 2000

Keywords

Comments

Except for first term, same as A001223.
First differences of A182986. - Omar E. Pol, Oct 31 2013
A075526 is 1 together with A001223. This is 2 together with A001223. A125266 is 3 together with A001223. - Omar E. Pol, Nov 01 2013
Convolved with A024916 gives A086718. - Omar E. Pol, Dec 23 2021

Crossrefs

Partial sums give A000040.

Programs

  • Mathematica
    Join[{2},Differences[Prime[Range[100]]]] (* Paolo Xausa, Oct 25 2023 *)
  • PARI
    a(n) = if (n==1, 2, prime(n) - prime(n-1)); \\ Michel Marcus, Oct 31 2013

Extensions

More terms from James Sellers, Apr 11 2000

A331888 Number of compositions (ordered partitions) of n into parts having a common factor > 1 with n.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 5, 1, 8, 4, 17, 1, 60, 1, 65, 19, 128, 1, 800, 1, 683, 67, 1025, 1, 11005, 16, 4097, 256, 9203, 1, 369426, 1, 32768, 1027, 65537, 79, 2124475, 1, 262145, 4099, 1424118, 1, 48987720, 1, 2127107, 96334, 4194305, 1, 411836297, 64, 67919981, 65539
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 30 2020

Keywords

Examples

			a(9) = 4 because we have [9], [6, 3], [3, 6] and [3, 3, 3].
		

Crossrefs

Cf. A182986 (positions of 1's), A100347, A121998, A178472, A331885, A331887.

Programs

  • Maple
    a:= proc(m) option remember; local b; b:=
          proc(n) option remember; `if`(n=0, 1,
            add(`if`(igcd(j, m)>1, b(n-j), 0), j=1..n))
          end; forget(b); b(m$2)
        end:
    seq(a(n), n=0..82);  # Alois P. Heinz, Jan 30 2020
  • Mathematica
    Table[SeriesCoefficient[1/(1 - Sum[Boole[GCD[k, n] > 1] x^k, {k, 1, n}]), {x, 0, n}], {n, 0, 51}]

Formula

a(n) = [x^n] 1 / (1 - Sum_{k: gcd(n,k) > 1} x^k).

A230850 A054541 and A000012 interleaved.

Original entry on oeis.org

2, 1, 1, 1, 2, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 6, 1, 2, 1, 6, 1, 4, 1, 2, 1, 4, 1, 6, 1, 6, 1, 2, 1, 6, 1, 4, 1, 2, 1, 6, 1, 4, 1, 6, 1, 8, 1, 4, 1, 2, 1, 4, 1, 2, 1, 4, 1, 14, 1, 4, 1, 6, 1, 2, 1, 10, 1, 2, 1, 6, 1, 6, 1, 4, 1, 6, 1, 6, 1, 2, 1, 10, 1, 2, 1
Offset: 1

Views

Author

Omar E. Pol, Oct 31 2013

Keywords

Comments

a(n) is also the length of the n-th edge of a staircase which represents the function pi(x) on the first quadrant of the square grid, see A000720.
a(2n-1) is the length of the n-th horizontal edge in the staircase.
a(2n) is the length of the n-th vertical edge in the staircase.
For another version see A230849.

Examples

			Illustration of initial terms, n = 1..22:
.
1                                                              _ _|
1                                                  _ _ _ _ _ _|
1                                          _ _ _ _|
1                                      _ _|
1                              _ _ _ _|
1                          _ _|
1                  _ _ _ _|
1              _ _|
1          _ _|
1        _|
1    _ _|
.
.      2 1   2   2       4   2       4   2       4           6   2
.
Drawing vertical line segments below the staircase (as shown below) we have that the number of cells in the vertical bars gives 0 together A000720.
Drawing horizontal line segments above the staircase we have that the number of cells in the k-th horizontal bar is A000040(k).
.    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
31  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
29  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
23  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | |
19  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | |
17  |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | |
13  |_ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | |
11  |_ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | |
7   |_ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | |
5   |_ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | |
3   |_ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | | | |
2   |_ _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
.
.    0 0 1 2 2 3 3 4 4 4 4 5 5 6 6 6 6 7 7 8 8 8 8 9 9 9 9 9 9 10 10
.
		

Crossrefs

Programs

  • Mathematica
    Riffle[Join[{2},Differences[Prime[Range[100]]]],1] (* Paolo Xausa, Oct 31 2023 *)
  • PARI
    A230850(n) = if(1==n,2,if((n%2),prime((n+1)/2)-prime(((n+1)/2)-1),1)); \\ Antti Karttunen, Dec 23 2018

Formula

a(1) = 2; for n > 1, a(n) = A230849(n). - Antti Karttunen, Dec 23 2018

A322366 Number of integers k in {0,1,...,n} such that k identical test tubes can be balanced in a centrifuge with n equally spaced holes.

Original entry on oeis.org

1, 0, 2, 2, 3, 2, 5, 2, 5, 4, 7, 2, 11, 2, 9, 8, 9, 2, 17, 2, 17, 10, 13, 2, 23, 6, 15, 10, 23, 2, 29, 2, 17, 14, 19, 12, 35, 2, 21, 16, 37, 2, 41, 2, 35, 38, 25, 2, 47, 8, 47, 20, 41, 2, 53, 16, 51, 22, 31, 2, 59, 2, 33, 52, 33, 18, 65, 2, 53, 26, 67, 2, 71, 2, 39, 68, 59, 18, 77, 2, 77, 28, 43, 2, 83, 22, 45, 32, 79
Offset: 0

Views

Author

Alois P. Heinz, Dec 04 2018

Keywords

Comments

Numbers where a(n) + A000010(n) != n + 1: A102467. - Robert G. Wilson v, Aug 23 2021

Examples

			a(6) = |{0,2,3,4,6}| = 5.
a(9) = |{0,3,6,9}| = 4.
a(10) = |{0,2,4,5,6,8,10}| = 7.
		

Crossrefs

Programs

  • Maple
    a:= proc(n) option remember; local f, b; f, b:=
           map(i-> i[1], ifactors(n)[2]),
           proc(m, i) option remember; m=0 or i>0 and
            (b(m, i-1) or f[i]<=m and b(m-f[i], i))
           end; forget(b); (t-> add(
          `if`(b(j, t) and b(n-j, t), 1, 0), j=0..n))(nops(f))
        end:
    seq(a(n), n=0..100);
  • Mathematica
    $RecursionLimit = 4096;
    a[1] = 0;
    a[n_] := a[n] = Module[{f, b}, f = FactorInteger[n][[All, 1]];
         b[m_, i_] := b[m, i] = m == 0 || i > 0 &&
         (b[m, i - 1] || f[[i]] <= m && b[m - f[[i]], i]);
         With[{t = Length[f]}, Sum[
         If[b[j, t] && b[n - j, t], 1, 0], {j, 0, n}]]];
    Table[a[n], {n, 0, 1000}] (* Jean-François Alcover, Dec 13 2018, after Alois P. Heinz, corrected and updated Aug 07 2021 *)
    f[n_] := Block[{c = 2, k = 2, p = First@# & /@ FactorInteger@ n}, While[k < n, If[ IntegerPartitions[k, All, p, 1] != {} && IntegerPartitions[n - k, All, p, 1] != {}, c++]; k++]; c]; f[0] = 1; f[1] = 0; Array[f, 75] (* Robert G. Wilson v, Aug 22 2021 *)

Formula

a(n) = |{ k : k and n-k can be written as a sum of prime factors of n }|.
a(n) = 2 <=> n is prime (A000040).
a(n) >= n-1 <=> n in {1,2,3,4} union { A008588 }.
a(n) = (n+4)/2 <=> n in { A100484 } minus { 4 }.
a(n) = (n+9)/3 <=> n in { A001748 } minus { 9 }.
a(n) = (n+25)/5 <=> n in { A001750 } minus { 25 }.
a(n) = (n+49)/7 <=> n in { A272470 } minus { 49 }.
a(n^2) = n+1 <=> n = 0 or n is prime <=> n in { A182986 }.
a(A001248(n)) = A008864(n).
a(n) is odd <=> n in { A163300 }.
a(n) is even <=> n in { A004280 }.

A331885 Number of partitions of n into parts having a common factor > 1 with n.

Original entry on oeis.org

1, 0, 1, 1, 2, 1, 4, 1, 5, 3, 8, 1, 16, 1, 16, 9, 22, 1, 51, 1, 51, 17, 57, 1, 147, 7, 102, 30, 152, 1, 620, 1, 231, 58, 298, 21, 946, 1, 491, 103, 921, 1, 3249, 1, 1060, 325, 1256, 1, 4866, 15, 3157, 299, 2539, 1, 10369, 62, 4846, 492, 4566, 1, 45786, 1, 6843
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 30 2020

Keywords

Examples

			a(6) = 4 because we have [6], [4, 2], [3, 3] and [2, 2, 2].
		

Crossrefs

Cf. A182986 (positions of 1's), A018783, A057562, A121998, A331887, A331888.

Programs

  • Maple
    a:= proc(m) option remember; local b; b:=
          proc(n, i) option remember; `if`(n=0, 1, `if`(i<2, 0,
           `if`(igcd(i, m)>1, b(n-i, min(i, n-i)), 0)+b(n, i-1)))
          end; forget(b); b(m$2)
        end:
    seq(a(n), n=0..82);  # Alois P. Heinz, Jan 30 2020
  • Mathematica
    Table[SeriesCoefficient[Product[1/(1 - Boole[GCD[k, n] > 1] x^k), {k, 1, n}], {x, 0, n}], {n, 0, 62}]

Formula

a(n) = [x^n] Product_{k: gcd(n,k) > 1} 1 / (1 - x^k).

A230980 Number of primes <= n, starting at n=0.

Original entry on oeis.org

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

Views

Author

Omar E. Pol, Nov 02 2013

Keywords

Comments

Essentially identical to A000720, except that sequence, being an arithmetical sequence, starts at n = 1. - N. J. A. Sloane, Jun 21 2017
Also, on the first quadrant of the square grid, consider a diagram in which the number of cells in the horizontal bar of the k-th row is equal to the k-th prime, see example. The total length of the boundary segments between the structure formed by the first k horizontal bars and the structure formed by the vertical bars, from [0, 0], is equal to A014688(k). a(n) is the number of cells in the vertical bar of the n-th column.
Note that in a similar diagram for A000720 the lengths of the horizontal bars give A006093 (primes minus 1) not A000040 (the prime numbers) because A000720 has only one zero, not two.
Also, the number of distinct prime factors of the factorial number n!. - Torlach Rush, Jan 17 2014
The lengths of the boundary horizontal segments between the structure formed by the horizontal bars and the structure formed by the vertical bars of the diagram gives A054541. The zig-zag path formed by the boundary segments is in A230850. - Omar E. Pol, Jun 22 2017

Examples

			Illustration of initial terms:
.     _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
31   |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _|
29   |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | |
23   |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | |
19   |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | |
17   |_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | |
13   |_ _ _ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | |
11   |_ _ _ _ _ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | |
7    |_ _ _ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | |
5    |_ _ _ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | |
3    |_ _ _| | | | | | | | | | | | | | | | | | | | | | | | | | | | |
2    |_ _|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|_|
.
n:    0 1 2 3 4 5 6 7 8 9...
a(n): 0 0 1 2 2 3 3 4 4 4 4 5 5 6 6 6 6 7 7 8 8 8 8 9 9 9 9 9 9 10 10
		

Crossrefs

Programs

Extensions

Offset and definition changed by N. J. A. Sloane, Jun 21 2017

A333471 a(n) = 2 * mu(n) + Sum_{d|n, d > 1} mu(n/d) * (prime(d) - prime(d-1)).

Original entry on oeis.org

2, -1, 0, 1, 2, 1, 2, 0, 2, 3, 0, 3, 2, -1, 0, 4, 4, -2, 4, -3, -2, 5, 2, 0, 4, 1, -2, 1, 0, -3, 12, -2, 4, -3, 4, -4, 4, 1, 0, 2, 4, 1, 8, -5, -2, -1, 10, 2, 0, -8, -2, 1, 0, 10, 2, 2, 0, 1, 4, -1, 0, -3, 10, 0, -4, -7, 12, 3, 6, -9, 2, 4, 6, 1, -2, -3, 2, 3, 2, -2
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 23 2020

Keywords

Comments

Moebius transform of A054541 (2 followed by prime gaps).

Crossrefs

Programs

  • Mathematica
    a[n_] := 2 MoebiusMu[n] + Sum[If[d > 1, MoebiusMu[n/d] (Prime[d] - Prime[d - 1]), 0], {d, Divisors[n]}]; Table[a[n], {n, 1, 80}]

Formula

a(n) = Sum_{d|n} mu(n/d) * A054541(d).
Sum_{k=1..n} floor(n/k) * a(k) = prime(n).
Showing 1-9 of 9 results.