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.

A300816 Minimal sequence whose forwards van Eck transform is the sequence of nonprime numbers.

This page as a plain text file.
%I A300816 #11 Jun 15 2019 21:39:47
%S A300816 0,0,1,2,3,0,4,5,1,6,7,2,8,3,9,0,10,11,4,12,13,5,14,1,15,6,16,17,7,18,
%T A300816 19,2,20,8,21,3,22,23,9,24,0,25,10,26,11,27,4,28,29,12,30,31,13,32,5,
%U A300816 33,14,34,1,35,15,36,37,6,38,16,39,17,40,41,7,42,43,18
%N A300816 Minimal sequence whose forwards van Eck transform is the sequence of nonprime numbers.
%C A300816 At each step, the minimum available integer is used.
%e A300816 a(1) = 0. Next 0 is at distance 1: a(2) = 0.
%e A300816 a(2) = 0. Next 0 is at distance 4: a(6) = 0.
%e A300816 For a(3) we cannot use 0 because the next 0 is at distance 3 that is a prime.
%e A300816 Therefore we must use 1: a(3) = 1.
%e A300816 Next 1 must be at distance 6, next composite after 4: a(9) = 1.
%e A300816 Again, for a(4) we cannot use neither 0 nor 1: a(4) = 2.
%e A300816 Next 2 must be at distance 8: a(12) = 2. And so on.
%p A300816 P:=proc(q,h) local i,k,n,t,x; x:=array(1..h);
%p A300816 for k from 1 to h do x[k]:=-1; od; x[1]:=0; i:=0; t:=0;
%p A300816 for n from 1 to q do if not isprime(n) then i:=i+1;
%p A300816 if x[i]=-1 then t:=t+1; x[i]:=t; fi; x[i+n]:=x[i];
%p A300816 fi; od; seq(x[k],k=1..124); end: P(160,300);
%Y A300816 Cf. A018252, A181642.
%K A300816 nonn,easy
%O A300816 1,4
%A A300816 _Paolo P. Lava_, Mar 13 2018