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.

A387072 Index of n in A386482, or -1 if n does not appear in A386482.

This page as a plain text file.
%I A387072 #12 Sep 04 2025 18:44:26
%S A387072 1,2,5,3,17,4,11,9,6,8,24,7,44,10,16,14,52,13,31,15,12,23,73,22,18,21,
%T A387072 26,20,126,19,57,29,25,28,41,27,115,30,43,40,809,39,821,38,42,37,76,
%U A387072 36,49,35,51,34,652,33,70,48,32,47,144,46,189,56,50,55,45,54
%N A387072 Index of n in A386482, or -1 if n does not appear in A386482.
%H A387072 Michael De Vlieger, <a href="/A387072/b387072.txt">Table of n, a(n) for n = 1..20000</a>
%t A387072 Block[{a, j, k, p, m, s, nn},
%t A387072   nn = 2^10; a[_] := 0; m[_] := 1; a[1] = 1; j = a[2] = 2;
%t A387072   Monitor[Do[
%t A387072     If[PrimePowerQ[j],
%t A387072       Set[{p, k, m}, {#1, #1^(#2 - 1), #1^(#2 - 1)}] & @@
%t A387072         FactorInteger[j][[1]]; While[And[a[k*p] != 0, k != 0], k--];
%t A387072         If[k == 0, k = m; While[a[k*p] != 0, k++] ]; k *= p,
%t A387072       k = j - 1; While[And[Or[a[k] != 0, CoprimeQ[j, k]], k != 1], k--];
%t A387072       If[k == 1, k += j; While[Or[a[k] != 0, CoprimeQ[j, k] ], k++] ] ];
%t A387072     Set[{a[k], j}, {n, k}], {n, 3, nn}], n];
%t A387072   k = 1; Reap[While[a[k] > 0, Sow[a[k]]; k++] ][[-1, 1]] ]
%Y A387072 Cf. A386482.
%K A387072 nonn,changed
%O A387072 1,2
%A A387072 _Michael De Vlieger_, Aug 15 2025