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 61-70 of 83 results. Next

A258149 Triangle of the absolute difference of the two legs (catheti) of primitive Pythagorean triangles.

Original entry on oeis.org

1, 0, 7, 7, 0, 17, 0, 1, 0, 31, 23, 0, 0, 0, 49, 0, 17, 0, 23, 0, 71, 47, 0, 7, 0, 41, 0, 97, 0, 41, 0, 7, 0, 0, 0, 127, 79, 0, 31, 0, 0, 0, 89, 0, 161, 0, 73, 0, 17, 0, 47, 0, 119, 0, 199, 119, 0, 0, 0, 1, 0, 73, 0, 0, 0, 241
Offset: 2

Views

Author

Wolfdieter Lang, Jun 10 2015

Keywords

Comments

For primitive Pythagorean triangles characterized by certain (n,m) pairs and references see A225949.
Here a(n,m) = 0 for non-primitive Pythagorean triangles, and for primitive Pythagorean triangles a(n,m) = abs(n^2 - m^2 - 2*n*m) = abs((n-m)^2 - 2*m^2).
The number of non-vanishing entries in row n is A055034(n).
D(n,m):= n^2 - m^2 - 2*n*m >= 0 if 1 <= m <= floor(n/(sqrt(2)+1)), and D(n,m) < 0 if n/(sqrt(2)+1)+1 <= m <= n-1, for n >= 2.
The Pell equation (n-m)^2 - 2*m^2 = +/- N is important here to find the representations of +N or -N in the triangle D(n,m). For instance, odd primes N have to be of the +1 (mod 8) (A007519) or -1 (mod 8) (A007522) form, that is, from A001132. See the Nagell reference, Theorem 110, p. 208 with Theorem 111, pp. 210-211. E.g., N = +7 appears for m = 1, 3, 9, 19, 53, ... (A077442) for n = 4, 8, 22, 46, 128, ... (2*A006452).
N = -7 appears for n = 3, 9, 19, 53, 111, ... (A077442) and m = 2, 4, 8, 22, 46, ... (2*A006452).
For the signed version 2*n*m - (n^2 - m^2) see A278717. - Wolfdieter Lang, Nov 30 2016

Examples

			The triangle a(n,m) begins:
n\m   1  2  3  4  5  6  7   8   9  10  11 ...
2:    1
3:    0  7
4:    7  0 17
5:    0  1  0 31
6:   23  0  0  0 49
7:    0 17  0 23  0 71
8:   47  0  7  0 41  0 97
9:    0 41  0  7  0  0  0 127
10:  79  0 31  0  0  0 89   0 161
11:   0 73  0 17  0 47  0 119   0 199
12: 119  0  0  0  1  0 73   0   0   0 241
...
a(2,1) = |1^2 - 2*1^2| = 1 for the primitive Pythagorean triangle (pPt) [3,4,5] with |3-4| = 1.
a(3,2) = |1^2 - 2*2^2| = 7 for the pPt [5,12,13] with |5 - 12| = 7.
a(4,1) = |3^2 - 2*1^2| = 7 for the pPt [15, 8, 17] with |15 - 8| = 7.
		

References

  • See also A225949.
  • T. Nagell, Introduction to Number Theory, Chelsea Publishing Company, New York, 1964, pp. 208, 210-211.

Crossrefs

Programs

  • Mathematica
    a[n_, m_] /; n > m >= 1 && CoprimeQ[n, m] && (-1)^(n+m) == -1 := Abs[n^2 - m^2 - 2*n*m]; a[, ] = 0; Table[a[n, m], {n, 2, 12}, {m, 1, n-1}] // Flatten (* Jean-François Alcover, Jun 16 2015, after given formula *)

Formula

a(n,m) = abs(n^2 - m^2 -2*n*m) = abs((n-m)^2 - 2*m^2) if n > m >= 1, gcd(n,m) = 1, and n and m are integers of opposite parity (i.e., (-1)^(n+m) = -1); otherwise a(n,m) = 0.

A269520 Primes 8k + 7 preceding the maximal gaps in A269519.

Original entry on oeis.org

7, 47, 271, 311, 503, 6367, 37223, 42487, 66463, 183527, 259271, 307919, 471007, 1070567, 1801223, 5903687, 6885743, 16936247, 22413319, 38820263, 63977327, 84164447, 147452759, 150334567, 239422639, 300412031, 387154951, 473153959, 539526191, 760400783, 788128039
Offset: 1

Views

Author

Alexei Kourbatov, Feb 28 2016

Keywords

Comments

Subsequence of A007522.
A269519 lists the corresponding record gap sizes. See more comments there.

Examples

			The first two primes of the form 8k + 7 are 7 and 23, so a(1)=7. The next primes of this form are 31, 47; the gaps 31-23 and 47-31 are not records so nothing is added to the sequence. The next prime of this form is 71 and the gap 71-47=24 is a new record, so a(2)=47.
		

Crossrefs

Programs

  • PARI
    re=0; s=7; forprime(p=23, 1e8, if(p%8!=7, next); g=p-s; if(g>re, re=g; print1(s", ")); s=p)

A269521 Primes 8k + 7 at the end of the maximal gaps in A269519.

Original entry on oeis.org

23, 71, 311, 359, 599, 6551, 37423, 42703, 66751, 183823, 259583, 308263, 471391, 1071023, 1801727, 5904247, 6886367, 16936991, 22414079, 38821039, 63978127, 84165271, 147453599, 150335431, 239423519, 300412927, 387155903, 473154943, 539527199, 760401839, 788129191
Offset: 1

Views

Author

Alexei Kourbatov, Feb 28 2016

Keywords

Comments

Subsequence of A007522.
A269519 lists the corresponding record gap sizes. See more comments there.

Examples

			The first two primes of the form 8k + 7 are 7 and 23, so a(1)=23. The next primes of this form are 31, 47; the gaps 31-23 and 47-31 are not records so nothing is added to the sequence. The next prime of this form is 71 and the gap 71-47=24 is a new record, so a(2)=71.
		

Crossrefs

Programs

  • PARI
    re=0; s=7; forprime(p=23, 1e8, if(p%8!=7, next); g=p-s; if(g>re, re=g; print1(p", ")); s=p)

A337145 a(n) is the determinant of the 2 X 2 matrix whose entries (when read by rows) are the n-th primes congruent to 1, 3, 5, 7 mod 8 respectively.

Original entry on oeis.org

104, 800, 1712, 2592, 3760, 4840, 5728, 12848, 15664, 18424, 20888, 23520, 28232, 28560, 25320, 30280, 37248, 50520, 43680, 33664, 61560, 73920, 70544, 57696, 38696, 27408, 79280, 63392, 107328, 109536, 162608, 172296, 187352, 197040, 248064, 228320, 215912, 229152, 255480, 231304, 286408, 256320
Offset: 1

Views

Author

J. M. Bergot and Robert Israel, Jan 27 2021

Keywords

Comments

The first negative term is a(20750) = -58207896.
All terms are divisible by 8.

Examples

			The first primes == 1, 3, 5, 7 (mod 8) are 17, 3, 5, 7 respectively, so a(1) = 17*7 - 3*5 = 104.
The second primes == 1, 3, 5, 7 (mod 8) are 41, 11, 13, 23 respectively, so a(2) = 41*23 - 11*13 = 800.
The third primes == 1, 3, 5, 7 (mod 8) are 73, 19, 29, 31 respectively, so a(3) = 73*31 - 19*29 = 1712.
		

Crossrefs

Programs

  • Maple
    R:= NULL:
    L:= [-7, -5, -3, -1]:
    found:= false:
    for k from 1 to 100 do
      for i from 1 to 4 do
       for x from L[i]+8 by 8 do until isprime(x);
       L[i]:= x;
      od;
      v:= L[1]*L[4]-L[2]*L[3];
      R:= R,v;
    od:
    R;

A101789 Safe primes of the form 8*k-1: primes of the form 8*k-1 such that 4*k-1 is also a prime.

Original entry on oeis.org

7, 23, 47, 167, 263, 359, 383, 479, 503, 719, 839, 863, 887, 983, 1319, 1367, 1439, 1487, 1823, 2039, 2063, 2207, 2447, 2879, 2903, 2999, 3023, 3119, 3167, 3623, 3863, 4007, 4079, 4127, 4679, 4703, 4799, 4919, 5087, 5399, 5639, 5807, 5879, 5927, 6047
Offset: 1

Views

Author

Douglas Stones (dssto1(AT)student.monash.edu.au), Dec 16 2004

Keywords

Examples

			4*1-1 = 3 and 8*1-1 = 7 are primes, so the first term is 7.
		

Crossrefs

Intersection of A005385 and A007522.
Cf. A002515.

Programs

  • Mathematica
    Select[Prime[Range[800]],Mod[#,8]==7&&PrimeQ[(#-1)/2]&] (* Harvey P. Dale, Jan 31 2012 *)
  • PARI
    is(k) = (k % 8 == 7) && isprime(k) && isprime(k\2); \\ Amiram Eldar, May 23 2024

A121068 Numbers k such that 8*k^2 + 7 is prime.

Original entry on oeis.org

0, 3, 27, 30, 33, 48, 57, 60, 72, 75, 78, 108, 117, 123, 135, 150, 162, 192, 198, 207, 228, 243, 270, 300, 303, 312, 342, 345, 390, 408, 417, 423, 435, 480, 498, 507, 510, 513, 543, 552, 555, 573, 618, 633, 642, 645, 657, 675, 705, 723, 732, 738, 747, 750, 780
Offset: 1

Views

Author

Parthasarathy Nambi, Aug 10 2006

Keywords

Comments

All terms are multiples of 3. - Zak Seidov, Aug 11 2006
A201704 is primes of form 8*k^2+7. James C. McMahon, Oct 12 2024

Examples

			If k=135 then 8*k^2 + 7 = 145807 (prime).
		

Crossrefs

Programs

  • Magma
    [ n: n in [0..1500] | IsPrime(8*n^2 + 7) ]; // Vincenzo Librandi, Jan 31 2011
    
  • Maple
    a:=proc(n) if isprime(8*n^2+7)=true then n else fi end: seq(a(n),n=0..1000); # Emeric Deutsch, Aug 11 2006
  • Mathematica
    Select[Range[0,780],PrimeQ[8#^2+7]&] (* James C. McMahon, Oct 12 2024 *)
  • PARI
    is(n)=isprime(8*n^2+7) \\ Charles R Greathouse IV, Jun 13 2017

Extensions

More terms from Emeric Deutsch and Joshua Zucker, Aug 11 2006

A127597 Least number k such that k 4^n + (4^n-1)/3 is prime.

Original entry on oeis.org

2, 1, 0, 2, 3, 2, 4, 4, 3, 10, 3, 3, 2, 7, 2, 25, 6, 17, 4, 13, 3, 20, 36, 20, 11, 27, 66, 23, 39, 24, 19, 13, 3, 10, 6, 122, 71, 58, 24, 13, 3, 2, 41, 10, 6, 32, 58, 17, 4, 79, 26, 55, 36, 48, 31, 28, 9, 2, 76, 24, 32, 28, 63, 20, 37, 9, 2, 7, 39, 10, 91, 47
Offset: 0

Views

Author

Artur Jasinski, Jan 19 2007

Keywords

Crossrefs

Programs

  • Mathematica
    a = {}; Do[k = 0; While[ !PrimeQ[k 4^n + (4^n - 1)/3], k++ ]; AppendTo[a, k], {n, 0, 50}]; a (*Artur Jasinski*)
    lnk[n_]:=Module[{k=0,n4=4^n},While[!PrimeQ[k*n4+(n4-1)/3],k++];k]; Array[ lnk,60,0] (* Harvey P. Dale, May 28 2018 *)
  • Python
    from sympy import isprime
    def a(n):
        k, fourn = 0, 4**n
        while not isprime(k*fourn + (fourn-1)//3): k += 1
        return k
    print([a(n) for n in range(72)]) # Michael S. Branicky, May 18 2022

Extensions

Offset corrected and a(51) and beyond from Michael S. Branicky, May 18 2022

A269519 Record (maximal) gaps between primes of the form 8k + 7.

Original entry on oeis.org

16, 24, 40, 48, 96, 184, 200, 216, 288, 296, 312, 344, 384, 456, 504, 560, 624, 744, 760, 776, 800, 824, 840, 864, 880, 896, 952, 984, 1008, 1056, 1152, 1208, 1312, 1384, 1448, 1464, 1472, 1720, 1872
Offset: 1

Views

Author

Alexei Kourbatov, Feb 28 2016

Keywords

Comments

Dirichlet's theorem on arithmetic progressions suggests that average gaps between primes of the form 8k + 7 below x are about phi(8)*log(x). This sequence shows that the record gap ending at p grows almost as fast as phi(8)*log^2(p). Here phi(n) is A000010, Euler's totient function; phi(8)=4.
Conjecture: a(n) < phi(8)*log^2(A269521(n)) almost always.
A269520 lists the primes preceding the maximal gaps.
A269521 lists the corresponding primes at the end of the maximal gaps.

Examples

			The first two primes of the form 8k + 7 are 7 and 23, so a(1)=23-7=16. The next primes of this form are 31, 47; the gaps 31-23 and 47-31 are not records so nothing is added to the sequence. The next prime of this form is 71 and the gap 71-47=24 is a new record, so a(2)=24.
		

Crossrefs

Programs

  • PARI
    re=0; s=7; forprime(p=23, 1e8, if(p%8!=7, next); g=p-s; if(g>re, re=g; print1(g", ")); s=p)

A367229 Fermat pseudoprimes to base 2 that are products of two Mersenne numbers (not necessarily distinct) that are larger than 1.

Original entry on oeis.org

1905, 15841, 129921, 8322945, 66977281, 4395899025409, 4398012825601, 140735340806145, 36892925197465616385, 2342736497361113055105, 4951750712408555360305545217, 39304596247310823728047193985, 2535301191011725837253847547905, 1298074214624262174166747352924161
Offset: 1

Views

Author

Amiram Eldar, Nov 11 2023

Keywords

Comments

Without the restriction to Mersenne numbers that are larger than 1 all the composite Mersenne numbers (A065341) will be terms.
Szymiczek (1964) proved that if p is a prime == 7 (mod 8) (A007522) and t = 2^phi((p-1)/2), then M(p)*M(t) is a Fermat pseudoprime to base 2, where phi is the Euler totient function (A000010) and M(n) = 2^n-1 = A000225(n) is the n-th Mersenne number. The smallest pseudoprime that is generated by this rule, for p = 7 and t = 2^phi((7-1)/2) = 4, is M(7) * M(4) = 1905. The next two, corresponding to p = 23 and 31, have 316 and 87 digits, respectively.
Rotkiewicz and Makowski (1966) proved that if p is a prime or a Fermat pseudoprime to base 2 such that o(p), the multiplicative order of 2 modulo p, is odd (A014663 for primes, A367230 for pseudoprimes), then for each positive k <= p/o(o(p)), if t = 2^(k*o(o(p))) then M(p)*M(t) is a Fermat pseudoprime to base 2. For example, for p = 7, p/o(o(7)) = 7/2, so for k = 1, 2 and 3 the resulting pseudoprimes are 1905, 8322945 and 2342736497361113055105, respectively.

Examples

			a(1) = 1905 = (2^4-1) * (2^7-1).
a(2) = 15841 = (2^5-1) * (2^9-1).
		

Crossrefs

Programs

  • Mathematica
    With[{max = 110}, m = 2^Range[2, max] - 1; Sort@ Select[Times @@@ Subsets[m, {2}], # < m[[-1]] && PowerMod[2, # - 1, #] == 1 &]]

A022761 n-th 8k+1 prime plus n-th 8k+7 prime.

Original entry on oeis.org

24, 64, 104, 136, 168, 192, 240, 320, 384, 408, 448, 480, 536, 576, 616, 672, 720, 792, 816, 840, 952, 1008, 1040, 1072, 1088, 1120, 1240, 1280, 1392, 1416, 1528, 1584, 1624, 1680, 1760, 1792, 1840, 1896, 1944, 1968, 2064, 2112, 2144, 2224
Offset: 1

Views

Author

Keywords

Examples

			The first four primes of the form 8k - 1 are 7, 23, 31, 47. The first four primes of the form 8k + 1 are 17, 41, 73, 89.
Thus a(1) = 7 + 17  = 24.
a(2) = 23 + 41 = 64.
a(3) = 31 + 73 = 104.
a(4) = 47 + 89 = 136.
		

Crossrefs

Programs

  • Mathematica
    thresh = 100; A007522 = Select[8Range[thresh] - 1, PrimeQ]; A007519 = Select[8Range[thresh] + 1, PrimeQ]; preExh = Min[Length[A007522], Length[A007519]]; Take[A007522, preExh] + Take[A007519, preExh]
    Module[{nn=300,p1,p7,len},p1=Select[Prime[Range[nn]],IntegerQ[(#-1)/8]&];p7=Select[Prime[Range[nn]],IntegerQ[(#-7)/8]&];len=Min[ Length[ p1],Length[ p7]];Total/@Thread[{Take[p1,len],Take[p7,len]}]] (* Harvey P. Dale, May 26 2020 *)
Previous Showing 61-70 of 83 results. Next