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.

A242221 Numbers n such that n - n^2/m^2 and 2n - n/m are not prime for all m.

This page as a plain text file.
%I A242221 #27 Jul 27 2020 04:45:24
%S A242221 1,25,26,28,33,35,39,46,50,58,63,65,77,78,81,85,86,88,92,93,94,95,105,
%T A242221 111,116,118,119,122,123,124,125,130,133,134,143,144,145,146,148,153,
%U A242221 155,160,161,162,165,170,171,172,176,178,183,185,186,188,189,196,202
%N A242221 Numbers n such that n - n^2/m^2 and 2n - n/m are not prime for all m.
%C A242221 Intersection of A241884 and A138666.
%H A242221 Robert Israel, <a href="/A242221/b242221.txt">Table of n, a(n) for n = 1..10000</a>
%e A242221 26 is in this sequence because:
%e A242221 1) 26 - 26^2/1^2 = -650 and 2*26 - 26/1 = 26 both not prime for m = 1,
%e A242221 2) 26 - 26^2/2^2 = -143 and 2*26 - 26/2 = 39 both not prime for m = 2,
%e A242221 3) 26 - 26^2/13^2 = 22 and 2*26 - 26/13 = 50 both not prime for m = 13,
%e A242221 4) 26 - 26^2/26^2 = 25 and 2*26 - 26/26 = 51 both not prime for m = 26.
%p A242221 filter:= proc(n) andmap(t -> not isprime(n - n^2/t^2) and not isprime(2*n - n/t), numtheory:-divisors(n)) end proc:
%p A242221 select(filter, [$1..200]); # _Robert Israel_, Jul 03 2017
%t A242221 filterQ[n_] := AllTrue[Divisors[n], !PrimeQ[n - n^2/#^2] && !PrimeQ[2n - n/#]&];
%t A242221 Select[Range[200], filterQ] (* _Jean-François Alcover_, Jul 27 2020, after Maple *)
%o A242221 (PARI) f(n)=fordiv(n, m, if(isprime(n-n^2/m^2), return(0))); 1
%o A242221 g(n)=fordiv(n, m, if(isprime(2*n-n/m), return(0))); 1
%o A242221 for(n=1, 200, if(f(n) && g(n), print1(n, ", "))) \\ _Colin Barker_, May 08 2014
%Y A242221 Cf. A138666, A241884.
%K A242221 nonn
%O A242221 1,2
%A A242221 _Ilya Lopatin_ and _Juri-Stepan Gerasimov_, May 07 2014
%E A242221 More terms from _Colin Barker_, May 08 2014
%E A242221 Example corrected by _Colin Barker_, May 09 2014