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.

A163975 n-th nonprime - (-1)^(n-th nonprime).

This page as a plain text file.
%I A163975 #8 Aug 24 2017 16:35:38
%S A163975 -1,2,3,5,7,10,9,11,13,16,15,17,19,22,21,23,26,25,28,27,29,31,34,33,
%T A163975 36,35,37,40,39,41,43,46,45,47,50,49,52,51,53,56,55,58,57,59,61,64,63,
%U A163975 66,65,67,70,69,71,73,76,75,78,77,79,82,81,83,86,85,88,87,89,92,91,94,93
%N A163975 n-th nonprime - (-1)^(n-th nonprime).
%H A163975 G. C. Greubel, <a href="/A163975/b163975.txt">Table of n, a(n) for n = 1..5000</a>
%F A163975 a(n) = A141468(n) - (-1)^A141468(n).
%F A163975 a(n) = A103889(A141468(n)), n>0.
%e A163975 a(1)=0-(-1)^0=-1. a(2)=1-(-1)^1=2.
%p A163975 A103889 := proc(n) n-(-1)^n ; end:
%p A163975 A141468 := proc(n) option remember ; if n <= 2 then n-1 ; else for a from procname(n-1)+1 do if not isprime(a) then RETURN(a); fi; od: fi; end:
%p A163975 A163975 := proc(n) A103889(A141468(n)) ; end: seq( A163975(n),n=1..120) ;
%t A163975 nonPrime[n_Integer] := FixedPoint[n + PrimePi@# &, n + PrimePi@n]; Table[nonPrime[n] - (-1)^(nonPrime[n]), {n, 0, 50}] (* _G. C. Greubel_, Aug 24 2017 *)
%o A163975 (PARI) for(n=1,1e3,if(!isprime(n), print1(n - (-1)^n", "))) \\ _Charles R Greathouse IV_, Jun 10 2015
%Y A163975 Cf. A141468.
%K A163975 sign,easy,less
%O A163975 1,2
%A A163975 _Juri-Stepan Gerasimov_, Aug 07 2009
%E A163975 Entries checked by _R. J. Mathar_, Aug 29 2009