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.

A062505 Numbers k such that if p is a prime that divides k, then either p + 2 or p - 2 is also prime.

This page as a plain text file.
%I A062505 #21 Sep 08 2022 08:45:03
%S A062505 1,3,5,7,9,11,13,15,17,19,21,25,27,29,31,33,35,39,41,43,45,49,51,55,
%T A062505 57,59,61,63,65,71,73,75,77,81,85,87,91,93,95,99,101,103,105,107,109,
%U A062505 117,119,121,123,125,129,133,135,137,139,143,145,147,149,151,153,155,165
%N A062505 Numbers k such that if p is a prime that divides k, then either p + 2 or p - 2 is also prime.
%C A062505 Multiplicative closure of twin primes (A001097).
%D A062505 Stephan Ramon Garcia and Steven J. Miller, 100 Years of Math Milestones: The Pi Mu Epsilon Centennial Collection, American Mathematical Society, 2019, pp. 35-37.
%H A062505 Amiram Eldar, <a href="/A062505/b062505.txt">Table of n, a(n) for n = 1..10000</a>
%e A062505 35 is included because 35 = 5*7 and both (5+2) and (7-2) are primes.
%e A062505 65 = 5*13 where the factors are members of twin prime pairs: (3,5) and (11,13), therefore a(29) = 65 is a term; but 69 is not because 69 = 3*23 and 23 = A007510(2) is a single prime.
%t A062505 nmax = 15 (* corresponding to last twin prime pair (197,199) *); tp[1] = 3; tp[n_] := tp[n] = (p = NextPrime[tp[n-1]]; While[ !PrimeQ[p+2], p = NextPrime[p]]; p); twins = Flatten[ Table[ {tp[n], tp[n]+2}, {n, 1, nmax}]]; max = Last[twins]; mult[twins_] := Select[ Union[ twins, Apply[ Times, Tuples[twins, {2}], {1}]], # <= max & ]; A062505 = Join[{1}, FixedPoint[mult, twins] ] (* _Jean-François Alcover_, Feb 23 2012 *)
%o A062505 (Magma) [k:k in [1..170] | forall{p:p in PrimeDivisors(k)| IsPrime(p+2) or IsPrime(p-2)}]; // _Marius A. Burtea_, Dec 30 2019
%Y A062505 Range of A072963.
%Y A062505 Cf. A001097, A074480.
%K A062505 nonn
%O A062505 1,2
%A A062505 _Leroy Quet_, Jul 09 2001