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.

A358874 Inverse permutation to A076034.

This page as a plain text file.
%I A358874 #13 Dec 05 2022 04:46:52
%S A358874 1,2,3,4,5,7,6,11,12,16,8,22,9,29,30,37,10,46,13,56,17,67,14,79,15,92,
%T A358874 38,106,18,121,19,137,57,154,23,172,20,191,68,211,21,232,24,254,93,
%U A358874 277,25,301,39,326,107,352,26,379,40,407,138,436,27,466,28,497
%N A358874 Inverse permutation to A076034.
%H A358874 Rémy Sigrist, <a href="/A358874/a358874.gp.txt">PARI program</a>
%H A358874 <a href="/index/Per#IntegerPermutation">Index entries for sequences that are permutations of the natural numbers</a>
%F A358874 a(2*n) = A000124(n).
%F A358874 a(p) < a(n) if p < n with p a prime number.
%e A358874 A076034(42) = 101, so a(101) = 42.
%p A358874 S:=[$1..10000]:
%p A358874 V:= Vector(10000): ok:= true;
%p A358874 for n from 1 while ok do
%p A358874   A:= [S[1]]; R:= 1; count:= 1;
%p A358874   for k from 2 while count < n do
%p A358874     if k > nops(S) then ok:= false; break fi;
%p A358874     if andmap(t -> igcd(t,S[k])=1, A) then count:= count+1; A:= [op(A),S[k]]; R:= R,k; fi
%p A358874   od;
%p A358874   S:= subsop(op(map(t -> t=NULL, [R])),S);
%p A358874   for i from 1 to nops(A) do
%p A358874     V[A[i]]:= n*(n-1)/2+i
%p A358874   od
%p A358874 od:
%p A358874 if member(0,V,'q') then convert(V[1..q-1],list)
%p A358874 else convert(V,list)
%p A358874 fi; # _Robert Israel_, Dec 04 2022
%o A358874 (PARI) See Links section.
%Y A358874 Cf. A000124, A076034.
%K A358874 nonn,look
%O A358874 1,2
%A A358874 _Rémy Sigrist_, Dec 04 2022