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.

Showing 1-9 of 9 results.

A254671 Numbers that can be represented as x*y + x + y, where x >= y > 1.

Original entry on oeis.org

8, 11, 14, 15, 17, 19, 20, 23, 24, 26, 27, 29, 31, 32, 34, 35, 38, 39, 41, 43, 44, 47, 48, 49, 50, 51, 53, 54, 55, 56, 59, 62, 63, 64, 65, 67, 68, 69, 71, 74, 75, 76, 77, 79, 80, 83, 84, 86, 87, 89, 90, 91, 92, 94, 95, 97, 98, 99, 101, 103, 104, 107, 109, 110, 111, 113
Offset: 1

Views

Author

Alex Ratushnyak, Feb 04 2015

Keywords

Comments

Apparently 8 and the elements of A061743. - R. J. Mathar, Feb 19 2015
This is true. For proof, see link.
As x*y + x + y = (x + 1)*(y + 1) - 1 where x >= y > 1 we have k = a(n) is in the sequence if and only if k + 1 is an odd composite or k + 1 is an even number with more than 4 divisors. - David A. Corneth, Oct 15 2024

Examples

			14 = 2*4 + 2 + 4.
15 = 3*3 + 3 + 3.
There is no way to express 16 in this form, so it is not in the sequence.
		

Crossrefs

Cf. A071904, A254636 is the complement.

Programs

  • Maple
    filter:= proc(n) local t;
      if n::odd then numtheory:-tau(n+1) > 4 else not isprime(n+1) fi
    end proc:
    select(filter, [$1..200]); # Robert Israel, Nov 14 2024
  • Mathematica
    sol[t_] := Solve[x >= y > 1 && x y + x + y == t, {x, y}, Integers];
    Select[Range[200], sol[#] != {}&] (* Jean-François Alcover, Jul 28 2020 *)
  • Python
    def aupto(limit):
        cands = range(2, limit//3+1)
        nums = [x*y+x+y for i, y in enumerate(cands) for x in cands[i:]]
        return sorted(set(k for k in nums if k <= limit))
    print(aupto(113)) # Michael S. Branicky, Aug 11 2021
    
  • Python
    from sympy import primepi
    def A254671(n):
        def f(x): return int(n+(x>=7)+primepi(x+1)+primepi(x+1>>1))
        m, k = n, f(n)
        while m != k: m, k = k, f(k)
        return m # Chai Wah Wu, Oct 14 2024

A255361 Number of ways n can be represented as x*y+x+y where x>=y>1.

Original entry on oeis.org

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

Views

Author

Alex Ratushnyak, Feb 21 2015

Keywords

Examples

			8 = 2*2 + 2 + 2, this is the only representation, so a(8)=1.
23 = 2*7 + 2 + 7 = 3*5 + 3 + 5, two representations, so a(23)=2.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := (r = Reduce[x >= y > 1 && n == x*y + x + y, {x, y}, Integers]; Which[r[[0]] === And, 1, r[[0]] === Or, Length[r], True, 0]);
    Table[a[n], {n, 0, 105}] (* Jean-François Alcover, Jan 23 2018 *)
  • PARI
    a(n) = {nb = 0; for (y=2, n\2, for (x=y, n\2, nb += ((x*y+x+y) == n););); nb;} \\ Michel Marcus, Feb 22 2015
  • Python
    TOP = 1000
    a = [0]*TOP
    for y in range(2, TOP//2):
        for x in range(y, TOP//2):
            k = x*y + x + y
            if k>=TOP: break
            a[k]+=1
    print(a)
    
  • Python
    from sympy import divisor_count
    def A255361(n): return int((divisor_count(n+1)-1>>1)-(n&1)) if n!=1 else 0 # Chai Wah Wu, Oct 15 2024
    

Formula

Let d = A000005; then a(n) = floor((d(n+1) - 1)/2) for even n and a(n) = floor((d(n+1) - 3) / 2) for odd n>1. - Ivan Neretin, Sep 07 2015

Extensions

More terms from Antti Karttunen, Sep 22 2017

A259124 If n is representable as x*y+x+y, with x>=y>1, then a(n) is the sum of all x's and y's in all such representations. Otherwise a(n)=0.

Original entry on oeis.org

0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 5, 0, 0, 6, 6, 0, 7, 0, 7, 8, 0, 0, 17, 8, 0, 10, 9, 0, 20, 0, 10, 12, 0, 10, 34, 0, 0, 14, 23, 0, 26, 0, 13, 28, 0, 0, 43, 12, 13, 18, 15, 0, 32, 14, 29, 20, 0, 0, 67, 0, 0, 36, 32, 16, 38, 0, 19, 24, 32, 0, 76, 0, 0, 44, 21, 16, 44, 0, 57, 44
Offset: 1

Views

Author

Alex Ratushnyak, Jun 18 2015

Keywords

Comments

The sequence of numbers that never appear in a(n) begins: 1, 2, 3, 11, 27, 35, 51, 53, 79, 83, 89, 93, 117, 123, 125, 135, 143, 145.
The indices n at which a(n)=0 are in A254636. - Vincenzo Librandi, Jul 16 2015

Examples

			11 = 3*2 + 3 + 2, so a(11)=5.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local D,d;
          D:= select(t -> (t >= 3 and t^2 <= n+1), numtheory:-divisors(n+1));
          add(d + (n+1)/d - 2, d = D);
    end proc:
    map(f, [$1..100]); # Robert Israel, Aug 05 2015
  • Mathematica
    a[n_] := Sum[Boole[3 <= d <= Sqrt[n+1]] (d+(n+1)/d-2), {d, Divisors[n+1]}];
    Array[a, 100] (* Jean-François Alcover, Jun 08 2020, after Maple *)
  • PARI
    a(n)=sum(y=2,sqrtint(n+1)-1, my(x=(n-y)/(y+1)); if(denominator(x)==1, x+y)) \\ Charles R Greathouse IV, Jun 29 2015
  • Python
    TOP = 100
    a = [0]*TOP
    for y in range(2, TOP//2):
      for x in range(y, TOP//2):
        n = x*y + x + y
        if n>=TOP: break
        a[n] += x+y
    print(a[1:])
    
  • Python
    from sympy import divisors
    def A259124(n):
        m, c = n+1, 0
        for d in divisors(m):
            if d**2>m:
                break
            if d>=3:
                c += d+m//d-2
        return c # Chai Wah Wu, Oct 15 2024
    

Formula

a(n) = Sum({d: d | n+1 and 3 <= d <= sqrt(n+1)}, d + (n+1)/d - 2). - Robert Israel, Aug 05 2015

A256386 Numbers m such that m-2, m-1, m+1, m+2 cannot all be represented in the form x*y + x + y for values x, y with x >= y > 1.

Original entry on oeis.org

2, 3, 4, 5, 8, 11, 59, 1319, 1619, 4259, 5099, 6659, 6779, 11699, 12539, 21059, 66359, 83219, 88259, 107099, 110879, 114659, 127679, 130199, 140759, 141959, 144539, 148199, 149519, 157559, 161339, 163859, 175079, 186479, 204599, 230939, 249539, 267959, 273899, 312839
Offset: 1

Views

Author

Alex Ratushnyak, Mar 31 2015

Keywords

Comments

Indices of terms surrounded by pairs of zeros in A255361.
Conjectures:
1. A255361(a(n)) > 0 for n > 4.
2. All terms > 8 are primes.
3. All terms > 8 are terms of these supersequences: A118072, A171667, A176821, A181602, A181669.
From Lamine Ngom, Feb 12 2022: (Start)
For n > 4, a(n) is not a term of A254636. This means that a(n)-2, a(n)-1, a(n)+1 and a(n)+2 are adjacent terms in A254636.
Number of terms < 10^k: 5, 7, 7, 13, 19, 96, 441, 2552, ...
Conjecture 2 would follow if we establish the equivalence "t is in sequence" <=> "t is a term of b(n): lesser of twin primes pair p and q such that (p - 1)/2 and (q + 1)/2 are also a pair of twin primes (A077800)".
It appears that b(n) = a(n) for n > 5. Verified for all terms < 10^9. (End)

Examples

			9, 10, 12, 13 cannot be represented as x*y + x + y, where x >= y > 1. Therefore 11 is in the sequence.
		

Crossrefs

Formula

a(n) = A158870(n-5) - 2, n > 5 (conjectured). - Lamine Ngom, Feb 12 2022

A256072 Primes that cannot be represented as x*y + x + y, where x >= y > 1.

Original entry on oeis.org

2, 3, 5, 7, 13, 37, 61, 73, 157, 193, 277, 313, 397, 421, 457, 541, 613, 661, 673, 733, 757, 877, 997, 1093, 1153, 1201, 1213, 1237, 1321, 1381, 1453, 1621, 1657, 1753, 1873, 1933, 1993, 2017, 2137, 2341, 2473, 2557, 2593, 2797, 2857, 2917, 3061, 3217, 3253, 3313
Offset: 1

Views

Author

Alex Ratushnyak, Mar 14 2015

Keywords

Comments

Primes in A254636.

Crossrefs

Programs

  • PARI
    v=[];for(m=2,500,for(k=m,500,if(isprime(P=k*m+k+m),v=concat(v,P))));v=vecsort(v,,8);forprime(p=1,2000,if(!vecsearch(v,p),print1(p,", "))) \\ Derek Orr, Mar 21 2015
  • Python
    import sympy
    from sympy import isprime
    TOP = 10000
    a = [0]*TOP
    for y in range(2, TOP//2):
      for x in range(y, TOP//2):
        k = x*y + x + y
        if k>=TOP: break
        a[k]+=1
    print([n for n in range(TOP) if a[n]==0 and isprime(n)])
    

Formula

{2, 7} UNION A005383 = {7} UNION A079147. - Chai Wah Wu, Oct 15 2024

A358571 Lesser p of a sexy prime pair such that (p-3)/2 is also the lesser prime of a sexy prime pair.

Original entry on oeis.org

13, 17, 37, 97, 457, 557, 1117, 1217, 1297, 2237, 2377, 2897, 4937, 7237, 9277, 10457, 18797, 21317, 23557, 24077, 27817, 29437, 30757, 34757, 38917, 39157, 48157, 48817, 50497, 55897, 60617, 62297, 64997, 72617, 81157, 82457, 90017, 94597, 107837, 108877, 111857
Offset: 1

Views

Author

Lamine Ngom, Nov 23 2022

Keywords

Comments

Equivalently, sums of the form (sexy primes - 3) which are also the lesser prime of a sexy prime pair.
Also numbers m such that m-4, m-1, m+5 and m+8 cannot be represented as x*y + x + y, with x >= y > 1 (A254636).
More generally, any sequence of numbers m such that A254636(m - 2*k - 2), A254636(m - 1), A254636(m + 4*k + 1) and A254636(m + 6*k + 2) are all 0 will only provide prime numbers which are lesser of a pair of primes (p, q) such that the pair (r, s) forms also a pair of primes, where q = p + 2*(2*k + 1), r = (p - 2*k - 1)/2, and s = (q + 2*k + 1)/2. Obviously, s - r = q - p = 2*(2*k + 1).
For k = 0, we get sequence A256386 (starting from its 6th term).
For k = 1, this sequence.
For k = 2, sequence starts: 19, 31, 43, 79, 127, 163, 283, 547, 751, 919, ...
For k = 3, sequence starts: 17, 53, 113, 593, 773, 1553, 1733, 1973, 4013, ...
For k = 4, sequence starts: 19, 131, 431, 811, 991, 2111, 5431, 6011, 10771, ...
etc.
For n > 1, a(n) is congruent to 17 modulo 20.
Number of terms < 10^k: 0, 4, 6, 15, 38, 167, 934, 5091, 30229, ...

Examples

			97 is the lesser in the sexy prime pair (97, 103), and the pair of (97-3)/2 and (103+3)/2 yields another sexy prime pair: (47, 53). Hence 97 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[11000]], AllTrue[Join[{#+6}, (#-3)/2 + {0,6}], PrimeQ]&] (* Amiram Eldar, Nov 23 2022 *)
  • PARI
    isok1(p) = isprime(p) && isprime(p+6); \\ A023201
    isok(p) = isok1(p) && isok1((p-3)/2); \\ Michel Marcus, Nov 23 2022

A256230 Numbers n such that neither n nor 2*n is representable as x*y+x+y, where x>=y>1.

Original entry on oeis.org

0, 1, 2, 3, 5, 6, 9, 18, 21, 30, 33, 36, 78, 81, 96, 105, 138, 141, 156, 165, 198, 210, 228, 261, 270, 273, 306, 330, 336, 345, 366, 378, 393, 438, 453, 498, 525, 546, 561, 576, 585, 600, 606, 618, 660, 690, 726, 765, 810, 828, 861, 876, 933, 936, 966, 996, 1005, 1008
Offset: 1

Views

Author

Alex Ratushnyak, Mar 19 2015

Keywords

Crossrefs

Cf. A064238 (also 3*n cannot be represented as x*y+x+y, x>=y>1).
Cf. A237189 (also 3*n and 4*n cannot be represented as x*y+x+y, x>=y>1).

Programs

  • Python
    TOP = 2200
    a = [0]*TOP
    for y in range(2, TOP//2):
      for x in range(y, TOP//2):
        k = x*y + x + y
        if k>=TOP: break
        a[k]=1
    print([n for n in range(TOP//2) if a[n]==0 and a[2*n]==0])

A358572 Smallest prime p in a sexy prime triple such that (p-3)/2 is also the smallest prime in a sexy prime triple (A023241).

Original entry on oeis.org

17, 97, 1117, 1217, 2897, 130337, 188857, 207997, 221197, 324517, 610817, 900577, 1090877, 1452317, 1719857, 1785097, 2902477, 3069917, 3246317, 4095097, 4536517, 4977097, 5153537, 5517637, 5745557, 6399677, 7168277, 7351957, 7588697, 7661077, 8651537, 8828497, 9153337
Offset: 1

Views

Author

Lamine Ngom, Nov 23 2022

Keywords

Comments

Also numbers m such that m-4, m-1, m+5, m+8, m+11 and m+20 cannot be represented as x*y + x + y, with x >= y > 1 (A254636).
Subsequence of A358571.
Number of terms < 10^k: 0, 2, 2, 5, 5, 12, 34, 150, 655, ...
All terms p and (p-3)/2 have a final decimal digit of 7. This follows from considering possibilities modulo 10 and implies p + 18 and (p-3)/2 + 18 are divisible by 5 and hence composite. Both p and (p-3)/2 are therefore also terms of A046118. - Andrew Howroyd, Dec 31 2022

Examples

			97 is the smallest prime in the sexy prime triple (97, 103, 109), and the triple (47 = (97 - 3)/2, 47 + 6, 47 + 12) forms another sexy prime triple. Hence 97 is in the sequence.
		

Crossrefs

Programs

  • Mathematica
    Select[Prime[Range[700000]], AllTrue[Join[# + {6,12}, (#-3)/2 + {0, 6, 12}], PrimeQ] &] (* Amiram Eldar, Nov 23 2022 *)
  • PARI
    istriple(p)={isprime(p) && isprime(p+6) && isprime(p+12)}
    isok(p)={istriple(p) && istriple((p-3)/2)}
    { forprime(p=1,10^7,if(isok(p), print1(p, ", "))) } \\ Andrew Howroyd, Dec 30 2022

A358573 a(n) = smallest prime p such that q, r and s are all prime, where q = p + 2*(2*n + 1), r = (p - 2*n - 1)/2, and s = (q + 2*n + 1)/2.

Original entry on oeis.org

11, 13, 19, 17, 19, 229, 47, 29, 163, 29, 31, 37, 47, 53, 1231, 41, 43, 61, 83, 61, 439, 1217, 59, 73, 59, 61, 67, 89, 83, 541, 71, 73, 103, 593, 271, 349, 83, 89, 103, 461, 239, 97, 107, 97, 211, 149, 107, 229, 263, 181, 499, 317, 139, 1453, 131, 809, 127, 137, 163
Offset: 0

Views

Author

Lamine Ngom, Nov 23 2022

Keywords

Comments

Equivalently, smallest prime of the form (p + q - 2*n - 1), where p is prime, q = p + 2*(2*n + 1) is prime, and (p + q + 2*n + 1) is also prime.
a(n) is the first term of the sequence of numbers m such that (m - 2*n - 2), (m - 1), (m + 4*n + 1) and (m + 6*n + 2) cannot be represented as x*y + x + y, with x >= y > 1 (A254636).
Such sequence contains only prime numbers which are the lesser of a pair of primes (p, q) such that the pair (r, s) also forms a pair of primes with the same difference, where q = p + 2*(2*n + 1), r = (p - 2*n - 1)/2, and s = (q + 2*n + 1)/2.

Examples

			229 is the lesser prime in the pair (229, 251) with difference 2*(2*5+1) = 22, and the couple (229-22/2)/2 = 109 and (251+22/2)/2 = 131 forms another prime pair with distance 22, and there is no prime lower than 229 with this property. Hence a(5) = 229.
		

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{p=2, q, r, s}, While[!AllTrue[{(q = p + 2*(2*n + 1)), (r = (p - 2*n - 1)/2), (s = (q + 2*n + 1)/2)}, #>0 && PrimeQ[#] &], p = NextPrime[p]]; p]; Array[a, 60, 0] (* Amiram Eldar, Nov 23 2022 *)
  • PARI
    a(n) = my(p=2, q); while(!isprime(q = p + 2*(2*n + 1)) || !isprime((p - 2*n - 1)/2) || !isprime((q + 2*n + 1)/2), p=nextprime(p+1)); p; \\ Michel Marcus, Nov 23 2022
Showing 1-9 of 9 results.