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

A134406 Composite numbers of the form k^2 + 1.

Original entry on oeis.org

10, 26, 50, 65, 82, 122, 145, 170, 226, 290, 325, 362, 442, 485, 530, 626, 730, 785, 842, 901, 962, 1025, 1090, 1157, 1226, 1370, 1445, 1522, 1682, 1765, 1850, 1937, 2026, 2117, 2210, 2305, 2402, 2501, 2602, 2705, 2810, 3026, 3250, 3365, 3482, 3601, 3722, 3845
Offset: 1

Views

Author

Jani Melik, Jan 18 2008

Keywords

Comments

Square roots of these numbers are quadratic irrationals and corresponding chain fraction representations are periodic: sqrt(10) = [3;{2,3}], sqrt(26) = [5;{2,5}], sqrt(50) = [7;{2,7}], ..., where {} is denoted a period (we write {6} == {2,3}).

Examples

			10 is a term because 10 = 3^2 + 1 is composite,
26 is a term because 26 = 5^2 + 1 is composite,
50 is a term because 50 = 7^2 + 1 is composite.
		

Crossrefs

Supersequence of A144255.

Programs

  • Maple
    ts_fn1:=proc(n) local i,tren,ans; ans:=[ ]: for i from 1 to n do tren := i^(2)+1: if (isprime(tren) = false) then ans:=[ op(ans), tren ]: fi od: RETURN(ans) end: ts_fn1(200);
  • Mathematica
    Select[Range[70]^2+1,!PrimeQ[#]&] (* Harvey P. Dale, Aug 12 2012 *)
  • PARI
    for(n=3,99, if(!isprime(t=n^2+1), print1(t", "))) \\ Charles R Greathouse IV, Aug 29 2016
    
  • Python
    from sympy import isprime
    from itertools import count, takewhile
    def aupto(limit):
        form = takewhile(lambda x: x <= limit, (k**2+1 for k in count(1)))
        return [number for number in form if not isprime(number)]
    print(aupto(3845)) # Michael S. Branicky, Oct 26 2021

Formula

a(n) = 1 + A134407(n)^2. - R. J. Mathar, Oct 13 2019

A180507 Numbers k such that k^2 + 1 = p*q, p and q prime with p == q (mod k).

Original entry on oeis.org

3, 8, 12, 144, 1020, 8040, 13860, 34840, 729180, 1728240, 3232060, 17576520, 39279240, 85184880, 117649980, 778689840, 884737920, 1225045140, 1771563420, 3723878100, 3869896140, 4574299320, 7762395960, 12487172640, 14348911860, 14886940920, 21484957560, 24137574780
Offset: 1

Views

Author

Michel Lagneau, Jan 20 2011

Keywords

Comments

q - p = k with k = 3, 8, 144.
The next terms with q - p = k are F(432) = 85738...5984 and F(570) where F(n) is the n-th Fibonacci number. All such terms are in A001906; the next such term, if one exists, has more than 25000 decimal digits. - Charles R Greathouse IV, Jan 21 2011

Examples

			a(3) = 12 because 12^2 + 1 = 5*29 and 29 - 5 = 2*12;
a(8) = 34840 because 34840^2 + 1 = 4289 * 283009 and 283009 - 4289 = 278720 = 8*34840.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for k from 1 to 40000 do: x:=k^2+1:y:=factorset(x):yy:=bigomega(x):if
      yy=2 and irem(y[2],k) =y[1] then printf(`%d, `,k):else fi:od:
  • PARI
    w(m, r) = Vec(x*(1-x)/(1-(m^2+2)*x+x^2) + O(x^r));
    isok(s, t) = isprime(s) && isprime(s+t);
    lista(nn) = {my(g, k, m=1, r, u=w(1, nn), v=List([])); for(i=2, r=#u, g=k=(u[i]+sqrtint(5*u[i]^2-4))/2; if(isok(u[i], k), listput(v, k))); while(r>2, u=w(m++, r); for(i=2, #u, k=(m*u[i]+sqrtint((m^2+4)*u[i]^2-4))/2; if(kJinyuan Wang, Mar 29 2020

Extensions

More terms from Charles R Greathouse IV, Jan 24 2011
Missing terms inserted and more terms from Jinyuan Wang, Mar 30 2020

A187401 Numbers k such that k^2 + 1 = p*q, p and q primes and |p-q| is square.

Original entry on oeis.org

30, 100, 144, 274, 484, 516, 526, 756, 1046, 1250, 1714, 1806, 1834, 2284, 2440, 2610, 2940, 3524, 3824, 4190, 5084, 5746, 6766, 7486, 9746, 9920, 10310, 13024, 13210, 15396, 16916, 17546, 18726, 19256, 20000, 21194, 23214, 24964, 30370, 30394, 31126, 31496, 35180, 36680, 37816
Offset: 1

Views

Author

Michel Lagneau, Mar 09 2011

Keywords

Comments

Note that if k^2+1 = p*q, then p+q cannot be a square. Proof by contradiction. There are two cases: p an odd prime and p=2. Case 1: suppose p and q are odd primes and q = y^2-p. Note that y must be an even number in order for q to be odd. Then p(y^2-p) = x^2+1 for some even x. Rearranging terms, we obtain p*y^2-1 = p^2+x^2. Looking at this equation modulo 4, we obtain -1 = 1, a contradiction. Case 2: Let p=2. Then we obtain 2y^2-x^2 = 5, which has no solutions in integers. - T. D. Noe, Mar 10 2011

Examples

			20000 is in the sequence because 20000^2+1 = 19801 * 20201 and 20201 - 19801 = 20^2.
		

Crossrefs

Programs

  • Maple
    with(numtheory):nn:=50000:for i from 1 to nn do: n:=i^2+1:x:=factorset(n):x1:=nops(x):x2:=bigomega(n):if  x1=2 and x2=2 then z:=x[2]-x[1] :w:=sqrt(z):if w= floor(w) then printf(`%d,  `, i):else fi:else fi :od:
    # Alternative:
    N:= 500: # to get a(1) to a(N)
    count:= 0:
    for k from 2 by 2 while count < N do
      f:= ifactors(k^2+1)[2];
      if nops(f) = 2 and {f[1,2],f[2,2]}={1} and issqr(abs(f[1,1]-f[2,1])) then
        count:= count+1;
        A[count]:= k;
      fi
    od:
    seq(A[i],i=1..count); # Robert Israel, Jun 09 2014
  • Mathematica
    okQ[k_] := Module[{ff = FactorInteger[k^2+1]}, Length[ff] == 2 && ff[[All, 2]] == {1, 1} && IntegerQ[Sqrt[ff[[2, 1]] - ff[[1, 1]]]]];
    Select[Range[2, 40000, 2], okQ] (* Jean-François Alcover, Jun 25 2019 *)
  • Sage
    A = []
    for k in range(2, 2000, 2):
        K = k^2 + 1
        f = prime_divisors(K)
        if len(f) == 2:
            if mul(f) == K:
                if is_square(abs(f[0]-f[1])):
                    A.append(k)
    print(A) # Peter Luschny, Jun 10 2014

A238947 Numbers k such that k^2 + 1 = p*q, p < q primes and q-p is a power of 2.

Original entry on oeis.org

8, 100, 3524, 5084, 36680, 77980, 21474824, 134201344, 148647496, 300741464, 73851531256, 153122539756, 778318386944, 6669171349484, 16526971109344, 596403262068016, 9376599920124524, 26698166963373164, 140144514160214876, 1613032378604451500
Offset: 1

Views

Author

Michel Lagneau, Mar 07 2014

Keywords

Comments

Note that if n^2+1 = p*q, then p+q cannot be a power of 2. Proof by contradiction: There are two cases: p an odd prime and p=2. Case 1: suppose p and q are odd primes and q = 2^m-p. Then p(2^m-p) = n^2+1 for some even n. Rearranging terms, we obtain p*2^m-1 = p^2+n^2. Looking at this equation modulo 4, we obtain -1 = 1, a contradiction. Case 2: Let p=2. Then we obtain 2^(m+1)-n^2 = 5, which has no solutions in integers.

Examples

			8^2+1 = 65 = 5*13 and 13-5 = 2^3;
100^2+1 = 10001 = 73*137 and 137-73 = 2^6;
3524^2+1 = 12418577 = 3049*4073 and 4073-3049 = 2^10.
		

Crossrefs

Subsequence of A085722.

Programs

  • Maple
    with(numtheory):for a from 1 to 200000 do:p:=ithprime(a):for i from 1 to 50 do:q:=p+2^i:if type(q,prime)=true then x:=sqrt(p*q-1):if x=floor(x) then print(x):else fi:fi:od:od:
  • Mathematica
    Select[Range[10^5],!PrimeQ[#^2+1]&&Plus@@Last/@FactorInteger[#^2+1]==2&&PrimeNu[#^2+1]==2&&IntegerQ[Log[2,FactorInteger[#^2+1][[2]][[1]]-FactorInteger[#^2+1][[1]][[1]]]]&]
  • PARI
    isok(n) = (bigomega(n^2+1) == 2) && (f = factor(n^2+1)) && ((f[2, 1] - f[1, 1])== 2^(valuation(f[2, 1] - f[1, 1], 2))); \\ Michel Marcus, Mar 07 2014

Extensions

a(7)-a(20) from Giovanni Resta, Mar 07 2014

A247018 Numbers of the form 3*z^2 + z + 3 for some integer z.

Original entry on oeis.org

3, 5, 7, 13, 17, 27, 33, 47, 55, 73, 83, 105, 117, 143, 157, 187, 203, 237, 255, 293, 313, 355, 377, 423, 447, 497, 523, 577, 605, 663, 693, 755, 787, 853, 887, 957, 993, 1067, 1105, 1183, 1223, 1305, 1347, 1433, 1477, 1567, 1613, 1707, 1755, 1853, 1903
Offset: 1

Views

Author

Matt C. Anderson, Sep 09 2014

Keywords

Comments

Note that z is allowed to be negative. - N. J. A. Sloane, Jul 09 2021
Subsequence of A134407.
Numbers k such that 12*k - 35 is a square. - Robert Israel, Sep 18 2014

Crossrefs

Programs

  • Maple
    select(t -> issqr(12*t-35), [$1..1000]); # Robert Israel, Sep 18 2014
  • Mathematica
    Union[Flatten[Table[3z^2+{z,-z}+3,{z,0,40}]]] (* or *) LinearRecurrence[ {1,2,-2,-1,1},{3,5,7,13,17},60] (* Harvey P. Dale, Jul 10 2021 *)
  • PARI
    Vec(x*(3 + 2*x - 4*x^2 + 2*x^3 + 3*x^4) / ((1 - x)^3*(1 + x)^2) + O(x^60)) \\ Colin Barker, Feb 01 2018

Formula

From Colin Barker, Feb 01 2018: (Start)
G.f.: x*(3 + 2*x - 4*x^2 + 2*x^3 + 3*x^4) / ((1 - x)^3*(1 + x)^2).
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5) for n>5. (End)

Extensions

At some point in the history of this entry the definition was changed from the correct definition to the erroneous "a(n) = 3*n^2 + n + 3". I have restored the original definition, and I deleted some incorrect programs. Thanks to Harvey P. Dale for pointing out that something was wrong. - N. J. A. Sloane, Jul 09 2021.

A248511 Difference between k and the least prime factor of k^2+1 where k is the n-th number with k^2+1 composite.

Original entry on oeis.org

1, 3, 5, 3, 7, 9, 7, 11, 13, 15, 13, 17, 19, 17, 21, 23, 25, 23, 27, 13, 29, 27, 31, 21, 33, 35, 33, 37, 39, 37, 41, 31, 43, 17, 45, 43, 47, 9, 49, 47, 51, 53, 55, 53, 57, 47, 59, 57, 61, 47, 63, 65, 63, 67, 57, 69, 67, 71, 73, 23, 75, 73, 77, 43, 79, 77, 81
Offset: 1

Views

Author

Michel Lagneau, Oct 07 2014

Keywords

Comments

a(n) = A134407(n) - least prime divisor of A134406(n).

Examples

			a(1) = 1 because the first composite is 3^2+1 = 2*5 and 3-2 = 1.
		

Crossrefs

Programs

  • Maple
    with(numtheory):
       for n from 1 to 200 do:
        p:=n^2+1:x:=factorset(p):d:=n-x[1]:
        if type(p,prime)=false
        then
        printf(`%d, `,d):
        else
        fi:
       od:

A180508 Numbers k such that k^2 + 1 = p*q, p and q primes and | p-q | <= k.

Original entry on oeis.org

3, 8, 46, 50, 76, 100, 144, 266, 274, 334, 504, 516, 526, 566, 670, 726, 756, 810, 836, 844, 1064, 1086, 1164, 1250, 1300, 1714, 1740, 1800, 1826, 1834, 1946, 1950, 2014, 2194, 2220, 2440, 2450, 2466, 2494, 2560, 2610
Offset: 1

Views

Author

Michel Lagneau, Jan 20 2011

Keywords

Comments

|p - q| = k for k = 3, 8, 144.

Examples

			46 is in the sequence because 46^2 + 1 = 29*73, and 73-29 = 44 < 46.
		

Crossrefs

Programs

  • Maple
    with(numtheory):for n from 1 to 4000 do: x:=n^2+1:y:=factorset(x):yy:=bigomega(x):if
      yy=2 and (y[2]-y[1] < n or y[2]-y[1] = n) then printf(`%d, `,n):else fi:od:

A248015 Positive numbers n such that n^2 + 1 is composite and there are no positive integers c and z such that n = c*z^2 + z + c.

Original entry on oeis.org

8, 18, 28, 30, 34, 44, 46, 48, 50, 58, 60, 64, 68, 70, 76, 78, 86, 88, 96, 98, 100, 104, 108, 114, 118, 128, 136, 144, 148, 158, 164, 166, 168, 178, 186, 188, 190, 194, 196, 198, 200
Offset: 1

Views

Author

Matt C. Anderson, Sep 29 2014

Keywords

Comments

Subset of A134407.
If f(x) = x^2 + 1 and g(c,y) = c*y^2 + y + c then the algebraic substitution of g for x gives a factorization: f(g(c,y)) = (y^2 + 1)*(c^2*y^2 + c^2 + 2*c*y + 1). Since both factors of f(g(c,y)) are integers greater than one, f(g(c,y)) is a composite number.
The numbers are necessarily even terms from A134407 since for odd n = 2c + 1 one has the "forbidden" decomposition with z = 1. - M. F. Hasler, Oct 04 2014

Crossrefs

Cf. A134407.

Programs

  • Maple
    maxn:=200:
    mb:=proc(n::integer)::integer;
      if isprime(n^2+1)=false then return n else return -1 fi;
    end proc:
    A134407 := Vector(maxn):
    for a from 1 to maxn do A134407[a]:= mb(a): end do:
    A134407s:=convert(A134407,'set') minus {-1}:
    A134407l:=convert(A134407s,'list'):
    for c from 1 to 200 do
      for z from 1 to 20 do
        A134407s := A134407s minus {c*z^2 + z + c}:
      end do:
    end do:
    A134407s;
  • PARI
    is(n)={!bittest(n,0)&&!isprime(n^2+1)&&!for(z=2,sqrtint(n),(n-z)%(z^2+1)||return)} \\ M. F. Hasler, Oct 04 2014
Showing 1-8 of 8 results.