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.

A166460 Numbers k such that k + (-1)^k is not prime.

This page as a plain text file.
%I A166460 #25 Aug 27 2024 18:14:54
%S A166460 0,1,5,7,8,9,11,13,14,15,17,19,20,21,23,24,25,26,27,29,31,32,33,34,35,
%T A166460 37,38,39,41,43,44,45,47,48,49,50,51,53,54,55,56,57,59,61,62,63,64,65,
%U A166460 67,68,69,71,73,74,75,76,77,79,80,81,83,84,85,86,87,89,90,91,92,93,94
%N A166460 Numbers k such that k + (-1)^k is not prime.
%C A166460 This is the complement of A068499 (except that both include 1 as a term).
%C A166460 From _Don Reble_, Aug 31 2021: (Start)
%C A166460 Proof for all k except 0, 1, 3 with cases
%C A166460 (i)   If k is odd and >=5, then k+1 = 2*x, 2 < x < k, k! = k*...*x*...*2*1
%C A166460         A068499: k+1 divides k!            : absent
%C A166460         A166460: k-1 is even and composite : present
%C A166460 (ii)  If k is even and k+1 is prime,
%C A166460         A068499: k+1 does not divide k!    : present
%C A166460         A166460: k+1 is prime              : absent
%C A166460 (iii) If k is even and k+1 = p^2 is the square of a (odd) prime, then k+1 >= 3p, k > 2p.
%C A166460         A068499: k! = k*...*2p*...*p*...*1;
%C A166460                  k+1 divides k!            : absent
%C A166460         A166460: k+1 is composite          : present
%C A166460 (iv)  If k is even and k+1 is composite but not the square of a prime, then there are two distinct factors x*y = k+1:
%C A166460                  3 <= x < y = (k+1)/x < k.
%C A166460         A068499: k! = k*...*y*...*x*...*1:
%C A166460                  k+1 divides k!            : absent
%C A166460         A166460: k+1 is composite          : present
%C A166460 (End)
%H A166460 Michael De Vlieger, <a href="/A166460/b166460.txt">Table of n, a(n) for n = 1..10000</a>
%F A166460 a(n) = A002808(n-1)-1 for n>2. - _Chai Wah Wu_, Aug 27 2024
%e A166460 0 + (-1)^0 = 1 is not prime, which adds 0 to the sequence.
%e A166460 5 + (-1)^5 = 4 is not prime, which adds 5 to the sequence.
%t A166460 Select[Range[0, 94], ! PrimeQ[# + (-1)^#] &] (* _Michael De Vlieger_, Sep 08 2021 *)
%o A166460 (Python)
%o A166460 from sympy import composite
%o A166460 def A166460(n): return composite(n-1)-1 if n>2 else n-1 # _Chai Wah Wu_, Aug 27 2024
%Y A166460 Cf. A002808, A072668, A141468, A060462, A118742, A068499.
%K A166460 nonn,easy
%O A166460 1,3
%A A166460 _Juri-Stepan Gerasimov_, Oct 14 2009
%E A166460 0 added by _R. J. Mathar_, Oct 21 2009