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.

A216330 Squares equal to the difference between two successive primes of the form n^2+1.

Original entry on oeis.org

64, 144, 100, 1024, 4900, 10816, 11664, 12544, 18496, 102400, 41616, 46656, 331776, 298116, 44100, 451584, 270400, 141376, 372100, 678976, 504100, 1849600, 524176, 2890000, 3504384, 602176, 685584, 8702500, 1768900, 2160900, 868624, 532900, 624100, 12960000
Offset: 1

Views

Author

Michel Lagneau, Sep 04 2012

Keywords

Examples

			64 is in the sequence because 6^2 + 1 = 37, 10^2+1 = 101 and 101 - 37 = 64 is square.
		

Crossrefs

Cf. A193558.

Programs

  • Maple
    q:=2:for n from 2 to 100 do:p:=n^2+1:if type(p,prime)=true then x:=p-q:q:=p: z:=sqrt(x):if z=floor(z) then printf(`%d, `,z):else fi:od:
  • Mathematica
    Select[#[[2]]-#[[1]]&/@Partition[Select[Range[2000000]^2+1,PrimeQ],2,1], IntegerQ[ Sqrt[#]]&] (* Harvey P. Dale, Nov 08 2017 *)

A339007 Least k such that p = k^2 + 1 and q = (k+2n)^2 + 1 are prime numbers with q - p square.

Original entry on oeis.org

24, 6, 312984, 16896, 120, 734994, 10640, 10, 1946016, 150, 171864, 180, 31200, 17136, 120, 84, 8976, 54, 137256, 300, 231504, 66, 184, 360126, 24, 5824, 2496, 224, 261696, 90, 4359344, 66, 50160, 68816, 280, 864, 1524696, 570, 219336, 11520, 8487984, 126, 22704
Offset: 1

Views

Author

Michel Lagneau, Nov 18 2020

Keywords

Comments

4*n*(k + n) is a square. If n is a square, then k + n is also a square.
If n is prime, then n divides k.
If we add the additional condition that p and q are two consecutive primes of the form m^2 + 1, then we obtain the sequence A339008, with A339008(n) = a(n) for n = 1, 2, 3, 4, 6, 7 and 9.

Examples

			a(1) = 24 because 24^2 + 1 = 577, (24 + 2)^2 + 1 = 677 and 677 - 577 = 10^2 is a square. The other values m such that p = m^2 + 1 and q = (m+2)^2 + 1 are primes with q - p square are 11024, 133224, 156024, 342224, 416024,...
a(2) = 6 because 6^2 + 1 = 37, (6 + 4)^2 + 1 = 101 and 101 - 37 = 8^2 is a square. The other values m such that p = m^2 + 1 and q = (m+4)^2 + 1 are primes with q - p square are 16, 126, 1350, 1456, 1566, 2310, 5200,...
		

Crossrefs

Programs

  • Maple
    for n from 1 to 50 do:
    ii:=0:
    for k from 2 by 2 to 10^9 while(ii=0) do:
       p:=k^2+1:q:=(k+2*n)^2 +1:
        if isprime(p) and isprime(q) and sqrt(q-p)=floor(sqrt(q-p))
         then
         ii:=1:printf(`%d %d \n`,n,k):
         else
        fi:
      od:
    od:
  • PARI
    a(n) = my(k=1); while (!(isprime(p=k^2+1) && isprime(q=(k+2*n)^2 + 1) && issquare(q-p)), k++); k; \\ Michel Marcus, Nov 18 2020

A339008 Least k such that p = k^2 + 1 and q = (k+2n)^2 + 1 are two consecutive prime numbers of the same form with q - p square.

Original entry on oeis.org

24, 6, 312984, 16896, 240, 734994, 10640, 10360, 1946016, 2550, 13189264, 72996, 416520, 2184336, 1584360, 202484, 232696, 1700150, 2394456, 375360, 8736504, 9237866, 53629744, 360126, 87000, 574339974, 82404216, 23237760, 1249877496, 826650, 127119344, 1527720
Offset: 1

Views

Author

Michel Lagneau, Nov 18 2020

Keywords

Comments

4*n*(k + n) is a square. If n is a square, then k + n is also a square.
If n is prime, then n divides k.
a(n) = A339007(n) for n = 1, 2, 3, 4, 6, 7 and 9.

Examples

			a(1) = 24 because 24^2 + 1 = 577, (24 + 2)^2 + 1 = 677. The numbers 577 and 677 are two consecutive primes of the form m^2+1, and 677 - 577 = 10^2 is a square. The other values m such that p = m^2 + 1 and q = (m+2)^2 + 1 are consecutive primes with q - p square are 11024, 133224, 156024, 342224, 416024, ...
a(2) = 6 because 6^2 + 1 = 37, (6 + 4)^2 + 1 = 101. The numbers 37 and 101 are two consecutive primes of the form m^2+1, and 101 - 37 = 8^2 is a square. The other values m such that p = m^2 + 1 and q = (m+4)^2 + 1 are consecutive primes with q - p square are 16, 126, 1350, 1456, 1566, 2310, 5200, ...
		

Crossrefs

Programs

  • Maple
    for n from 1 to 25 do:
    ii:=0:n1:=0:q:=2:
      for k from 2 by 2 to 10^9 while(ii=0) do:
        p:=k^2+1:
       if isprime(p)
        then
         x:=p-q:q:=p:z:=sqrt(x):
          if z=floor(z) and k-n1=2*n
           then
            ii:=1:printf(`%d %d \n`,n,n1):
             else
             n1:=k:
           fi:
        fi:
      od:
    od:
  • PARI
    consecutive(p, q) = {forprime(r = nextprime(p+1), precprime(q-1), if (isprime(r) && issquare(r-1), return(0));); return(1);}
    a(n) = my(k=1); while (!(isprime(p=k^2+1) && isprime(q=(k+2*n)^2 + 1) && issquare(q-p) && consecutive(p, q)), k++); k; \\ Michel Marcus, Nov 30 2020

Extensions

a(26)-a(32) from Chai Wah Wu, Dec 06 2020

A247592 Numbers n such that A002496(n) mod A002496(n-1) is a perfect square.

Original entry on oeis.org

2, 8, 10, 25, 42, 147, 160, 169, 238, 260, 491, 544, 869, 890, 923, 1140, 1337, 1386, 1465, 1643, 1927, 3371, 4614, 5038, 5086, 5225, 5832, 5909, 5995, 7118, 7157, 8540, 9859, 12543, 13505, 13795, 13841, 14211, 15347, 17079, 17263, 18643, 20211, 21184, 21245
Offset: 1

Views

Author

Michel Lagneau, Sep 20 2014

Keywords

Comments

A002496 : primes of form n^2+1.
The prime numbers of the sequence are 2, 491, 3371, 9859, 13841,...
The corresponding squares A002496(n) mod A002496 (n-1) are : {1, 144, 100, 1024, 4900, 10816, 11664, 12544,...} = {1} union {A216330} minus {64}.

Examples

			a(3)=10 because A002496(10) mod A002496(9)= 677 mod 577 = 10^2.
		

Crossrefs

Programs

  • Maple
    with(numtheory):nn:=360000:T:=array(1..nn):kk:=0:
    for n from 1 to nn do:
      if type(n^2+1,prime)=true then
       kk:=kk+1:T[kk]:=n^2+1:
       else
       fi:
    od:
        for m from 1 to kk-1 do:
         r:=irem(T[m+1],T[m]):z:=sqrt(r):
          if z=floor(z)
           then printf(`%d, `, m+1):
           else
          fi:
        od:
  • Mathematica
    lst={};lst1={};nn=400000;Do[If[PrimeQ[n^2+1],AppendTo[lst,n^2+1]],{n,1,nn}];nn1:=Length[lst];
    Do[If[IntegerQ[Sqrt[Mod[lst[[m]],lst[[m-1]]]]],AppendTo[lst1,m]],{m,2,nn1}];lst1
  • Python
    from gmpy2 import t_mod, is_square, is_prime
    A247592_list, A002496_list, m, c = [], [2], 2, 2
    for n in range(1, 10**7):
        m += 2*n+1
        if is_prime(m):
            if is_square(t_mod(m, A002496_list[-1])):
                A247592_list.append(c)
            A002496_list.append(m)
            c += 1 # Chai Wah Wu, Sep 20 2014

A351141 Pairs of primes (p,q) = (A002496(m), A002496(m+1)) such that q-p is a power r of the product of its prime factors for some m.

Original entry on oeis.org

37, 101, 577, 677, 15877, 16901, 57601, 62501, 33988901, 34035557, 113209601, 113507717, 121528577, 121572677, 345960001, 346332101, 635040001, 635544101, 7821633601, 7823402501, 17748634177, 17749167077, 24343488577, 24344112677, 97958984257, 97962740101
Offset: 1

Views

Author

Michel Lagneau, Feb 02 2022

Keywords

Comments

Subsequence of A002496.
The corresponding sequence of numbers q - p is a subsequence of A076292.
Conjecture: the sequence is infinite.
The corresponding powers r are given by the sequence b(n) = 6, 2, 10, 2, 6, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, ... It seems that b(n) = 2 for n > 5.

Examples

			The pair (257, 401) = (16^2+1, 20^2+1) is not in the sequence because 401 - 257 = 144 = 2^4*3^2.
The pair (577, 677) = (24^2+1, 26^2+1) is in the sequence because 577 - 677 = 100 = 2^2*5^2.
The pair (33988901, 34035557) = (5830^2+1, 5834^2+1) is in the sequence because 33988901 - 34035557 = 46656 = 2^6*3^6.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
    T:=array(1..26):nn:=350000:q:=5:j:=1:
    for n from 4 by 2 to nn do:
      p:=n^2+1:
       if type(p, prime)=true
        then
         x:=p-q:r:=q:q:=p:
         u:=factorset(x):n0:=nops(u):ii:=0:d:=product(u[i],i=1..n0):
          for k from 2 to 20 while(ii=0) do:
           if d^k=x
            then ii=1:T[j]:=r:T[j+1]:=q:j:=j+2:
            else
           fi:
          od:
       fi:
    od:
    print(T):
  • PARI
    lista(nn) = my(lastp=2); forprime(p=nextprime(lastp+1), nn, if (issquare(p-1), if (ispowerful(p-lastp), my(f=factor(p-lastp)[,2]); if (vecmin(f) == vecmax(f), print1(lastp, ", ", p, ", "));); lastp = p;);); \\ Michel Marcus, Feb 03 2022
Showing 1-5 of 5 results.