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.

A254636 Numbers that cannot be represented as x*y + x + y, where x>=y>1.

This page as a plain text file.
%I A254636 #18 Oct 15 2024 04:28:25
%S A254636 0,1,2,3,4,5,6,7,9,10,12,13,16,18,21,22,25,28,30,33,36,37,40,42,45,46,
%T A254636 52,57,58,60,61,66,70,72,73,78,81,82,85,88,93,96,100,102,105,106,108,
%U A254636 112,117,121,126,130,133,136,138,141,145,148,150,156,157,162,165,166,172
%N A254636 Numbers that cannot be represented as x*y + x + y, where x>=y>1.
%C A254636 0, 7 and numbers n such that n+1 is either prime or twice a prime. - _Robert Israel_, Aug 05 2015
%p A254636 sort([0,7, op(select(t -> isprime(t+1), [$1..10^4])), op(select(t -> isprime((t+1)/2),[2*i+1$i=1..5*10^3]))]); # _Robert Israel_, Aug 05 2015
%t A254636 r[n_] := Reduce[x >= y > 1 && n == x y + x + y, {x, y}, Integers];
%t A254636 Reap[For[n = 0, n <= 200, n++, If[r[n] === False, Sow[n]]]][[2, 1]] (* _Jean-François Alcover_, Feb 28 2019 *)
%o A254636 (Python)
%o A254636 from sympy import primepi
%o A254636 def A254636(n):
%o A254636     def bisection(f,kmin=0,kmax=1):
%o A254636         while f(kmax) > kmax: kmax <<= 1
%o A254636         while kmax-kmin > 1:
%o A254636             kmid = kmax+kmin>>1
%o A254636             if f(kmid) <= kmid:
%o A254636                 kmax = kmid
%o A254636             else:
%o A254636                 kmin = kmid
%o A254636         return kmax
%o A254636     def f(x): return int(n-1+x-(x>=7)-primepi(x+1)-primepi(x+1>>1))
%o A254636     return bisection(f,n-1,n-1) # _Chai Wah Wu_, Oct 14 2024
%Y A254636 Cf. A091529 (appears to be essentially the same, except first few terms).
%Y A254636 Cf. A253975.
%K A254636 nonn
%O A254636 1,3
%A A254636 _Alex Ratushnyak_, Feb 03 2015