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.

A145701 Lesser p of twin primes (p,q) such that there exists an integer between sqrt(2p) and sqrt(2q).

Original entry on oeis.org

3, 11, 17, 59, 71, 179, 311, 419, 881, 1151, 2111, 2591, 3119, 3527, 4049, 5099, 15137, 20807, 21011, 21839, 24419, 30011, 34847, 37811, 41759, 44699, 46817, 60899, 68819, 69191, 83231, 83639, 86111, 100799, 103967, 112337, 135719, 143111
Offset: 1

Views

Author

Vladimir Shevelev, Oct 16 2008

Keywords

Comments

The n-th prime p_n is in the sequence iff A145236(n) = A145236(n+1).

Crossrefs

Programs

  • Mathematica
    okQ[n_]:=Last[n]-First[n]==2&&Floor[Sqrt[2Last[n]]]>Sqrt[2First[n]]; Transpose[Select[Partition[Prime[Range[13300]],2,1],okQ]][[1]] (* Harvey P. Dale, Oct 26 2011 *)

Extensions

Extended by R. J. Mathar, Aug 02 2010

A145281 a(n) is the least prime such that (ceiling(sqrt(a(n)*p_n)))^2 - a(n)*p_n is a perfect square, where p_n is the n-th prime.

Original entry on oeis.org

2, 3, 3, 3, 5, 5, 11, 11, 13, 17, 19, 23, 29, 29, 31, 37, 41, 41, 47, 53, 53, 59, 61, 67, 73, 79, 79, 83, 83, 89, 101, 101, 107, 109, 127, 127, 127, 131, 137, 139, 149, 149, 157, 157, 163, 163, 173, 191, 191, 191, 193, 199, 211, 211, 223, 223, 227, 227, 233, 239
Offset: 1

Views

Author

Vladimir Shevelev, Oct 06 2008, Oct 07 2008

Keywords

Comments

Theorem. p_n - 2*sqrt(2p_n) + 2= A145236(n).
Or a(n) is the least prime q_n <= p_n such that sqrt(p_n) - sqrt(q_n) < sqrt(2) [or (p_n + q_n)/2 < sqrt(p_n*q_n) + 1]. See also our comment to A145300. - Vladimir Shevelev, Oct 09 2008
The above conjecture is true. This means that a(n) is the nearest prime p > p_n - 2*floor(sqrt(2*p_n)) + 2. A considerably more important and deep question is whether p < p_n. The answer does not follow even from the Riemann conjecture about zeros of the zeta function. - Vladimir Shevelev, Oct 17 2008

Crossrefs

Programs

  • PARI
    a(n) = {my(p = prime(n)); my(q = 2); while (! issquare(ceil(sqrt(q*p))^2 - q*p), q = nextprime(q+1)); q;} \\ Michel Marcus, Jul 06 2015

Extensions

More terms from Michel Marcus, Jul 06 2015

A145300 a(n) is the maximal prime such that if p_n is the n-th prime then ceiling(sqrt(a(n)*p_n))^2 - a(n)*p_n is a perfect square.

Original entry on oeis.org

2, 7, 13, 13, 19, 23, 29, 31, 37, 43, 47, 53, 61, 61, 67, 73, 79, 83, 89, 89, 97, 103, 109, 113, 113, 131, 131, 137, 139, 139, 157, 163, 167, 173, 181, 181, 193, 199, 199, 211, 211, 211, 229, 233, 233, 239, 251, 263, 271, 271, 277, 283, 283, 293, 293, 307, 317, 317, 317, 317
Offset: 1

Views

Author

Vladimir Shevelev, Oct 06 2008

Keywords

Comments

Theorem. a(n) <= p_n + 2*sqrt(2*p_n) + 2. For example, for n=25, p_n=97. Using the theorem, we find: a(25) <= 126. Now, by the definition of the sequence, we verify that a(25)=113.
Or a(n) is the maximal prime q_n > p_n such that sqrt(q_n)-sqrt(p_n) < sqrt(2) [or (p_n+q_n)/2 < sqrt(p_n*q_n)+1]. I conjecture that lim_{n->infinity} (sqrt(q_n) - sqrt(p_n)) = sqrt(2). Note that in the considered case this conjecture is equivalent to the following: lim_{n->infinity} fract(sqrt(p_n*q_n)) = 0, where fract(x) denotes the fractional part of x. - Vladimir Shevelev, Oct 09 2008

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{pmax = 0, pn = Prime[n]}, p=2; While[p <= pn + 2*Floor[Sqrt[2*pn]] + 2, If[IntegerQ[Sqrt[Ceiling[Sqrt[p*pn]]^2-p*pn]], pmax = p]; p=NextPrime[p]]; pmax]; Array[a, 60] (* Amiram Eldar, Dec 16 2018 from the PARI code *)
  • PARI
    a(n) = {my (pmax = 0, pn = prime(n)); forprime(p=2, pn+2*sqrtint(2*pn)+2, if (issquare((ceil(sqrt(p*pn)))^2-p*pn), pmax = p);); pmax;} \\ Michel Marcus, Dec 16 2018

Extensions

More terms from Michel Marcus, Dec 16 2018

A145714 a(n) = ceiling(sqrt(2*A145701(n))).

Original entry on oeis.org

3, 5, 6, 11, 12, 19, 25, 29, 42, 48, 65, 72, 79, 84, 90, 101, 174, 204, 205, 209, 221, 245, 264, 275, 289, 299, 306, 349, 371, 372, 408, 409, 415, 449, 456, 474, 521, 535, 546, 569, 571, 575, 594
Offset: 1

Views

Author

Vladimir Shevelev, Oct 16 2008

Keywords

Comments

If p_n is the n-th prime, then ceiling(sqrt(2p_n)) is in the sequence iff A145236(n) = A145236(n+1).

Crossrefs

Programs

  • Maple
    A145701 :=proc(n) local p; if n = 1 then return 3; end if; p := nextprime(procname(n-1)) ; while true do if isprime(p) and isprime(p+2) then if floor(sqrt(2*p)) <> floor( sqrt(2*p+4)) then return p; end if; end if; p := nextprime(p) ; end do; end proc:
    A145714 := proc(n) ceil(sqrt(2*A145701(n))) ; end proc:
    for n from 1 to 80 do printf("%d,\n",A145714(n)) ; end do; # R. J. Mathar, Aug 02 2010

Extensions

More terms from R. J. Mathar, Aug 02 2010

A249298 Smallest positive integer k, such that s-k*n is a square where s is the smallest square >= k*n.

Original entry on oeis.org

1, 2, 1, 1, 1, 2, 3, 1, 1, 4, 5, 1, 5, 6, 1, 1, 9, 2, 9, 2, 1, 12, 13, 1, 1, 14, 1, 3, 17, 2, 19, 1, 3, 20, 1, 1, 23, 24, 3, 1, 25, 2, 27, 6, 1, 30, 31, 1, 1, 2, 3, 7, 35, 4, 1, 2, 3, 40, 41, 1, 41, 42, 1, 1, 1, 4, 47, 10, 5, 2, 51, 1, 51, 52, 3, 12, 1, 6, 57, 1, 1, 60, 61, 1, 3, 62, 7, 3, 65, 2
Offset: 1

Views

Author

Valtteri Raiko, Oct 24 2014

Keywords

Comments

For any n>=3, there exists at least one positive integer k, 1 <= k <= n-1 such that the difference between the smallest square >= k*n and k*n is a square. To prove this, consider the multiplier k = n-2. Then (n-2)*n = (n-1)^2-1, thus the difference from the next square is 1, which is a square. If n = 1, k = 1 and if n = 2, k = 2.
Smallest positive integer k such that ceiling(sqrt(k*n))^2-k*n is a square.

Examples

			a(10) = 4, for ceiling(sqrt(10))^2-10 = 6, ceiling(sqrt(2*10))^2-2*10 = 5, ceiling(sqrt(3*10))^2-3*10 = 6 and ceiling(sqrt(4*10))^2-4*10 = 9 = 3^2.
		

Crossrefs

Cf. A000290, A145236 (equals a(A000040)), A068527 (difference for k=1).

Programs

  • Mathematica
    dif[n_] := Ceiling[Sqrt[n]]^2 - n;a[k_] := Module[{n = 1}, While[dif[dif[n*k]] != 0, n++]; Return[n]];Table[a[k], {k, 1, 90}]
  • PARI
    a(n) = {k=1; while(!issquare(ceil(sqrt(k*n))^2-k*n), k++); k;} \\ Michel Marcus, Oct 24 2014

A256173 Numbers k such that ceiling(sqrt(k))^2 - k is a square.

Original entry on oeis.org

0, 1, 3, 4, 5, 8, 9, 12, 15, 16, 21, 24, 25, 27, 32, 35, 36, 40, 45, 48, 49, 55, 60, 63, 64, 65, 72, 77, 80, 81, 84, 91, 96, 99, 100, 105, 112, 117, 120, 121, 128, 135, 140, 143, 144, 153, 160, 165, 168, 169, 171, 180, 187, 192, 195, 196, 200, 209, 216, 221, 224, 225, 231, 240, 247, 252, 255, 256, 264, 273, 280, 285, 288, 289, 299
Offset: 1

Views

Author

Valtteri Raiko, Mar 17 2015

Keywords

Comments

Numbers k such that A068527(k) is a square. k is in the sequence if and only if k - ceiling(sqrt(k))^2 + ceiling(sqrt(ceiling(sqrt(k))^2 - k))^2 = 0.
A000290 is a subsequence since for a square k, ceiling(sqrt(k))^2 - k = 0, a square too.
Also, numbers k such that A249298(k) is 1.
Also, numbers k such that A249142(k) is 0.
The only prime numbers in the sequence are 3 and 5.
No number from A016825 appears in the sequence.
If p and q are terms of A065091 and if q satisfies the inequality p - 2*sqrt(2p) + 2 < q < p + 2*sqrt(2p) + 2, then p*q is in the sequence. Thus infinitely many numbers from A046315 appear in the sequence.

Examples

			Ceiling(sqrt(27))^2 - 27 = 9 = 3^2, so 27 is in the sequence.
		

Crossrefs

Programs

  • Magma
    [n: n in [0..200] | IsSquare(Ceiling(Sqrt(n))^2-n)]; // Vincenzo Librandi, Mar 18 2015
  • Mathematica
    Flatten[Position[Table[n - Ceiling[Sqrt[n]]^2 + Ceiling[Sqrt[-n + Ceiling[Sqrt[n]]^2]]^2, {n, 0, 300}], 0]] - 1
    Select[Range[0,300],IntegerQ[Sqrt[Ceiling[Sqrt[#]]^2-#]]&] (* Harvey P. Dale, Sep 06 2023 *)
  • PARI
    isok(n) = issquare(ceil(sqrt(n))^2-n); \\ Michel Marcus, Mar 18 2015
    
Showing 1-6 of 6 results.