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-6 of 6 results.

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

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

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 9, 12, 21, 36, 45, 57, 60, 72, 81, 105, 156, 165, 177, 192, 225, 261, 276, 312, 345, 357, 381, 396, 420, 456, 465, 477, 501, 540, 561, 585, 612, 660, 672, 717, 732, 756, 837, 861, 876, 885, 981, 996, 1017, 1092, 1152, 1185, 1200, 1212, 1236, 1281
Offset: 1

Views

Author

Alex Ratushnyak, Feb 21 2015

Keywords

Comments

Indices of double zeros in A255361.

Crossrefs

Cf. A255361.

Programs

  • PARI
    iszero(n) = {for (y=2, n\2, for (x=y, n\2, if ((x*y+x+y) == n, return(0)););); return (1);}
    isok(n) = iszero(n) && iszero(n+1); \\ Michel Marcus, Feb 22 2015
  • Python
    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-1) if a[n]==0 and a[n+1]==0])
    

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

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-6 of 6 results.