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.

A371618 Indices where prime(n) first appears in A373902.

Original entry on oeis.org

1, 10, 14, 44, 108, 135, 209, 252, 401, 840, 890, 1197, 1446, 1678, 1810, 2408, 2796, 3207, 3799, 4212, 4716, 5246, 5590, 6617, 8042, 8564, 9253, 9845, 10549, 12447, 14768, 15328, 16820, 17368, 18876, 21480, 22798, 24802, 26142, 27567, 28511, 29373, 32550, 33416, 35010, 35852, 40976, 43945
Offset: 1

Views

Author

Scott R. Shannon, Jun 22 2024

Keywords

Comments

For the terms studied, in the list of primes' first appearance, they appear in their natural order.

Crossrefs

Programs

  • Mathematica
    nn = 45000; c[] := {}; p[] := False; a[1] = j = 2; c[2] = {2}; p[2] = 1;
    {p[2]}~Join~Monitor[Reap[
      Do[If[PrimePowerQ[j],
        (k = 1;
           While[Or[j == #  k, CoprimeQ[j, #  k], ! FreeQ[c[j], #  k]], k++];
           k *= #) &[FactorInteger[j][[1, 1]]],
         k = FactorInteger[j][[1, 1]];
           While[Or[j == k, CoprimeQ[j, k], ! FreeQ[c[j], k]], k++] ];
        If[PrimeQ[k], If[! p[k], Sow[n]; p[k] = True]];
        Set[{a[n], c[j], c[k], j},
    {k, Union[c[j], {k}], Union[c[k], {j}], k}], {n, 2, nn}] ][[-1, 1]], n] (* Michael De Vlieger, Jun 22 2024 *)