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 11-16 of 16 results.

A038346 Sum of first n primes of form 4k+1.

Original entry on oeis.org

5, 18, 35, 64, 101, 142, 195, 256, 329, 418, 515, 616, 725, 838, 975, 1124, 1281, 1454, 1635, 1828, 2025, 2254, 2487, 2728, 2985, 3254, 3531, 3812, 4105, 4418, 4735, 5072, 5421, 5774, 6147, 6536, 6933
Offset: 1

Views

Author

Den Roussel (DenRoussel(AT)webtv.net)

Keywords

Crossrefs

Programs

  • Mathematica
    Accumulate[Select[Prime[Range[100]],IntegerQ[(#-1)/4]&]] (* Harvey P. Dale, Jul 25 2011 *)
  • PARI
    a(n) = my(s=0); forprime(p=2, , if(p%4==1, s+=p; if(n--<1, return(s)))) \\ following Charles R Greathouse IV's program for A078586

Formula

a(n) = Sum_{k=1..n} A002144(k). - Michel Marcus, Oct 18 2021

Extensions

Offset corrected by Jianing Song, Oct 18 2021

A057130 Product of first n primes of form 6k-1.

Original entry on oeis.org

5, 55, 935, 21505, 623645, 25569445, 1201763915, 63693487495, 3757915762205, 266812019116555, 22145397586674065, 1970940385213991785, 199064978906613170285, 21299952743007609220495, 2406894659959859841915935, 315303200454741639290987485
Offset: 1

Views

Author

Henry Bottomley, Aug 11 2000

Keywords

Examples

			a(3) = 5*11*17 = 935.
a(4) = 21505 = 5 * 11 * 17 * 23.
		

Crossrefs

Programs

  • PARI
    lista(nn) = {pp = 1; for (n = 1, nn, p = prime(n); if (Mod(p, 6) == -1, pp *= p; print1(pp, ", ")););} \\ Michel Marcus, Sep 08 2013

Formula

a(n) = a(n-1)*A007528(n) = (A057131(n)+1)/6.

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Oct 06 2000
More terms from Michel Marcus, Sep 08 2013

A159781 Values of hypotenuse of primitive Pythagorean triples which can have four different shapes (that is, four different sets of "legs").

Original entry on oeis.org

1105, 1885, 2405, 2465, 2665, 3145, 3445, 3485, 3965, 4505, 4745, 5185, 5365, 5525, 5785, 5945, 6205, 6305, 6409, 6565, 7085, 7345, 7565, 7585, 7685, 8177, 8245, 8585, 8845, 8905, 9061, 9265, 9425, 9605, 9685, 9805, 10205, 10585, 10865
Offset: 1

Views

Author

John T. Harrison (harrison_uk_2000(AT)yahoo.co.uk), Apr 22 2009

Keywords

Comments

This is a subsequence of A024409, which lists hypotenuse values common to more than one primitive Pythagorean triple. A024409(1) = A006278(2) = 65 is the smallest hypotenuse common to exactly two primitive Pythagorean triples; a(1) = A006278(3) = 1105 is the smallest that is common to four. [edited by Jon E. Schoenfield, Aug 19 2018]
A024362(a(n)) = 4. - Reinhard Zumkeller, Dec 02 2012

Crossrefs

Cf. A024409 and A146945.
Cf. A006278 (8, 16, etc. shapes). - R. J. Mathar, Apr 12 2010

Programs

  • Haskell
    import Data.List (elemIndices)
    a159781 n = a159781_list !! (n-1)
    a159781_list = map (+ 1) $ elemIndices 4 a024362_list
    -- Reinhard Zumkeller, Dec 02 2012
  • Mathematica
    f[c_] := f[c] = Block[{a = 1, b, cnt = 0, lmt = Floor[Sqrt[c^2/2]]}, While[b = Sqrt[c^2 - a^2]; a < lmt, If[IntegerQ@ b && GCD[a, b, c] == 1, cnt++]; a++]; cnt]Select[1 + 4 Range[2800], f@# > 2 &] (* Robert G. Wilson v, Mar 16 2014 *)

Extensions

6429 replaced by 6409 and 3 terms added by R. J. Mathar, Apr 12 2010
Missing 8585 and 8845 inserted by Reinhard Zumkeller, Dec 02 2012

A236382 Values of y corresponding to the smallest value of x such that x^2 + y^2 = P, where P is the product of the first n primes of the form 4k + 1, and 0 < x < y.

Original entry on oeis.org

2, 8, 33, 179, 1087, 6972, 50741, 396437, 3387169, 31954512, 314715456, 3162851149, 33021136387, 351019495376, 4108577867504, 50151584231673, 628397549315889, 8265279309778838, 111197960474124352, 1544811437679174169, 21682461771278746182, 328115185564476599824
Offset: 1

Views

Author

Colin Barker, Jan 24 2014

Keywords

Examples

			a(3) = 33 because the solutions to x^2 + y^2 = 5*13*17 are (x,y) = (23,24), (9,32), (4,33), (12,31) and the value of y corresponding to the smallest value of x is 33.
		

Crossrefs

Programs

  • PARI
    a(n) = my(t=1, v); forprimestep(p=5, oo, 4, t*=p; if(!n--, break)); v=qfbsolve(Qfb(1, 0, 1), t, 3); vecmax(vector(#v, i, vecmax(abs(v[i])))); \\ Jinyuan Wang, Apr 30 2025

Extensions

a(22) from Jinyuan Wang, Apr 30 2025

A270361 Odd primes p for which there exists an odd prime q < p such that p*q - 1 is a square.

Original entry on oeis.org

13, 29, 53, 61, 73, 89, 97, 109, 137, 149, 157, 173, 233, 241, 277, 317, 349, 353, 373, 389, 397, 409, 433, 461, 521, 541, 569, 593, 617, 641, 653, 661, 673, 701, 709, 733, 757, 769, 773, 821, 829, 853, 877, 881, 929, 937
Offset: 1

Views

Author

Richard R. Forberg, Mar 15 2016

Keywords

Comments

Conjecture: For any odd prime p there is at most one odd prime q, with q < p, for which p*q-1 is square.
(Note: If p were not restricted to being prime, there could be multiple primes q which make p*q-1 a square, with increasing multiplicities for larger p. The upper limit on the multiplicity of solutions, for prime and nonprime p and q values, is given by A006278. Note, however that those limits allow for solutions where q=2, and therefore two solutions when p and q are prime.)
a(n) is a subsequence of the Pythagorean Primes (A002144), which are of the form 4k+1.
The density of a(n) values among the primes declines with increasing n. For example, a(n) is about 22% of the first 1000 primes, and drops to about 15% of "incremental" primes around prime(10000). The density continues to fall among even larger primes. Twice those percentages apply as a portion of A002144.
All values of q also belong to A002144. It appears the set of q values "intends to" fully comprise A002144. This is notable because p values comprise an increasingly sparse subsequence within A002144, and each p value has just one q value.
The ability to fully comprise A002144 with q values is further challenged by the fact that for any given q value (i.e., any term of A002144) multiple values of p > q can be found such that p*q-1 is square. Thus q values are "promiscuous", and apparently without bounds on the number of p values they can serve.
Contrast this with primes p and q such that p*q+1 is square. The result are the Twin Primes (A001359 and A006512), arranged in a simple one-to-one correspondence, with p = q+2.

Examples

			13 is in this sequence because 13*5 - 1 = 64, which is square, with 5 < 13.
		

Crossrefs

Cf. A002144.

Programs

  • Mathematica
    result = {}; Do[p = Prime[i]; Do[q = Prime[j]; r = p*q - 1;
      If[Mod[r, 8] == 1 || Mod[r, 8] == 0 || Mod[r, 8] == 4,
       If[IntegerQ[Sqrt[r]], AppendTo[result, p]]], {j, 2, i - 1}],
    {i, 3, 1000}]; result
  • PARI
    lista(nn) = {forprime(p=3, nn, ok = 0; forprime (q=3, p-1, if (issquare(p*q-1), ok = 1; break);); if (ok, print1(p, ", ")););} \\ Michel Marcus, Apr 06 2016
  • Python
    from gmpy2 import is_prime, is_square
    for p in range(3, 10 ** 4, 2):
        flag = 0
        if is_prime(p):
            for q in range(3, p, 2):
                if is_square(p * q - 1) and is_prime(q):
                    flag = 1
                    break
        if flag:
            print(p, end=", ")
    # Soumil Mandal, Apr 07 2016
    

A350813 a(n) is the least positive number k such that the product of the first n primes that are congruent to 1 (mod 4) is equal to y^2 - k^2 for some integer y.

Original entry on oeis.org

2, 4, 24, 38, 16, 588, 5782, 5528, 80872, 319296, 3217476, 32301914, 20085008, 166518276, 2049477188, 17443412442, 27905362944, 233647747282, 886295348972, 134684992249108, 98002282636962, 392994156083892, 5283713761100536, 76642755213473624, 923250078609721236
Offset: 1

Views

Author

Richard Peterson, Jan 17 2022

Keywords

Comments

Because y^2-k^2=(y-k)(y+k), a method to make k as small as possible is to try to make y-k and y+k as nearly equal as possible.
Because each of y-k and y+k are made up of primes of form 1 mod 4, algebra shows that k=a(n) is always even.

Examples

			For n=3, m = 5*13*17. The "middle" most nearly equal divisor and codivisor of m are y-k=17 and y+k=65, whence a(n) = (65 - 17)/2 = 24.
		

Crossrefs

Programs

  • Python
    from math import prod, isqrt
    from itertools import islice
    from sympy import sieve, divisors
    def A350813(n):
        m = prod(islice(filter(lambda p: p % 4 == 1, sieve),n))
        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

Terms corrected by and more terms from Jinyuan Wang, Mar 17 2022
Previous Showing 11-16 of 16 results.