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: Jamie Morken

Jamie Morken's wiki page.

Jamie Morken has authored 22 sequences. Here are the ten most recent ones:

A343496 First point of the straight lines in A340649.

Original entry on oeis.org

5, 31, 194, 1061, 6456, 40080, 251721, 1617206, 10553419, 69709769, 465769825
Offset: 1

Author

Simon Strandgaard and Jamie Morken, Apr 17 2021

Keywords

Comments

prime(a(n)+1) - prime(a(n)) = n*2. E.g., for n=4: prime(a(4)+1) - prime(a(4)) = 4*2, prime(1062) - prime(1061) = 4*2, 8521 - 8513 = 8.

Examples

			For n=1, consider k's with prime gap 1*2 = 2, i.e., k's such that A001223(k)=2. k=5 is the first place where A001223(k)=2 and A141042(k)=A340649(k), so a(1)=5.
For n=2, consider k's with prime gap 2*2 = 4, i.e., k's such that A001223(k)=4. k=31 is the first place where A001223(k)=4 and A141042(k)=A340649(k), so a(2)=31.
For n=3, consider k's with prime gap 3*2 = 6, i.e., k's such that A001223(k)=6. k=194 is the first place where A001223(k)=6 and A141042(k)=A340649(k), so a(3)=194.
		

Programs

  • Ruby
    n = 1
    last_prime = 2
    find_gap = 2
    result = []
    Prime.each(10_000) do |prime|
        next if prime == 2
        gap = prime - last_prime
        if gap == find_gap
            value = (n * prime) % last_prime
            if value == n * gap
                result << n
                find_gap += 2
            end
        end
        n += 1
        last_prime = prime
    end
    p result

Formula

a(n) = smallest k that satisfies A001223(k) = 2*n and A340649(k) = A141042(k).

A335334 Sum of the integers in the reduced residue system of A002110(n).

Original entry on oeis.org

1, 6, 120, 5040, 554400, 86486400, 23524300800, 8045310873600, 4070927302041600, 3305592969257779200, 3074201461409734656000, 4094836346597766561792000, 6715531608420337161338880000, 12128250084807128913378017280000
Offset: 1

Author

Jamie Morken, Jun 02 2020

Keywords

Comments

Sum of the integers up to A002110(n) and coprime to A002110(n).
The sequence gives the sum of row n of A286941(n).

Examples

			For n = 3: A002110(3) = 30, the reduced residue system of 30 is {1, 7, 11, 13, 17, 19, 23, 29}. The sum is a(3) = 120.
		

Programs

  • Mathematica
    n = 15;
    A002110 = Drop[FoldList[Times, 1, Prime[Range[n]]], 1];
    A005867 = Drop[EulerPhi@FoldList[Times, 1, Prime@Range@n], 1];
    A002110*A005867/2
    (* Second program: *)
    Map[# EulerPhi[#]/2 &, FoldList[Times, Prime@ Range@ 14]] (* Michael De Vlieger, Apr 07 2021 *)
  • PARI
    a(n) = my(P=factorback(primes(n))); P*eulerphi(P)/2; \\ Michel Marcus, Jun 02 2020

Formula

a(n) = A023896(A002110(n)).
a(n) = A002110(n)*A005867(n)/2 = A070826(n)*A005867(n).
a(n) = (A002110(n)*A038110(n+1)/2)*A058250(n).

A335261 Irregular triangle S(n,k) = denominators of k*A002110(n)/A005867(n) for 1 <= k <= A005867(n).

Original entry on oeis.org

1, 1, 1, 1, 4, 2, 4, 1, 4, 2, 4, 1, 8, 4, 8, 2, 8, 4, 8, 1, 8, 4, 8, 2, 8, 4, 8, 1, 8, 4, 8, 2, 8, 4, 8, 1, 8, 4, 8, 2, 8, 4, 8, 1, 8, 4, 8, 2, 8, 4, 8, 1, 8, 4, 8, 2, 8, 4, 8, 1, 16, 8, 16, 4, 16, 8, 16, 2, 16, 8, 16, 4, 16, 8, 16, 1, 16, 8, 16, 4, 16, 8, 16
Offset: 1

Author

Keywords

Comments

Alternatively, denominators of k*A060753(n)/A038110(n) for 1 <= k <= A005867(n).
Let m = A038110(n). For row n, the primitive denominators d | m.
The mean of row n is related to the mean of row n of A309497: A060753(n+1)/(A038110(n+1)*2) = Mean(A309497(n))/A038110(n+1).

Examples

			Table begins:
    1;
    1;
    1, 1;
    4, 2, 4, 1, 4, 2, 4, 1;
    8, 4, 8, 2, 8, 4, 8, 1, ..., 8, 1;
    ...
Row n = 4 contains the denominators of (35/8)*k for 1 <= k <= A005867(4): 35/8, 35/4, 105/8, 35/2, 175/8, 105/4, 245/8, 35, 315/8, 175/4, 385/8, 105/2, 455/8, 245/4, 525/8, 70, 595/8, 315/4, 665/8, 175/2, 735/8, 385/4, 805/8, 105, 875/8, 455/4, 945/8, 245/2, 1015/8, 525/4, 1085/8, 140, 1155/8, 595/4, 1225/8, 315/2, 1295/8, 665/4, 1365/8, 175, 1435/8, 735/4, 1505/8, 385/2, 1575/8, 805/4, 1645/8, 210.
The mean of row 4: (A060753(4+1)/(A038110(4+1)*2))*(A005867(4)+1) = (35/(8*2))*(48+1) = (35/16)*49 = 1715/16.
		

Programs

  • Mathematica
    Table[Denominator[P Range[EulerPhi[P]]/EulerPhi[P]], {P, FoldList[Times, Prime@ Range@ 5]}] (* or, more efficiently for larger datasets: *)
    Flatten@ Block[{nn = 7, s, t}, s = Array[Numerator@ Product[1 - 1/Prime[k], {k, # - 1}] &, nn]; t = Nest[Append[#, #[[-1]] (Prime[Length@ #] - 1)]&, {1}, nn]; MapIndexed[Function[{m, D, i}, PadRight[{}, t[[i]], ReplacePart[ConstantArray[0, m], Flatten@ Map[Function[d, Map[# -> d &, m/d Select[Range[d], GCD[#, d] == 1 &]]], D]]]] @@ {#1, Divisors@ #1, First[#2]} &, s]]
    (* or, to generate a single denominator of T(n,k) *)
    f[n_, k_] := #/GCD[#, Mod[k, #]] &@ Numerator@ Product[1 - 1/Prime[i], {i, n - 1}]

Formula

T(n,k) = m/GCD(k (mod m), m) with m = A038110(n).
Row lengths: A005867(n).

A335260 Irregular triangle S(n,k) = numerators of k*A002110(n)/A005867(n) for 1 <= k <= A005867(n).

Original entry on oeis.org

1, 2, 3, 6, 15, 15, 45, 15, 75, 45, 105, 30, 35, 35, 105, 35, 175, 105, 245, 35, 315, 175, 385, 105, 455, 245, 525, 70, 595, 315, 665, 175, 735, 385, 805, 105, 875, 455, 945, 245, 1015, 525, 1085, 140, 1155, 595, 1225, 315, 1295, 665, 1365, 175, 1435, 735, 1505
Offset: 1

Author

Keywords

Comments

Alternatively, numerators of k*A060753(n)/A038110(n) for 1 <= k <= A005867(n).

Examples

			Table begins:
     1;
     2;
     3, 6;
    15, 15, 45, 15, 75, 45, 105, 30;
    ...
Row n = 4 contains the numerators of (35/8)*k for 1 <= k <= A005867(4): 35/8, 35/4, 105/8, 35/2, 175/8, 105/4, 245/8, 35, 315/8, 175/4, 385/8, 105/2, 455/8, 245/4, 525/8, 70, 595/8, 315/4, 665/8, 175/2, 735/8, 385/4, 805/8, 105, 875/8, 455/4, 945/8, 245/2, 1015/8, 525/4, 1085/8, 140, 1155/8, 595/4, 1225/8, 315/2, 1295/8, 665/4, 1365/8, 175, 1435/8, 735/4, 1505/8, 385/2, 1575/8, 805/4, 1645/8, 210.
		

Programs

  • Mathematica
    Table[Numerator[P Range[EulerPhi[P]]/EulerPhi[P]], {P, FoldList[Times, Prime@ Range@ 5]}] (* or, more efficiently for larger datasets: *)
    Flatten@ Block[{nn = 7, s, t}, s = Array[Numerator@ Product[1 - 1/Prime[k], {k, # - 1}] &, nn]; t = Nest[Append[#, #[[-1]] (Prime[Length@ #] - 1)]&, {1}, nn]; u = Denominator@ Nest[Append[#, #[[-1]] + (1 - #[[-1]])/Prime[Length@ #]] &, {0}, nn]; MapIndexed[Function[{m, D, i},  u[[i]]*Range[t[[i]]]/ PadRight[{}, t[[i]], ReplacePart[ConstantArray[0, m], Flatten@ Map[Function[d, Map[# -> m/d &, m/d Select[Range[d], GCD[#, d] == 1 &]]], D]]]] @@ {#1, Divisors@ #1, First[#2]} &, s]]
    (* or, generate a single numerator of S(n,k): *)
    f[n_, k_] := #2 k/GCD[#1, Mod[k, #1]] & @@ {Numerator@ Product[1 - 1/Prime[i], {i, n - 1}], Denominator@ Last@ Nest[Append[#, #[[-1]] + (1 - #[[-1]])/Prime[Length@ #]] &, {0}, n - 1]}

Formula

S(n,k) = k*A060753(n)/GCD(k (mod m), m) for m = A038110(n).
Row lengths: A005867(n).
Least numerator in row n: A060753(n), all numerators are multiples j*A060753(n).

A329815 Number of distinct terms in the first difference sequence of the reduced residue system of the n-th primorial.

Original entry on oeis.org

0, 1, 3, 5, 7, 10, 13, 16, 20, 23, 29, 33, 37, 43, 49, 53, 59, 66, 75, 84, 92, 99, 108, 116, 127, 132, 140, 148, 156, 164, 174, 185, 193, 206, 215, 224, 235, 245, 255, 267, 275, 286, 297, 308
Offset: 1

Author

Jamie Morken, Nov 21 2019

Keywords

Comments

This sequence is the number of distinct terms in the first difference sequence for rows n in A286941 and A309497.
Number of distinct terms listed in row n of A331118. - Michael De Vlieger, Jul 11 2020

Examples

			For n = 3, A002110(3) = 30, RRS = {1, 7, 11, 13, 17, 19, 23, 29}, dRRS = {6, 4, 2, 4, 2, 4, 6}, so a(3) = 3.
		

Crossrefs

Programs

  • Mathematica
    Primorial[n_] := Times @@ Prime[Range[n]]; Table[Length@ Union@ Differences@ Select[Range@ Primorial[n], CoprimeQ[#, Primorial[n]] &], {n, 7}] (* after Michael De Vlieger Jul 15 2017 from A061498 *)
  • PARI
    f(n) = {my(va = select(x->(gcd(n, x)==1), [1..n])); vd = vector(#va-1, k, va[k+1] - va[k]); #Set(vd); } \\ A061498
    a(n) = f(prod(i=1, n, prime(i))); \\ Michel Marcus, Dec 19 2019

Formula

a(n) = A061498(A002110(n)).
a(n) <= A048670(n)/2.

Extensions

a(12)-a(44) from Jamie Morken, Jul 11 2020 (after Mario Ziller)

A309497 Irregular triangle read by rows: T(n,k) = A060753(n)*k-A038110(n)*A286941(n,k).

Original entry on oeis.org

0, 1, 2, 1, 11, 2, 1, 8, 7, 14, 13, 4, 27, -18, 1, 4, 23, 26, 13, 32, 19, 22, 41, 44, 31, 18, 37, 24, 27, 46, 33, 36, 23, -6, -3, 16, 19, 38, 41, 12, -1, 2, -11, 8, 11, -2, 17, 4, -9, -6, 13, 16, 3, 22, 9, 12, 31, 34, 53, 8
Offset: 0

Author

Jamie Morken, Aug 05 2019

Keywords

Comments

The sequence is Primorial rows of A308121.
Row n has length A005867(n).
Row n > 1 average value = A060753(n)/2.
Row n > 1 has sum = A002110(n-1)*A038110(n)/2.
First value on row(n) = A161527(n-1).
Last value on row(n) = A038110(n) for n > 2.
For n > 1, A060753(n) = Max(row) + Min(row).
For values x and y on row n > 1 at positions a and b on the row:
x + y = A060753(n), where a = A005867(n-1) - (b-1).
For n > 2 the penultimate value on row A002110(n) is given by
Related identity:
A038110(n)/A038111(n)*(Prime(n)^2) - (A038110(n)/A038111(n)*((A038110(n)*Prime(n) - A060753(n))*Prime(n)/A038110(n))) = 1.

Examples

			The triangle starts:
row1: 0;
row2: 1;
row3: 2, 1;
row4: 11, 2, 1, 8, 7, 14, 13, 4;
row5: 27, -18, 1, 4, 23, 26, 13, 32, 19, 22, 41, 44, 31, 18, 37, 24, 27, 46, 33, 36, 23, -6, -3, 16, 19, 38, 41, 12, -1, 2, -11, 8, 11, -2, 17, 4, -9, -6, 13, 16, 3, 22, 9, 12, 31, 34, 53, 8;
		

Programs

  • Mathematica
    row[0] = 0; row[n_] := -(v = Numerator[Product[1 - 1/Prime[i], {i, 1, n}] / Prime[n]] * Select[Range[(p = Product[Prime[i], {i, 1, n}])], CoprimeQ[p, #] &]) + Denominator[Product[((pr = Prime[i]) - 1)/pr, {i, 1, n}]] * Range[Length[v]]; Table[row[n], {n, 0, 4}] // Flatten (* Amiram Eldar, Aug 10 2019 *)

A307964 Irregular triangle read by rows: T(n,k) = A308121(A024556(n),k).

Original entry on oeis.org

7, 14, 13, 4, 11, 2, 1, 8, 3, 6, 5, 8, 3, 2, 5, 4, -1, 2, 1, 4, 13, 26, 19, 32, 25, 38, 31, 4, 17, 10, 23, 16, 29, 2, -5, 8, 1, 14, 7, 20, 11, 22, 33, 44, 31, 18, 29, 16, 27, 38, 1, 12, 23, 34, -3, 8, 19, 6, 17, 4, -9, 2, 13, 24, 5, 10, 7, 12, 9, 14, 11, 16, 5
Offset: 1

Author

Jamie Morken, Jul 29 2019

Keywords

Comments

The sequence gives odd squarefree composite rows n in A308121, i.e., rows 15, 21, 33, 35, 39, 51, 55, 57, 65, ... given by A024556(n). These rows are the primitive rows of A308121.
Row n has length A000010(A024556(n)).
For row n:
T(n, 1) = T(n, 2) / 2.
T(n, phi(n)) - T(n, phi(n)-1) = T(n, 1).
T(n, phi(n)/2+1) - T(n, phi(n)/2) = T(n, 1).
From Charlie Neder, Jul 30 2019: (Start)
For row n, T(n, k) + T(n, phi(n)-k) is constant for all k.
For 2 <= k < lpf(A024556(n)), T(n, k) = k*T(n, 1). (End)

Examples

			The sequence as an irregular triangle:
1:  7, 14, 13, 4, 11, 2, 1, 8;
2:  3, 6, 5, 8, 3, 2, 5, 4, -1, 2, 1, 4;
3:  13, 26, 19, 32, 25, 38, 31, 4, 17, 10, 23, 16, 29, 2, -5, 8, 1, 14, 7, 20;
4:  11, 22, 33, 44, 31, 18, 29, 16, 27, 38, 1, 12, 23, 34, -3, 8, 19, 6, 17, 4, -9, 2, 13, 24;
5:  5, 10, 7, 12, 9, 14, 11, 16, 5, 2, 7, 4, 9, 6, 11, 8, -3, 2, -1, 4, 1, 6, 3, 8
6:  19, 38, 25, 44, 31, 50, 37, 56, 43, 62, 49, 4, 23, 10, 29, 16, 35, 22, 41, 28, 47, 2, -11, 8, -5, 14, 1, 20, 7, 26, 13, 32;
7:  3, 6, 9, 12, 7, 10, 13, 16, 3, 6, 9, 4, 7, 10, 13, 8, 3, 6, 1, 4, 7, 10, 5, 8, 3, -2, 1, 4, 7, 2, 5, 8, -5, -2, 1, 4, -1, 2, 5, 8;
8:  7, 14, 9, 16, 11, 18, 13, 20, 15, 22, 17, 24, 7, 2, 9, 4, 11, 6, 13, 8, 15, 10, 17, 12, -5, 2, -3, 4, -1, 6, 1, 8, 3, 10, 5, 12;
9:  17, 34, 51, 68, 37, 54, 71, 88, 57, 74, 43, 12, 29, 46, 63, 32, 49, 66, 83, 4, 21, 38, 7, 24, 41, 58, 27, 44, 61, -18, -1, 16, 33, 2, 19, 36, 53, 22, -9, 8, -23, -6, 11, 28, -3, 14, 31, 48;
  ...
		

Programs

  • Mathematica
    rowsToCheck = 340;
    A024556 =
    Complement[Select[Range[3, rowsToCheck, 2], SquareFreeQ],
      Prime[Range[
        PrimePi[rowsToCheck]]]]; (* after Harvey P. Dale , Jan 26 2011 *)
    A308121 =
    Table[With[{a = n/GCD[n, #], b = Numerator[#/n]},
         MapIndexed[a First@#2 - b #1 &,
          Flatten@Position[GCD[Table[Mod[k, n], {k, n - 1}], n],
             1] /. {} -> {1}]] &@EulerPhi@n, {n,
       rowsToCheck}]; (* after Michael De Vlieger, Jun 06 2019 *)
    A307964 = {};
    For[i = 1, i <= Length[A024556], i++,
    AppendTo[A307964, A308121[[A024556[[i]]]]]]
    A307964flattened = Flatten[A307964]
    (* Jamie Morken, Apr 20 2021 *)

A308121 Irregular triangle read by rows: T(n,k) = A109395(n)*k-A076512(n)*A038566(n,k).

Original entry on oeis.org

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

Author

Jamie Morken, May 13 2019

Keywords

Comments

Row n has length A000010(n).
Row n > 1 has sum = n*A076512(n)/2.
First value on row(n) = A076511(n).
Last value on row(n) = A076512(n) for n > 1.
For n > 1, A109395(n) = Max(row) + Min(row).
For values x and y on row n > 1 at positions a and b on the row:
x + y = A109395(n), where a = A000010(n) - (b-1).
For n > 2 the penultimate value on row A002110(n) is given by
From Charlie Neder, Jun 05 2019: (Start)
If p is a prime dividing n, then row p*n consists of p copies of row n.
Conjecture: If n is odd, then row 2n can be obtained from row n by interchanging the first and second halves. (End)

Examples

			The sequence as an irregular triangle:
  n/k 1, 2, 3, 4, ...
   1: 0
   2: 1
   3: 1, 2
   4: 1, 1
   5: 1, 2, 3, 4
   6: 2, 1
   7: 1, 2, 3, 4, 5, 6
   8: 1, 1, 1, 1
   9: 1, 2, 1, 2, 1, 2
  10: 3, 4, 1, 2
  11: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
  12: 2, 1, 2, 1
  13: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
  14: 4, 5, 6, 1, 2, 3
  15: 7, 14, 13, 4, 11, 2, 1, 8
  ...
  Row sums: 0, 1, 3, 2, 10, 3, 21, 4, 9, 10, 55, 6, 78, 21, 60.
T(14,5) = A109395(14)*5 - A076512(14)*A038566(14,5) = 7*5 - 3*11 = 2.
T(210,2) = A109395(210)*2 - A076512(210)*A038566(210,2) = 35*2 - 8*11 = -18.
		

Crossrefs

Programs

  • Mathematica
    Flatten@ Table[With[{a = n/GCD[n, #], b = Numerator[#/n]}, MapIndexed[a First@ #2 - b #1 &, Flatten@ Position[GCD[Table[Mod[k, n], {k, n - 1}], n], 1] /. {} -> {1}]] &@ EulerPhi@ n, {n, 15}] (* Michael De Vlieger, Jun 06 2019 *)
  • PARI
    vtot(n) = select(x->(gcd(n, x)==1), vector(n, k, k));
    row(n) = my(q = eulerphi(n)/n, v = vtot(n)); vector(#v, k, denominator(q)*k - numerator(q)*v[k]); \\ Michel Marcus, May 14 2019

A307388 Length of the period of decimal representation of Product_{k=1..n} A038111(k)/A038110(k).

Original entry on oeis.org

1, 27, 729, 59049, 43046721, 31381059609, 68630377364883, 150094635296999121, 328256967394537077627, 717897987691852588770249, 4710128697246244834921603689, 92709463147897837085761925410587, 3649600726280146254718103955713167842
Offset: 9

Author

Jamie Morken, Apr 06 2019

Keywords

Comments

The offset is 9 since for 0 < n < 5, the product is an integer, and for 4 < n < 9 the decimal expansion ends with zeros.

Examples

			For example for n=9 with (2/1) * (6/1) * (15/1) * (105/4) * (385/8) * (1001/16) * (17017/192) * (323323/3072) * (7436429/55296) = 2759414170256180364552625 / 154618822656 = 17846560482454.30745852273604315188195970323350694444444444444... so a(9) = 1.
		

Crossrefs

Programs

  • Mathematica
    Primorial[n_] := Times @@ Prime[Range[n]]
    ClearAll[iter]
    ClearAll[fracPer, vp];
    (*p-adic order*)
    vp[p_?PrimeQ, n_Integer] :=
      Length@NestWhileList[#/p &, n/p, IntegerQ] - 1;
    (*fraction decimal expansion period*)
    fracPer[q_Integer] := 0;
    fracPer[q_Rational] := Module[{den, p2, p5}, den = Denominator[q];
       p2 = vp[2, den];
       p5 = vp[5, den];
       den = den/2^p2/5^p5;
       If[den == 1, 0, MultiplicativeOrder[10, den]]];
    iter[{periods_, frac_, n_}] := {{periods, fracPer[#]}, #, n + 1} &[
       frac*Primorial[n]/EulerPhi[Primorial[Max[1, n - 1]]]];
    Flatten@First@
      Nest[iter, {0, Primorial[0]/EulerPhi[Primorial[0]], 0}, 50]

A306353 Number of composites among the first n composite numbers whose least prime factor p is that of the n-th composite number.

Original entry on oeis.org

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

Author

Jamie Morken and Vincenzo Librandi, Feb 09 2019

Keywords

Comments

Composites with least prime factor p are on that row of A083140 which begins with p
Sequence with similar values: A122005.
Sequence written as a jagged array A with new row when a(n) > a(n+1):
1, 2, 3,
1, 4, 5, 6,
2, 7, 8, 9,
3, 10, 11,
1, 12,
4, 13, 14, 15,
5, 16,
2, 17, 18,
6, 19, 20, 21,
7, 22, 23,
1, 24,
8, 25, 26,
3, 27,
9, 28, 29, 30.
A153196 is the list B of the first values in successive rows with length 4.
B is given by the formula for A002808(x)=A256388(n+3), an(x)=A153196(n+2)
For example: A002808(26)=A256388(3+3), an(26)=A153196(3+2).
A243811 is the list of the second values in successive rows with length 4.
A047845 is the list of values in the second column and A104279 is the list of values in the third column of the jagged array starting on the second row.
Sequence written as an irregular triangle C with new row when a(n)=1:
1,2,3,
1,4,5,6,2,7,8,9,3,10,11,
1,12,4,13,14,15,5,16,2,17,18,6,19,20,21,7,22,23,
1,24,8,25,26,3,27,9,28,29,30,10,31,4,32,33,11,34,35,36,12,37,2,38,39,13,40,41,5,42,14,43,44,3,45,15,46,6,47,48,16,49,50,51,17,52,53,54,18,55,56,7,57,19,58,4,59.
A243887 is the last value in each row of C.
The second value D on the row n > 1 of the irregular triangle C is a(A053683(n)) or equivalently A084921(n). For example for row 3 of the irregular triangle:
D = a(A053683(3)) = a(16) = 12 or D = A084921(3) = 12. This is the number of composites < A066872(3) with the same least prime factor p as the A053683(3) = 16th composite, A066872(3) = 26.
The number of values in each row of the irregular triangle C begins: 3,11,18,57,39,98,61,141,265,104,351,268,...
The second row of the irregular triangle C is A117385(b) for 3 < b < 15.
The third row of the irregular triangle C has similar values as A117385 in different order.

Examples

			First composite 4, least prime factor is 2, first case for 2 so a(1)=1.
Next composite 6, least prime factor is 2, second case for 2 so a(2)=2.
Next composite 8, least prime factor is 2, third case for 2 so a(3)=3.
Next composite 9, least prime factor is 3, first case for 3 so a(4)=1.
Next composite 10, least prime factor is 2, fourth case for 2 so a(5)=4.
		

Programs

  • Mathematica
    counts = {}
    values = {}
    For[i = 2, i < 130, i = i + 1,
    If[PrimeQ[i], ,
    x = PrimePi[FactorInteger[i][[1, 1]]];
      If[Length[counts] >= x,
       counts[[x]] = counts[[x]] + 1;
       AppendTo[values, counts[[x]]], AppendTo[counts, 1];
       AppendTo[values, 1]]]]
       (* Print[counts] *)
       Print[values]
  • PARI
    c(n) = for(k=0, primepi(n), isprime(n++)&&k--); n; \\ A002808
    a(n) = my(c=c(n), lpf = vecmin(factor(c)[,1]), nb=0); for(k=2, c, if (!isprime(k) && vecmin(factor(k)[,1])==lpf, nb++)); nb; \\ Michel Marcus, Feb 10 2019

Formula

a(n) is approximately equal to A002808(n)*(A038110(x)/A038111(x)), with A000040(x)=A020639(A002808(n)).
For example if n=325, a(325)~= A002808(325)*(A038110(2)/A038111(2)) with A000040(2)=A020639(A002808(325)).
This gives an estimate of 67.499... and the actual value of a(n)=67.