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.

Previous Showing 11-16 of 16 results.

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.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Jun 20 2025

Keywords

Comments

(6n-1, 6n+1) are twin primes iff a(n) = 0, that is, if there are no nonzero integers x, y such that n = |6xy + x + y|. (These n are listed in A002822, the complement is A067611.)
a(n) <= (6*n-1)/5, with equality if 6*n+1 is prime and 6*n-1 is 5 times a prime. - Robert Israel, Jul 21 2025

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.
		

Crossrefs

Cf. A384103 (the corresponding y-values).
Cf. A002822 (indices of zeros: n such that 6n-1 and 6n+1 are twin primes).
Cf. A077800 (list of twin primes), A060461, A171696 (none among 6n+-1 is prime), A067611 (n = 6xy +- x +- y: 6n-1 or 6n+1 is composite).

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))}

A384103 a(n) = y with minimum |x| >= |y| > 0, such that n = |6xy + x + y|, or 0 if no such x, y exist. If x and -x are solutions, choose x > 0 > y = -x.

Original entry on oeis.org

0, 0, 0, -1, 0, -1, 0, 1, -1, 0, -1, 0, 1, -1, 1, -1, 0, 0, -1, -2, -1, 1, 0, -2, 0, -1, 1, 2, 1, 0, -2, 0, 0, 1, -2, 1, 2, 0, -1, 0, 2, -2, 1, -1, 0, -2, 0, -3, -1, 2, -1, 0, -2, -3, 1, -1, -2, 0, -1, 3, -1, 1, 2, -2, -3, -1, 2, -2, 1, 0, -3, 0, 3, -1, -2, 2, 0, 1, 3, 2, -1, -3, 1, -1, 1, -2, 0, -4, 2, -2
Offset: 1

Views

Author

M. F. Hasler, Jun 20 2025

Keywords

Comments

(6n-1, 6n+1) are twin primes iff a(n) = 0, that is, if there are no nonzero integers x, y such that n = |6xy + x + y|. These n are listed in A002822, the complement is A067611.
The corresponding x-values are listed in A384102.

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.
		

Crossrefs

Cf. A384102 (the corresponding x-values).
Cf. A002822 (indices of zeros: n such that 6n-1 and 6n+1 are twin primes).
Cf. A077800 (list of twin primes), A060461, A171696 (none among 6n+-1 is prime), A067611 (n = 6xy +- x +- y: 6n-1 or 6n+1 is composite).

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);
           if C = {} then return 0 fi;
           m:= infinity;
           for t in C do
             if abs(t[1]) < m then m:= abs(t[1]); r:= t[2];
             elif abs(t[1]) = m and t[1] > 0 then r:= t[2]
             fi
           od;
           r
     end proc:
    map(f, [$1..100]); # Robert Israel, Jul 21 2025
  • PARI
    apply( {A384103(n)=for(x=1,n\/5, my(p=6*x+1, q=6*x-1, y=if((n-x)%p==0, (n-x)\p, (n+x)%p==0, -(n+x)\p, (n-x)%q==0, (n-x)\q, (n+x)%q==0,-(n+x)\q)); y && abs(y) <= x && return(y))}, [1..90])

A173229 a(n) is the n-th number m such that 6m-1 is composite minus the n-th number k such that 6k+1 is composite.

Original entry on oeis.org

2, 3, 4, 2, 5, 2, 4, 4, 3, 3, 5, 4, 2, 1, 2, 5, 6, 7, 7, 6, 6, 6, 4, 7, 5, 4, 6, 4, 4, 4, 4, 5, 5, 6, 5, 7, 8, 7, 6, 6, 6, 8, 8, 9, 9, 10, 8, 8, 12, 8, 9, 8, 9, 8, 8, 8, 7, 8, 7, 8, 6, 4, 3, 4, 4, 6, 7, 6, 6, 6, 8, 6, 6, 5, 5, 6, 8, 7, 10, 9, 9, 9, 11, 11, 11, 12, 11, 10, 9, 7, 10, 8, 8, 6, 6, 6, 4, 5, 5, 7
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 13 2010, Feb 14 2010

Keywords

Comments

A046953 U A046954(without zero) = A067611 where A067611 U A002822 U A171696 = A001477.

Examples

			a(1) = 6 - 4 = 2;
a(2) = 11 - 8 = 3;
a(3) = 13 - 9 = 4.
		

Crossrefs

Programs

  • Maple
    A046953 := proc(n) if n = 1 then 6 ; else for a from procname(n-1)+1 do if not isprime(6*a-1) then return a; end if; end do: end if; end proc:
    A046954 := proc(n) if n = 1 then 0 ; else for a from procname(n-1)+1 do if not isprime(6*a+1) then return a; end if; end do: end if; end proc:
    A173229 := proc(n) A046953(n)-A046954(n+1) ; end proc:
    seq(A173229(n),n=1..120) ; # R. J. Mathar, May 02 2010

Formula

a(n) = A046953(n) - A046954(n+1).

Extensions

Corrected from a(63) onwards by R. J. Mathar, May 02 2010

A173231 a(n) is the n-th number m such that 6*m-1 is composite plus the n-th number k such that 6*k+1 is composite.

Original entry on oeis.org

10, 19, 22, 30, 35, 40, 44, 48, 51, 59, 63, 66, 70, 73, 80, 87, 90, 93, 95, 102, 104, 106, 110, 115, 119, 122, 126, 132, 134, 138, 142, 147, 153, 156, 161, 165, 168, 171, 174, 176, 178, 184, 186, 193, 195, 198, 202, 204, 210, 216, 221, 224, 227, 230, 234, 236
Offset: 1

Views

Author

Juri-Stepan Gerasimov, Feb 13 2010, Feb 15 2010

Keywords

Comments

Examples

			a(1) = 6 + 4 = 10;
a(2) = 11 + 8 = 19;
a(3) = 13 + 9 = 22.
		

Crossrefs

Programs

  • GAP
    A046953:=Filtered([1..250], k-> not IsPrime(6*k-1));;
    A046954:=Filtered([0..250], n-> not IsPrime(6*n+1));;
    Print(List([1..80], j->A046953[j]+A046954[j+1])); # G. C. Greubel, Feb 21 2019
  • Magma
    A046953:=[n: n in [1..250] | not IsPrime(6*n-1)];
    A046954:=[n: n in [0..250] | not IsPrime(6*n+1)];
    [A046953[n] + A046954[n+1]: n in [1..80]]; // G. C. Greubel, Feb 21 2019
    
  • Maple
    A046953 := proc(n) if n = 1 then 6 ; else for a from procname(n-1)+1 do if not isprime(6*a-1) then return a; end if; end do: end if; end proc:
    A046954 := proc(n) if n = 1 then 0 ; else for a from procname(n-1)+1 do if not isprime(6*a+1) then return a; end if; end do: end if; end proc:
    A173231 := proc(n) A046953(n)+A046954(n+1) ; end proc:
    seq(A173231(n),n=1..120) ; # R. J. Mathar, May 02 2010
  • Mathematica
    A046953:= Select[Range[250], !PrimeQ[6#-1] &];
    A046954:= Select[Range[0, 250], !PrimeQ[6#+1] &];
    Table[A046953[[n]] +A046954[[n+1]], {n,1,80}]
  • Sage
    A046953=[n for n in (1..250) if not is_prime(6*n-1)];
    A046954=[n for n in (0..250) if not is_prime(6*n+1)];
    [A046953[n] + A046954[n+1] for n in (0..80)] # G. C. Greubel, Feb 21 2019
    

Formula

a(n) = A046953(n) + A046954(n+1).

Extensions

Entries checked by R. J. Mathar, May 02 2010

A304978 Numbers that can be expressed in more than one way as 6xy + x + y with x >= y > 0.

Original entry on oeis.org

106, 155, 197, 204, 253, 288, 302, 351, 379, 400, 421, 449, 470, 498, 504, 535, 547, 554, 561, 596, 645, 652, 687, 694, 704, 729, 743, 779, 782, 792, 820, 834, 841, 873, 890, 904, 925, 939, 953, 988, 1016, 1029, 1037, 1042, 1054, 1079, 1086, 1107, 1121, 1135, 1184, 1198, 1204, 1211, 1219, 1233, 1254, 1276, 1282, 1289, 1329
Offset: 1

Views

Author

Pedro Caceres, May 22 2018

Keywords

Comments

Is it possible to find a closed form formula for this sequence?
Numbers k such that 6*k+1 has at least 5 divisors == 1 (mod 6). - Robert Israel, Jan 20 2019

Examples

			106 is in this sequence because 106 can be expressed in two different ways as 6xy + x + y: 6*8*2 + 8 + 2 and 6*15*1 + 15 + 1.
		

Crossrefs

Subsequence of A067611. A279060.

Programs

  • Maple
    filter:= proc(n) nops(select(t -> t mod 6 =1, numtheory:-divisors(6*n+1)))>= 5 end proc:
    select(filter, [$1..2000]); # Robert Israel, Jan 20 2019
  • Mathematica
    Select[Range[1329], 2 == Length@ FindInstance[ 6*x*y+x+y == # && x >= y > 0, {x, y}, Integers, 2] &] (* Giovanni Resta, May 29 2018 *)
  • PARI
    is(n) = my(i=0); for(x=1, n, for(y=1, x, if(n==6*x*y+x+y, i++; if(i==2, return(1))))); 0 \\ Felix Fröhlich, May 29 2018
  • Python
    from sympy import divisors
    def ok(n): return sum(d%6 == 1 for d in divisors(6*n+1)) > 4
    print([n for n in range(1330) if ok(n)]) # David Radcliffe, Jun 19 2025
    

A054775 Positive multiples of 6 which are not the midpoint of a pair of twin primes.

Original entry on oeis.org

24, 36, 48, 54, 66, 78, 84, 90, 96, 114, 120, 126, 132, 144, 156, 162, 168, 174, 186, 204, 210, 216, 222, 234, 246, 252, 258, 264, 276, 288, 294, 300, 306, 318, 324, 330, 336, 342, 354, 360, 366, 372, 378, 384, 390, 396, 402, 408, 414, 426, 438, 444, 450, 456, 468, 474
Offset: 1

Views

Author

Stuart M. Ellerstein (ellerstein(AT)aol.com), May 19 2000

Keywords

Crossrefs

Cf. A067611 (sequence divided by 6).

Programs

  • Magma
    [ n: n in [6..600 by 6] | not IsPrime(n-1) or not IsPrime(n+1) ];  // Klaus Brockhaus, Aug 18 2010
    
  • PARI
    forstep(n=6,600,6,if(!(isprime(n-1)&&isprime(n+1)),print1(n,","))) \\ Klaus Brockhaus, Aug 18 2010

Extensions

Corrected by Zak Seidov and Klaus Brockhaus, Aug 18 2010
Edited by N. J. A. Sloane, Aug 19 2010
Previous Showing 11-16 of 16 results.