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.

A060461 Numbers k such that 6*k-1 and 6*k+1 are twin composites.

This page as a plain text file.
%I A060461 #74 Jul 12 2025 18:53:50
%S A060461 20,24,31,34,36,41,48,50,54,57,69,71,79,86,88,89,92,97,104,106,111,
%T A060461 116,119,130,132,134,136,139,141,145,149,150,154,160,167,171,174,176,
%U A060461 179,180,189,190,191,193,196,201,207,209,211,212,219,222,223,224,225,226
%N A060461 Numbers k such that 6*k-1 and 6*k+1 are twin composites.
%C A060461 A counterpart to A002822, which generates twin primes.
%C A060461 Intersection of A046953 and A046954. - _Michel Marcus_, Sep 27 2013
%C A060461 All terms can be expressed as (6ab+a+b OR 6cd-c-d) AND (6xy+x-y) for a,b,c,d,x,y positive integers. Example: 20=6*2*2-2-2 AND 20=6*3*1+3-1. - _Pedro Caceres_, Apr 21 2019
%H A060461 Zak Seidov, <a href="/A060461/b060461.txt">Table of n, a(n) for n = 1..5000</a>
%F A060461 a(n) ~ n. More specifically, there are x - x/log x + O(x/log^2 x) terms of the sequence up to x. - _Charles R Greathouse IV_, Mar 03 2020
%F A060461 a(n) = A259826(n)/6. - _M. F. Hasler_, Jul 10 2025
%e A060461 a(9) = 57: the 9th twin composites among the odds are { 6*57-1, 6*57+1 }, i.e., (341, 343) or (11*31, 7^3).
%p A060461 iscomp := proc(n) if n=1 or isprime(n) then RETURN(0) else RETURN(1) fi: end: for n from 1 to 500 do if iscomp(6*n-1)=1 and iscomp(6*n+1)=1 then printf(`%d,`,n) fi: od: # _James Sellers_, Apr 11 2001
%t A060461 Select[Range[200], !PrimeQ[6#-1]&&!PrimeQ[6#+1]&] (* _Vladimir Joseph Stephan Orlovsky_, Aug 07 2008 *)
%t A060461 Select[Range[300],AllTrue[6#+{1,-1},CompositeQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Feb 15 2015 *)
%t A060461 Select[Range@ 300, Times @@ Boole@ Map[CompositeQ, 6 # + {1, -1}] > 0 &] (* _Michael De Vlieger_, Sep 14 2016 *)
%o A060461 (PARI) A060461()={my(maxx=5000); n=1; ctr=0; while(ctr<maxx, if(!isprime(6*n-1)&&!isprime(6*n+1), print1(n,", "); ctr+=1); n+=1); } \\ _Bill McEachen_, Apr 04 2015
%o A060461 (MATLAB)
%o A060461 i=1:10000;
%o A060461 Q1 = 6*i-1;
%o A060461 Q2 = 6*i+1;
%o A060461 Q = union(Q1,Q2);
%o A060461 P = primes(max(Q));
%o A060461 AT = setxor(Q,P);
%o A060461 f = 0;
%o A060461 for j=1:numel(AT);
%o A060461     K = AT(j);
%o A060461     K2 = K+2;
%o A060461     z = ismember(K2,AT);
%o A060461     if z == 1;
%o A060461         f = f+1;
%o A060461         ATR(f,:) = K + 1;
%o A060461     end
%o A060461 end
%o A060461 m6 = ATR./6;
%o A060461 % _Jesse H. Crotts_, Sep 05 2016
%o A060461 (Python)
%o A060461 from sympy import isprime; from sys import maxsize as oo
%o A060461 is_A060461 = lambda n: not (isprime(n*6-1) or isprime(n*6+1))
%o A060461 def A060461(n = None, first = oo, start = 1, end = oo):
%o A060461     "Return the n-th term or a generator of up to 'first' terms less than 'end', starting at 'start'."
%o A060461     if n: first = n
%o A060461     seq = (m for m,_ in zip(filter(is_A060461, range(start,end)), range(first)))
%o A060461     return max(seq) if n else seq
%o A060461 list(A060461(first=20)) # _M. F. Hasler_, Jul 10 2025
%Y A060461 Cf. A002822, A046953, A046954, A259826.
%K A060461 nonn
%O A060461 1,1
%A A060461 _Lekraj Beedassy_, Apr 09 2001
%E A060461 More terms from _James Sellers_, Apr 11 2001