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.

A099049 Numbers n such that n-1 and n+1 are both prime or both composite.

This page as a plain text file.
%I A099049 #5 Sep 01 2021 12:22:19
%S A099049 4,5,6,7,9,11,12,13,15,17,18,19,21,23,25,26,27,29,30,31,33,34,35,37,
%T A099049 39,41,42,43,45,47,49,50,51,53,55,56,57,59,60,61,63,64,65,67,69,71,72,
%U A099049 73,75,76,77,79,81,83,85,86,87,89,91,92,93,94,95,97,99,101,102,103,105,107
%N A099049 Numbers n such that n-1 and n+1 are both prime or both composite.
%t A099049 Select[Range[120],AllTrue[#+{1,-1},CompositeQ]||AllTrue[#+{1,-1},PrimeQ]&] (* _Harvey P. Dale_, Sep 01 2021 *)
%o A099049 (PARI) for(n=3,200,s=isprime(n-1)+isprime(n+1);if(s<>1,print1(n,",")))
%K A099049 nonn
%O A099049 1,1
%A A099049 _Rick L. Shepherd_, Nov 13 2004