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

A365248 Composite numbers k that are not a prime minus one, for which A214749(k) = k/2.

Original entry on oeis.org

34, 94, 118, 142, 202, 214, 246, 274, 298, 334, 394, 402, 436, 454, 514, 526, 538, 622, 628, 634, 694, 706, 712, 754, 766, 778, 802, 814, 892, 898, 922, 934, 942, 958, 1002, 1006, 1042, 1054, 1114, 1126, 1132, 1138, 1146, 1158, 1174, 1198, 1234, 1246, 1270
Offset: 1

Views

Author

Bob Andriesse, Aug 28 2023

Keywords

Comments

As can be seen from A214749, for most composites k that are not a prime minus one, the smallest value of m that satisfies k-m | k^2+m is smaller than k/2. This sequence lists the exceptions.

Crossrefs

Programs

  • PARI
    f(n) = my(m=1); while((n^2+m) % (n-m), m++); m; \\ A214749
    lista(nn) = my(list=List()); forcomposite(c=1, nn, if ((f(c) == c/2) && !isprime(c+1), listput(list, c))); Vec(list);  \\ Michel Marcus, Sep 08 2023
  • Python
    from sympy import isprime
    a=[]
    for n in range(2,1000):
      for m in range(1,n//2+1):
       if (n**2+m)%(n-m)==0:
        if m==n/2 and not isprime(n+1):
         a.append(n)
        break
    print(a)
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    from sympy.abc import x, y
    from sympy.solvers.diophantine.diophantine import diop_quadratic
    def A365248_gen(startvalue=2): # generator of terms >= startvalue
        return filter(lambda n:not isprime(n+1) and min(int(x) for x,y in diop_quadratic(n*(n-y)+x*(y+1)) if x>0)==n>>1, count(max(startvalue+startvalue&1,2),2))
    A365248_list = list(islice(A365248_gen(),30)) # Chai Wah Wu, Oct 06 2023
    

A365249 Composite numbers k for which A214749(k) = (k-1)/2.

Original entry on oeis.org

25, 85, 121, 133, 145, 187, 205, 217, 221, 253, 301, 325, 361, 385, 403, 437, 445, 451, 481, 505, 529, 533, 553, 565, 625, 667, 697, 721, 745, 793, 817, 841, 865, 893, 913, 925, 973, 985, 1003, 1027, 1037, 1045, 1057, 1073, 1081, 1141, 1157, 1165, 1207, 1225
Offset: 1

Views

Author

Bob Andriesse, Aug 28 2023

Keywords

Comments

As can be seen from A214749, for most odd composites k the smallest value of m that satisfies k-m | k^2+m is smaller than (k-1)/2. This sequence lists the exceptions. All the odd primes appear to satisfy A214749(p) = (p-1)/2.

Crossrefs

Programs

  • PARI
    f(n) = my(m=1); while((n^2+m) % (n-m), m++); m; \\ A214749
    lista(nn) = my(list=List()); forcomposite(c=1, nn, if (f(c) == (c-1)/2, listput(list, c))); Vec(list); \\ Michel Marcus, Sep 04 2023
  • Python
    from sympy import isprime
    a=[]
    for n in range(3,1000):
      for m in range(1,(n-1)//2+1):
       if (n**2+m)%(n-m)==0:
        if m==(n-1)/2 and not isprime(n):
         a.append(n)
        break
    print(a)
    
  • Python
    from itertools import count, islice
    from sympy import isprime
    from sympy.abc import x, y
    from sympy.solvers.diophantine.diophantine import diop_quadratic
    def A365249_gen(startvalue=3): # generator of terms >= startvalue
        return filter(lambda n:not isprime(n) and min(int(x) for x,y in diop_quadratic(n*(n-y)+x*(y+1)) if x>0)==n-1>>1, count(max(startvalue+startvalue&1^1,3),2))
    A365249_list = list(islice(A365249_gen(),30)) # Chai Wah Wu, Oct 06 2023
    

A214750 Least m > 0 such that n - m divides n^2 + m^2.

Original entry on oeis.org

1, 1, 2, 3, 2, 5, 4, 3, 2, 9, 3, 11, 6, 5, 8, 15, 6, 17, 4, 3, 11, 21, 6, 15, 13, 9, 12, 27, 5, 29, 16, 11, 17, 10, 4, 35, 19, 13, 8, 39, 6, 41, 12, 15, 23, 45, 12, 35, 10, 17, 20, 51, 18, 5, 7, 19, 29, 57, 10, 59, 31, 9, 32, 15, 22, 65, 34, 23, 14, 69, 8, 71, 37, 25, 38
Offset: 2

Views

Author

Clark Kimberling, Jul 29 2012

Keywords

Comments

It appears that this is the sequence of k's for A110357. - Michel Marcus, Aug 16 2019
If n-m = s, then n = s+m and n-m | n^2+m^2 is equivalent to s | (s^2 + 2*s*m + 2*m^2). So n-m | n^2+m^2 is equivalent to n-m | 2*m^2. If n-k = s, then n = s+k and n-k | n*(n+k) is equivalent to s | (s^2 + 3*s*k + 2*k^2). So n-k | n*(n+k) is equivalent to n-k | 2*k^2. Therefore n-m | n^2+m^2 is equivalent to n-k | n*(n+k) and the k's from A110357 and the m's from this sequence are the same. - Bob Andriesse, Dec 26 2022
Let n-m = s; then m = n-s and n-m | n^2 + m^2 is equivalent to s | n^2 + (n-s)^2 or s | 2*n^2. If n is an odd prime, s must be 2. So if n is an odd prime, a(n) = m = n-2. Examples: a(7) = 5, a(11) = 9. - Bob Andriesse, Jul 13 2023

Examples

			Write x#y if x|y is false; then 7#65, 6#68, 5#73, 4|80, so a(8) = 4.
For n = 11, A110357(11) = 110 and a(11) = H(11, 110) - 11 = 20 - 11 = 9. - _Bob Andriesse_, Jan 03 2023
		

Crossrefs

Programs

  • Mathematica
    Table[m = 1; While[! Divisible[n^2+m^2,n-m], m++]; m, {n, 2, 100}]
  • PARI
    a(n) = my(m=1); while(denominator((n^2+m^2)/(n-m)) != 1, m++); m; \\ Michel Marcus, Aug 16 2019
    
  • Python
    from sympy.abc import x, y
    from sympy.solvers.diophantine.diophantine import diop_quadratic
    def A214750(n): return min(int(x) for x,y in diop_quadratic(n*(n-y)+x*(y+x)) if x>0) # Chai Wah Wu, Oct 06 2023

Formula

a(n) = H(n, A110357(n)) - n where H is the harmonic mean. - Bob Andriesse, Jan 03 2023
Showing 1-3 of 3 results.