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

A107373 a(n) = (n/2)*binomial(n-1, floor((n-1)/2)) - 2^(n-2).

Original entry on oeis.org

0, 0, 1, 2, 7, 14, 38, 76, 187, 374, 874, 1748, 3958, 7916, 17548, 35096, 76627, 153254, 330818, 661636, 1415650, 2831300, 6015316, 12030632, 25413342, 50826684, 106853668, 213707336, 447472972, 894945944, 1867450648, 3734901296, 7770342787, 15540685574
Offset: 1

Views

Author

N. J. A. Sloane, Jul 20 2007

Keywords

Comments

Total number of descents in all faro permutations of length n-1. Faro permutations are permutations avoiding the three consecutive patterns 231, 321 and 312. They are obtained by a perfect faro shuffle of two nondecreasing words of lengths differing by at most one. See also A340567, A340568 and A340569. - Sergey Kirgizov, Jan 11 2021

Crossrefs

Programs

Formula

a(2*n) = 2*A000531(n-1); a(2*n+1) = A000531(n). - Max Alekseyev, Sep 30 2013
(1-n)*a(n) + 2*(n-1)*a(n-1) + 4*(n-2)*a(n-2) + 8*(-n+2)*a(n-3) = 0. - R. J. Mathar, May 26 2013

A131020 For all cyclic quadrilaterals with four consecutive primes as sides that have an area that is prime after rounding, the sequence gives the first of these four consecutive primes.

Original entry on oeis.org

3, 5, 13, 17, 61, 67, 97, 139, 157, 163, 173, 223, 271, 349, 353, 419, 479, 503, 541, 691, 701, 743, 877, 941, 1013, 1049, 1051, 1097, 1123, 1229, 1231, 1249, 1297, 1301, 1423, 1453, 1493, 1531, 1559, 1607, 1621, 1697, 1811, 1901, 1999, 2017, 2027, 2053, 2087
Offset: 1

Views

Author

Jonathan Vos Post, Jun 09 2007

Keywords

Comments

The semiperimeters of cyclic quadrilaterals with four consecutive odd prime sides are given in A131019. This arises in the cyclic quadrilateral analog of A106171.

Examples

			a(5) = 61 because (61 + 67 + 71 + 73)/2 = 136 and sqrt((136 - 61)*(136 - 67)*(136 - 71)*(136 - 73)) = 4603.43622 and round(4603.43622) = 4603 is prime.
		

References

  • Coxeter, H. S. M. and Greitzer, S. L. "Cyclic Quadrangles; Brahmagupta's Formula", Sect. 3.2 in Geometry Revisited. Washington, DC: Math. Assoc. Amer., pp. 56-60, 1967.

Crossrefs

Programs

  • Maple
    Digits := 80 : isA131020 := proc(p) local p2,p3,p4,s,area; if isprime(p) then p2 := nextprime(p) ; p3 := nextprime(p2) ; p4 := nextprime(p3) ; s := (p+p2+p3+p4)/2 ; area := round(sqrt((s-p)*(s-p2)*(s-p3)*(s-p4))) ; RETURN(isprime(area)) ; else false ; fi ; end: for n from 1 to 380 do if isA131020(ithprime(n)) then printf("%d,",ithprime(n)) ; fi ; od;

Formula

a(n) = prime(k) for some k such that, where S = semiperimeter = (prime(k) + prime(k+1) + prime(k+2) + prime(k+3))/2 is an element of A131019 and rounded area = round(sqrt((S-prime(k))*(S-prime(k+1))*(S-prime(k+2))*(S-prime(k+3)))) is prime.

Extensions

Edited by R. J. Mathar, Jun 12 2007

A131021 Prime semiperimeters of quadrilaterals with sides which are four consecutive primes.

Original entry on oeis.org

13, 101, 739, 751, 1301, 1459, 1471, 1483, 1583, 1619, 1877, 1889, 1949, 2213, 2239, 2351, 2381, 2441, 2473, 2549, 2741, 2917, 3271, 3413, 3863, 4133, 4567, 4987, 5081, 5279, 5347, 5783, 5813, 6719, 7027, 7369, 7459, 7607, 8233, 8291, 9151, 9187, 9397
Offset: 1

Views

Author

R. J. Mathar and Jonathan Vos Post, Jun 12 2007

Keywords

Comments

These are the prime numbers in A131019(k), occurring at k=1, 13, 71, 72, 116, 127, 128, 129, 136, 138, 157, 158, 162, 183, 185, ....

Programs

  • Maple
    for n from 1 to 1000 do a131019 := add(ithprime(n+i),i=1..4)/2 : if isprime(a131019) then printf("%d, ",a131019) ; fi ; od:
  • Mathematica
    Select[(Total /@ Partition[Prime[Range[10^3]], 4, 1])/2, PrimeQ] (* Zak Seidov, Nov 01 2012 *)
  • PARI
    p=3;q=5;r=7;forprime(s=11,1e4,if(isprime(t=(p+q+r+s)/2),print1(t", ")); p=q; q=r; r=s) \\ Charles R Greathouse IV, Nov 01 2012

Formula

A131019 INTERSECT A000040.

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

A330496 Squared area of quadrilateral with sides prime(n), prime(n+1), prime(n+2), prime(n+3) of odd primes configured as a cyclic quadrilateral. Sequence index starts at n=2 to omit the even prime.

Original entry on oeis.org

960, 5005, 17017, 46189, 96577, 212625, 394240, 765049, 1361920, 2027025, 3065857, 4385745, 6314112, 8973909, 12780049, 17116960, 21191625, 27428544, 33980800, 42600829, 56581525, 72382464, 89835424, 107972737, 121330189, 135745657, 167244385, 204917929
Offset: 2

Views

Author

Frank M Jackson, Dec 16 2019

Keywords

Comments

If a, b, c, d are consecutive odd primes configured as a cyclic quadrilateral, then Brahmagupta's formula K = sqrt((a+b+c-d)(a+b-c+d)(a-b+c+d)(-a+b+c+d))/16 means that K^2 will always be an integer. The only cyclic quadrilateral with consecutive prime sides starting with side 2 has a rational squared area of 3003/16.

Examples

			a(2)=960 because cyclic quadrilateral with sides 3,5,7,11 has squared area = (3+5+7-11)(3+5-7+11)(3-5+7+11)(-3+5+7+11)/16 = 960.
		

Crossrefs

Programs

  • Mathematica
    lst = {}; Do[{a, b, c, d} = {Prime[n], Prime[n+1], Prime[n+2], Prime[n+3]}; A2=(a+b+c-d)(a+b-c+d)(a-b+c+d)(-a+b+c+d)/16; AppendTo[lst, A2], {n, 1, 100}]; lst

Formula

Area K of a cyclic quadrilateral with sides a, b, c, d is given by Brahmagupta's formula K = sqrt((s-a)(s-b)(s-c)(s-d)) where s = (a+b+c+d)/2.
Showing 1-5 of 5 results.