A384102 Least x in absolute value, such that there exists y, |x| >= |y| > 0, such that n = |6xy + x + y|, or 0 if no such x exists. Choose x > 0 if x and -x are both possible.
0, 0, 0, -1, 0, 1, 0, 1, -2, 0, 2, 0, -2, -3, 2, 3, 0, 0, -4, -2, 4, 3, 0, 2, 0, 5, -4, 2, 4, 0, -3, 0, 0, -5, 3, 5, -3, 0, -8, 0, 3, -4, 6, -9, 0, 4, 0, -3, -10, -4, 10, 0, -5, 3, -8, 11, 5, 0, -12, 3, 12, -9, -5, -6, -4, 13, 5, 6, -10, 0, 4, 0, -4, -15, -7, -6, 0, 11, 4, 6, 16, -5, -12, -17, 12, -8, 0, -4, -7, 8, 18, -5, 7, -19, 0, 4, -9, 5, -6
Offset: 1
Examples
For n = 1, 2 and 3, there are no nonzero x,y such that n = |6xy + x + y|, and (6n-1, 6n+1) = (5, 7), (11, 13) and (17, 19) are indeed twin primes. For n = 4 we have x = y = -1 such that |6xy + x + y| = |6 - 1 - 1| = 4 and (23, 25) is indeed not a twin prime pair.
Links
- Robert Israel, Table of n, a(n) for n = 1..10000
Crossrefs
Programs
-
Maple
f:= proc(n) local V, C, t, m,v, r; V:= numtheory:-divisors(6*n+1) minus {1,6*n+1}; C:= map(u -> `if`(u mod 6 = 1, [(u-1)/6, ((6*n+1)/u - 1)/6], [(-u-1)/6, (-(6*n+1)/u - 1)/6]), V); V:= numtheory:-divisors(6*n-1) minus {1,6*n-1}; C:= C union map(u -> `if`(u mod 6 = 1, [(u-1)/6, ((-6*n+1)/u - 1)/6], [(-u-1)/6, ((-6*n+1)/u - 1)/6]), V); C:= select(t -> abs(t[1]) >= abs(t[2]), C)[..,1]; if C = {} then return 0 fi; m:= infinity; for t in C do if abs(t) < m then m:= abs(t); r:= t; elif abs(t) = m and t > 0 then r:= t fi od; r end proc: map(f, [$1..100]); # Robert Israel, Jul 21 2025
-
PARI
{A384102(n)=for(x=1,n\/5, my(p=6*x+1, q=6*x-1, r=if((n-x)%p==0, (n-x)\p, (n+x)%p==0, (n+x)\p, (n-x)%q==0, (x-n)\q, (n+x)%q==0,-(n+x)\q)); r && abs(r) <= x && return(sign(r)*x))}
Comments