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

A038702 Prime(n)^2 mod prime(n-1).

Original entry on oeis.org

1, 1, 4, 2, 4, 3, 4, 16, 13, 4, 5, 16, 4, 16, 36, 36, 4, 36, 16, 4, 36, 16, 36, 64, 16, 4, 16, 4, 16, 83, 16, 36, 4, 100, 4, 36, 36, 16, 36, 36, 4, 100, 4, 16, 4, 144, 144, 16, 4, 16, 36, 4, 100, 36, 36, 36, 4, 36, 16, 4, 100, 196, 16, 4
Offset: 2

Views

Author

Neil Fernandez, May 01 2000

Keywords

Comments

a(n+1) = n-th prime gap squared mod the n-th prime = A076821(n) mod A000040(n). Probably a(n) = A076821(n+1) for n > 31. This holds up to 4 * 10^18. - Charles R Greathouse IV, Apr 17 2012

Examples

			To get a(4): square the fourth prime to get 7^2 = 49. The remainder when this is divided by the third prime, 5, is 4. So a(3) = 4.
		

Crossrefs

Cf. A038703.

Programs

A167770 a(n) = prime(n)^2 modulo prime(n+1).

Original entry on oeis.org

1, 4, 4, 5, 4, 16, 4, 16, 7, 4, 36, 16, 4, 16, 36, 36, 4, 36, 16, 4, 36, 16, 36, 64, 16, 4, 16, 4, 16, 69, 16, 36, 4, 100, 4, 36, 36, 16, 36, 36, 4, 100, 4, 16, 4, 144, 144, 16, 4, 16, 36, 4, 100, 36, 36, 36, 4, 36, 16, 4, 100, 196, 16, 4, 16, 196, 36, 100, 4, 16, 36, 64, 36, 36, 16
Offset: 1

Views

Author

Zak Seidov, Nov 11 2009

Keywords

Comments

Only for three cases n = 4,9,30, a(n) < (prime(n+1)-prime(n))^2 because only in these cases (prime(n+1)-prime(n))^2 > prime(n+1):
n = 4: a(4) = 5 < ((p(5)-p(4))^2 = (11-7)^2 = 16) and 16 > 11.
n = 9: a(9) = 7 < ((p(10)-p(9))^2 = (29-23)^2 = 36) and 36 > 29.
n = 30: a(30) = 69 < ((p(31)-p(30))^2 = (127-113)^2 = 196) and 196 > 127.
In all other cases, a(n) = A076821(n) = (prime(n+1)-prime(n))^2, is highly probable but not proved conjecture.

Crossrefs

Cf. A076821 (squares of the differences between consecutive primes).
Cf. A001223 (modular square roots of this sequence).
Cf. A000040 (primes), A001248 (squares of primes).

Programs

  • Maple
    A167770:=n->ithprime(n)^2 mod ithprime(n+1): seq(A167770(n), n=1..70); # Wesley Ivan Hurt, Oct 01 2014
  • Mathematica
    Table[PowerMod[Prime[n], 2, Prime[n+1]], {n, 221265}]
  • PARI
    a(n)=prime(n)^2%prime(n+1) \\ M. F. Hasler, Oct 04 2014

Formula

a(n) = prime(n)^2 modulo prime(n+1).
a(n) == A001223(n)^2 (mod A000040(n+1)). - L. Edson Jeffery, Oct 01 2014

A074741 Sum of squares of gaps between consecutive primes.

Original entry on oeis.org

1, 5, 9, 25, 29, 45, 49, 65, 101, 105, 141, 157, 161, 177, 213, 249, 253, 289, 305, 309, 345, 361, 397, 461, 477, 481, 497, 501, 517, 713, 729, 765, 769, 869, 873, 909, 945, 961, 997, 1033, 1037, 1137, 1141, 1157, 1161, 1305, 1449, 1465, 1469, 1485, 1521
Offset: 1

Views

Author

Antonio G. Astudillo (afg_astudillo(AT)hotmail.com), Sep 05 2002

Keywords

References

  • R. K. Guy, Unsolved Problems in Number Theory, Springer-Verlag, New York, Heidelberg, 1994, problem A8.

Crossrefs

Partial sums of A076821. - Michel Marcus, May 26 2018
Cf. A001223.

Programs

  • Maple
    with(numtheory): a := proc(n) option remember: if (n=1) then RETURN(1) else RETURN(a(n-1)+(ithprime(n+1)-ithprime(n))^2) fi: end:
  • Mathematica
    Rest[FoldList[Plus, 0, (#[[2]] - #[[1]])^2 & /@ Partition[Prime[Range[100]], 2, 1]]]
    nn=60;With[{dsp=Differences[Prime[Range[nn+1]]]^2},Table[Total[Take[ dsp,n]],{n,nn}]] (* Harvey P. Dale, Nov 30 2011 *)
    Accumulate[Differences[Prime[Range[60]]]^2] (* Harvey P. Dale, May 08 2015 *)
  • PARI
    a(n) = sum(k=1, n, (prime(k+1) - prime(k))^2); \\ Michel Marcus, May 26 2018
    
  • Python
    from sympy import nextprime
    from itertools import islice, accumulate
    def gen():
        p, q = 2, 3
        while True:
            r = (q - p) ** 2
            yield r
            p, q = q, nextprime(q)
    print(list(accumulate(islice(gen(), 51)))) # Adrienne Leonardo, Dec 18 2024

Formula

a(n) = Sum_{k=1..n} (prime(k+1)-prime(k))^2 = Sum_{k=1..n} A001223(k)^2.
Asymptotic expressions: D. R. Heath-Brown's conjecture: Sum_{prime(n)<=N} (prime(n)-prime(n-1))^2 ~ 2*N*log(N). Marek Wolf's conjecture: Sum_{prime(n)A000720(n).

A360790 Squared length of diagonal of right trapezoid with three consecutive prime length sides.

Original entry on oeis.org

8, 13, 41, 53, 137, 173, 305, 397, 533, 877, 977, 1373, 1697, 1885, 2245, 2813, 3517, 3737, 4493, 5077, 5345, 6277, 6953, 7937, 9413, 10217, 10613, 11465, 12077, 12785, 16165, 17165, 18869, 19325, 22237, 22837, 24665, 26605, 27925, 29933, 32141, 32765, 36497, 37253, 38953, 39745
Offset: 1

Views

Author

Aaron T Cowan, Feb 20 2023

Keywords

Comments

The value d is the square of the length of the diagonal of a trapezoid with a height and bases that are consecutive primes, respectively. The diagonal length is calculated using the Pythagorean theorem, but this distance is squared so that the value is an integer.

Examples

			        p(2)=3
        _ _ _ _
a(1):  |        \  d^2=2^2+(5-3)^2=8
p(1)=2 |_ _ _ _ _\
        p(3)=5
        p(3)=5
        _ _ _ _ _ _
a(2):  |           \    d^2=3^2 + (7-5)^2 = 9+4 = 13
p(2)=3 |            \
       |_ _ _ _ _ _ _\
        p(4)=7
a(3)= 5^2+(11-7)^2 = 25+16 = 41
a(7)= 17^2+(23-19)^2=305 = 5*61
		

Crossrefs

Programs

  • MATLAB
    %shorter 1 line version
    arrayfun(@(p) p^2+(nextprime(nextprime(p+1)+1)-nextprime(p+1))^2,[primes(10^6)])
    
  • Mathematica
    Map[(#[[1]]^2 + (#[[3]] - #[[2]])^2) &, Partition[Prime[Range[50]], 3, 1]] (* Amiram Eldar, Feb 24 2023 *)
  • PARI
    a(n) = prime(n)^2 + (prime(n+2)-prime(n+1))^2; \\ Michel Marcus, Feb 23 2023

Formula

a(n) = prime(n)^2 + (prime(n+2)-prime(n+1))^2.
a(n) = A001248(n) + A076821(n+1). - Michel Marcus, Feb 23 2023
Showing 1-4 of 4 results.