login
Indices where prime(n) first appears in A373902.
2

%I #30 Jun 23 2024 14:31:17

%S 1,10,14,44,108,135,209,252,401,840,890,1197,1446,1678,1810,2408,2796,

%T 3207,3799,4212,4716,5246,5590,6617,8042,8564,9253,9845,10549,12447,

%U 14768,15328,16820,17368,18876,21480,22798,24802,26142,27567,28511,29373,32550,33416,35010,35852,40976,43945

%N Indices where prime(n) first appears in A373902.

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

%H Michael S. Branicky, <a href="/A371618/b371618.txt">Table of n, a(n) for n = 1..826</a> (terms 1..178 from Scott R. Shannon)

%t nn = 45000; c[_] := {}; p[_] := False; a[1] = j = 2; c[2] = {2}; p[2] = 1;

%t {p[2]}~Join~Monitor[Reap[

%t Do[If[PrimePowerQ[j],

%t (k = 1;

%t While[Or[j == # k, CoprimeQ[j, # k], ! FreeQ[c[j], # k]], k++];

%t k *= #) &[FactorInteger[j][[1, 1]]],

%t k = FactorInteger[j][[1, 1]];

%t While[Or[j == k, CoprimeQ[j, k], ! FreeQ[c[j], k]], k++] ];

%t If[PrimeQ[k], If[! p[k], Sow[n]; p[k] = True]];

%t Set[{a[n], c[j], c[k], j},

%t {k, Union[c[j], {k}], Union[c[k], {j}], k}], {n, 2, nn}] ][[-1, 1]], n] (* _Michael De Vlieger_, Jun 22 2024 *)

%Y Cf. A373902, A000040.

%K nonn

%O 1,2

%A _Scott R. Shannon_, Jun 22 2024