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.

A163504 a(n) = abs(n-th prime minus n-th odd nonprime).

This page as a plain text file.
%I A163504 #12 Dec 07 2024 15:29:05
%S A163504 1,6,10,14,14,14,16,16,16,16,18,14,14,14,16,12,10,14,10,10,12,8,8,4,2,
%T A163504 2,2,4,6,4,8,10,14,14,20,18,22,22,24,28,32,28,36,34,36,34,42,52,52,52,
%U A163504 50,54,54,62,62,62,66,66,70,72,70,78,90,92,92,92,100,102,110,106,108,112
%N A163504 a(n) = abs(n-th prime minus n-th odd nonprime).
%H A163504 G. C. Greubel, <a href="/A163504/b163504.txt">Table of n, a(n) for n = 1..1000</a>
%F A163504 a(n) = abs(A000040(n)-A014076(n)).
%e A163504 a(1)=abs(2-1)=1; a(2)=abs(3-9)=6.
%p A163504 A014076 := proc(n) option remember; local a; if n = 1 then 1; else for a from procname(n-1)+2 by 2 do if not isprime(a) then return a; end if; end do: end if; end proc: A163504 := proc(n) abs(ithprime(n)-A014076(n)) ; end: seq(A163504(n),n=1..80) ; # _R. J. Mathar_, Oct 10 2009
%t A163504 A014076 := Select[Range[1, 10000, 2], PrimeOmega[#] != 1 &]; Table[Abs[Prime[n] - A014076[[n]]], {n,1,50}] (* _G. C. Greubel_, Jul 27 2017 *)
%t A163504 Module[{nn=250,onp},onp=Select[Range[1,nn,2],!PrimeQ[#]&];Abs[#[[1]]-#[[2]]]&/@Thread[{Prime[Range[Length[onp]]],onp}]] (* _Harvey P. Dale_, Dec 07 2024 *)
%Y A163504 Cf. A000040, A014076, A129146.
%K A163504 nonn
%O A163504 1,2
%A A163504 _Juri-Stepan Gerasimov_, Jul 29 2009
%E A163504 An 8 inserted by _R. J. Mathar_, Oct 10 2009