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 21-30 of 32 results. Next

A285120 Min(|d(k+1-i) - d(i)|, for i = 1..k), where d(1),..,d(k) are the divisors of n(n+1)/2.

Original entry on oeis.org

0, 2, 1, 3, 2, 4, 3, 0, 4, 6, 5, 7, 6, 8, 2, 9, 8, 10, 9, 1, 10, 12, 11, 5, 12, 14, 3, 15, 14, 16, 15, 2, 16, 18, 9, 19, 18, 20, 4, 21, 20, 22, 21, 3, 22, 24, 23, 14, 0, 26, 5, 27, 26, 12, 9, 4, 28, 30, 29, 31, 30, 32, 6, 12, 16, 34, 33, 5, 34, 36, 35, 37
Offset: 1

Views

Author

Clark Kimberling, Apr 11 2017

Keywords

Examples

			7(7+1)/2 = 28 has divisors 1,2,4,7,14,28, so that k=6 and d(k+1-i) - d(i) ranges through {-27,-12,-3,3,12,27}, so that a(7) = 3.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = n(n+1)/2;
    Table[Divisors[f[n]] - Reverse[Divisors[f[n]]], {n, 1, 10}]
    Table[Min[Abs[Divisors[f[n]] - Reverse[Divisors[f[n]]]]], {n, 1, 100}]

Formula

a(n)=A056737(A000217(n)).

A285121 Min(|d(k+1-i) - d(i)|, for i = 1..k), where d(1),..,d(k) are the divisors of n*(n+1)*(n+2)/6.

Original entry on oeis.org

0, 0, 3, 1, 2, 1, 5, 2, 4, 9, 9, 12, 22, 8, 14, 10, 32, 8, 3, 9, 54, 2, 4, 2, 20, 11, 5, 12, 114, 18, 26, 20, 8, 1, 31, 35, 210, 9, 48, 58, 244, 68, 19, 17, 26, 90, 90, 0, 56, 40, 115, 3, 6, 3, 36, 51, 492, 91, 173, 89, 34, 25, 2, 12, 192, 81, 257, 8
Offset: 1

Views

Author

Clark Kimberling, Apr 11 2017

Keywords

Examples

			6(6+1)(6+2)/6 = 56 has divisors 1,2,4,7,8,14,28,56, so that k=8 and d(k+1-i) - d(i) ranges through {-55, -26, -10, -1, 1, 10, 26, 55}, so that a(6) = 1.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = n(n+1)(n+2)/6;
    Table[Divisors[f[n]] - Reverse[Divisors[f[n]]], {n, 1, 10}]
    Table[Min[Abs[Divisors[f[n]] - Reverse[Divisors[f[n]]]]], {n, 1, 100}]

Formula

a(n) = A056737(A000292(n)).

Extensions

Two extraneous 0's removed by Pontus von Brömssen, Jul 15 2023

A285122 Min(|d(k+1-i) - d(i)|, for i = 1..k), where d(1),..,d(k) are the divisors of n^2+1.

Original entry on oeis.org

1, 4, 3, 16, 11, 36, 5, 8, 39, 100, 59, 24, 7, 196, 111, 256, 19, 12, 179, 400, 9, 92, 43, 576, 311, 676, 63, 152, 419, 36, 11, 16, 99, 76, 611, 1296, 127, 68, 759, 1600, 29, 348, 13, 136, 1011, 44, 31, 456, 1199, 20, 1299, 536, 271, 2916, 55, 3136, 15, 668
Offset: 1

Views

Author

Clark Kimberling, Apr 11 2017

Keywords

Examples

			5^2 + 1 = 26 has divisors 1,2,13,26, so that k=4 and d(k+1-i) - d(i) ranges through {-25,-11,11,25}, so that a(5) = 11.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = n^2+1; Table[Divisors[f[n]] - Reverse[Divisors[f[n]]], {n, 1, 10}]
    Table[Min[Abs[Divisors[f[n]] - Reverse[Divisors[f[n]]]]], {n, 1, 100}]

Formula

a(n)=A056737(A002522(n)).

A285123 Min(|d(k+1-i) - d(i)|, for i = 1..k), where d(1),..,d(k) are the divisors of prime(n) - 1.

Original entry on oeis.org

0, 1, 0, 1, 3, 1, 0, 3, 9, 3, 1, 0, 3, 1, 21, 9, 27, 4, 5, 3, 1, 7, 39, 3, 4, 0, 11, 51, 3, 6, 5, 3, 9, 17, 33, 5, 1, 9, 81, 39, 87, 3, 9, 4, 0, 7, 1, 31, 111, 7, 21, 3, 1, 15, 0, 129, 63, 3, 11, 6, 41, 69, 1, 21, 11, 75, 7, 5, 171, 17, 6, 177, 55, 19, 3
Offset: 1

Views

Author

Clark Kimberling, Apr 11 2017

Keywords

Examples

			prime(6) - 1 = 12 has divisors 1,2,3,4,6,12, so that k=6 and d(k+1-i) - d(i) ranges through {-11, -4, -1, 1, 4, 11}, so that a(6) = 1.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = Prime[n]-1;
    Table[Divisors[f[n]] - Reverse[Divisors[f[n]]], {n, 1, 10}]
    Table[Min[Abs[Divisors[f[n]] - Reverse[Divisors[f[n]]]]], {n, 1, 100}]

Formula

a(n)=A056737(A000578(n)).

A285124 Min(|d(k+1-i) - d(i)|, for i = 1..k), where d(1),..,d(k) are the divisors of prime(n) + 1.

Original entry on oeis.org

2, 0, 1, 2, 1, 5, 3, 1, 2, 1, 4, 17, 1, 7, 2, 3, 4, 29, 13, 1, 35, 2, 5, 1, 7, 11, 5, 3, 1, 13, 8, 1, 17, 4, 5, 11, 77, 37, 2, 23, 3, 1, 4, 95, 7, 10, 49, 2, 7, 13, 5, 1, 11, 4, 37, 10, 3, 1, 137, 41, 67, 7, 8, 11, 155, 47, 79, 13, 17, 11, 53, 2, 7, 5, 1, 8
Offset: 1

Views

Author

Clark Kimberling, Apr 11 2017

Keywords

Examples

			prime(6) + 1 = 14 has divisors 1,2,7,14, so that k=4 and d(k+1-i) - d(i) ranges through {--13,-5,5,13}, so that a(6) = 5.
		

Crossrefs

Programs

  • Mathematica
    f[n_] := f[n] = Prime[n]+1;
    Table[Divisors[f[n]] - Reverse[Divisors[f[n]]], {n, 1, 10}]
    Table[Min[Abs[Divisors[f[n]] - Reverse[Divisors[f[n]]]]], {n, 1, 100}]

Formula

a(n)=A056737(A008864(n)).

A323728 a(n) is the smallest number k such that both k-2*n and k+2*n are squares.

Original entry on oeis.org

2, 5, 10, 8, 26, 13, 50, 20, 18, 29, 122, 25, 170, 53, 34, 32, 290, 45, 362, 41, 58, 125, 530, 52, 50, 173, 90, 65, 842, 61, 962, 80, 130, 293, 74, 72, 1370, 365, 178, 89, 1682, 85, 1850, 137, 106, 533, 2210, 100, 98, 125, 298, 185, 2810, 117, 146, 113, 370
Offset: 1

Views

Author

Daniel Suteu, Jan 25 2019

Keywords

Comments

When n is a prime number, a(n) is greater than all the previous terms.
If n = 4*x*y, then a(n) is the smallest integer solution of the form 4*(x^2 + y^2), with rational values x and y.

Examples

			For n = 3, a(3) = 10, which is the smallest integer k such that k+2*n and k-2*n are both squares: 10+2*3 = 4^2 and 10-2*3 = 2^2.
For n=1..10, the following {a(n)-2*n, a(n)+2*n} pairs of squares are produced: {0, 4}, {1, 9}, {4, 16}, {0, 16}, {16, 36}, {1, 25}, {36, 64}, {4, 36}, {0, 36}, {9, 49}.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) local d;
    d:= max(select(t -> t^2 <= n, numtheory:-divisors(n)));
    d^2 + (n/d)^2
    end proc:
    map(f, [$1..100]); # Robert Israel, Feb 17 2019
  • Mathematica
    Array[Block[{k = 1}, While[Nand @@ Map[IntegerQ, Sqrt[k + 2 {-#, #}]], k++]; k] &, 57] (* Michael De Vlieger, Feb 17 2019 *)
  • PARI
    a(n) = for(k=2*n, oo, if(issquare(k+2*n) && issquare(k-2*n), return(k)));
    
  • PARI
    a(n) = my(d=divisors(n)); vecmin(vector(#d, k, 4*((d[k]/2)^2 + (n/d[k]/2)^2)));

Formula

a(n^2) = 2 * n^2.
a(p) = p^2 + 1, for p prime.
a(n) = A063655(n)^2 - 2*n.
a(n) = A056737(n)^2 + 2*n.
a(n!) = A061057(n)^2 + 2*n!.
a(n) = A033676(n)^2 + A033677(n)^2. - Robert Israel, Feb 17 2019
a(n) = Min_{d|n} ((n/d)^2 + d^2). - Ridouane Oudra, Mar 17 2024

A330879 Numbers with a divisor pair (d,n/d) such that the smallest prime greater than d and n/d is the same.

Original entry on oeis.org

1, 4, 9, 12, 16, 25, 30, 36, 49, 56, 63, 64, 70, 72, 80, 81, 90, 100, 121, 132, 144, 169, 182, 195, 196, 208, 210, 224, 225, 240, 256, 289, 306, 324, 361, 380, 399, 400, 418, 420, 440, 441, 462, 484, 529, 552, 575, 576, 598, 600, 621, 624, 625, 644, 648, 650, 672
Offset: 1

Views

Author

Wesley Ivan Hurt, Apr 30 2020

Keywords

Comments

For n > 0, A000290(n) is a term. - Ivan N. Ianakiev, May 03 2020
For nonsquares, d is the tau(n)/2-th divisor of n. - David A. Corneth, May 03 2020

Examples

			9 is in the sequence since it has the divisor pair (3,3) with each divisor sharing the same next prime, which is 5.
12 is in the sequence since it has the divisor pair (3,4) and both 3 and 4 have 5 as their next prime.
		

Crossrefs

Programs

  • Mathematica
    Table[If[Sum[KroneckerDelta[NextPrime[i], NextPrime[n/i]] (1 - Ceiling[n/i] + Floor[n/i]), {i, n}] > 0, n, {}], {n, 500}] // Flatten
  • PARI
    isok(n) = fordiv(n, d, if (nextprime(d+1) == nextprime(n/d+1), return (1)); if (d>n/d, break)); \\ Michel Marcus, Apr 30 2020

A349708 a(n) is the smallest positive number k such that (product of the first n odd primes) + k^2 is a square.

Original entry on oeis.org

1, 1, 4, 1, 19, 53, 58, 97, 181, 4244, 2122, 31126, 16451, 297392, 2444006, 622249, 2909047, 216182072, 62801719, 769709491, 32522441312, 37859955467, 129549407177, 286721160343, 101419856449, 107709289064864, 72441253480727, 56099073382147, 5249126879235893
Offset: 1

Views

Author

Richard Peterson, Dec 31 2021

Keywords

Comments

a(n) is half the difference between the middle two divisors of A070826(n + 1). - David A. Corneth, Jan 17 2022

Examples

			a(4)=1 because the product of the first 4 odd primes, 3*5*7*11 = 1155, is 34^2 - 1. a(5)=19 because 15015=3*5*7*11*13=124^2-19^2, and no positive integer less than 19 will work in this situation.
		

Crossrefs

Programs

  • PARI
    a(n) = my(k=1, p=prod(k=2, n+1, prime(k))); while (!issquare(k^2+p), k++); k; \\ Michel Marcus, Jan 10 2022
    
  • Python
    from math import isqrt
    from sympy import primorial, divisors
    def A349708(n):
        m = primorial(n+1)//2
        a = isqrt(m)
        d = max(filter(lambda d: d <= a, divisors(m,generator=True)))
        return (m//d-d)//2 # Chai Wah Wu, Mar 29 2022

Extensions

a(15)-a(26) and corrections to a(9) and a(11) from Jinyuan Wang, Jan 07 2022
a(27)-a(30) from Jon E. Schoenfield, Jan 16 2022

A350576 a(n) = n/A055874(n) - A055874(n).

Original entry on oeis.org

0, -1, 2, 0, 4, -1, 6, 2, 8, 3, 10, -1, 12, 5, 14, 6, 16, 3, 18, 8, 20, 9, 22, 2, 24, 11, 26, 12, 28, 7, 30, 14, 32, 15, 34, 5, 36, 17, 38, 18, 40, 11, 42, 20, 44, 21, 46, 8, 48, 23, 50, 24, 52, 15, 54, 26, 56, 27, 58, 4, 60, 29, 62, 30, 64, 19, 66, 32, 68, 33, 70, 14, 72, 35, 74
Offset: 1

Views

Author

Michel Marcus, Jan 07 2022, after a suggestion from Charles Kusniec

Keywords

Crossrefs

Cf. A005408 (odd numbers), A056737 (another difference n/d-d).

Programs

  • Mathematica
    a[n_] := Module[{k = 1}, While[Divisible[n, k], k++]; k--; n/k - k]; Array[a, 100] (* Amiram Eldar, Jan 07 2022 *)
  • PARI
    a4(n) = my(m=1); while ((n % m) == 0, m++); m - 1; \\ A055874
    a(n) = my(x=a4(n)); n/x - x;
    
  • Python
    def a(n):
        m = 2
        while n%m == 0: m += 1
        return n//(m-1) - (m-1)
    print([a(n) for n in range(1, 76)]) # Michael S. Branicky, Jan 07 2022

Formula

a(n) = A350509(n) - A055874(n).
a(n) = n-1 if n is odd.

A371597 a(n) is the sum of k where A063655(k) = n.

Original entry on oeis.org

0, 1, 2, 7, 6, 22, 22, 38, 52, 70, 58, 141, 104, 188, 230, 281, 260, 320, 374, 531, 526, 717, 566, 927, 756, 1017, 1114, 1203, 1148, 1799, 1402, 1741, 1718, 2170, 2314, 2765, 2400, 2912, 2800, 3769, 2856, 4577, 3352, 4923, 4410, 5054, 5036, 6346, 6246, 5537
Offset: 1

Views

Author

Adnan Baysal, Mar 28 2024

Keywords

Comments

Construct the same directed graph as in A369793. a(n) is the sum of vertices directed to the vertex n in this graph.

Examples

			a(1) = 0 since 1 does not exist in A063655.
a(2) = 1 because there is only one integral rectangle of area 1 with a minimal semiperimeter 2, which is the 1 X 1 square. So 2 appears only once in A063655 at index 1, which means a(2) = 1.
a(4) = 7, because only A063655(3) and A063655(4) have the value 4. For any n > 4, A063655(n) > 4, because A063655(n) > 2 * sqrt(n) > 2 * sqrt(4) = 4. Hence, 4 cannot appear in the rest of A063655.
		

Crossrefs

Programs

  • Python
    from sympy import divisors
    def A371597(n): return sum(m for m in range(1, (n**2>>2)+1) if (d:=divisors(m))[((l:=len(d))-1)>>1]+d[l>>1]==n)
Previous Showing 21-30 of 32 results. Next