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-10 of 23 results. Next

A155716 Numbers of the form N = a^2 + 6b^2 for some positive integers a,b.

Original entry on oeis.org

7, 10, 15, 22, 25, 28, 31, 33, 40, 42, 49, 55, 58, 60, 63, 70, 73, 79, 87, 88, 90, 97, 100, 103, 105, 106, 112, 118, 121, 124, 127, 132, 135, 145, 150, 151, 154, 159, 160, 166, 168, 175, 177, 186, 193, 196, 198, 199, 202, 214, 217, 220, 223, 225, 231, 232, 240
Offset: 1

Views

Author

M. F. Hasler, Jan 25 2009

Keywords

Comments

Subsequence of A002481 (which allows for a and b to be zero).
Primes are in A033199. - Bernard Schott, Sep 20 2019

Crossrefs

Programs

  • Mathematica
    With[{upto=240},Select[Union[#[[1]]^2+6#[[2]]^2&/@Tuples[ Range[Sqrt[ upto]], 2]],#<=upto&]] (* Harvey P. Dale, Aug 05 2016 *)
  • PARI
    isA155716(n,/* optional 2nd arg allows us to get other sequences */c=6) = { for(b=1,sqrtint((n-1)\c), issquare(n-c*b^2) & return(1))}
    for( n=1,999, isA155716(n) & print1(n","))
    
  • PARI
    upto(n) = my(res=List()); for(i=1,sqrtint(n),for(j=1, sqrtint((n - i^2) \ 6), listput(res, i^2 + 6*j^2))); listsort(res,1); res \\ David A. Corneth, Sep 18 2019

A097269 Numbers that are the sum of two nonzero squares but not the difference of two nonzero squares.

Original entry on oeis.org

2, 10, 18, 26, 34, 50, 58, 74, 82, 90, 98, 106, 122, 130, 146, 162, 170, 178, 194, 202, 218, 226, 234, 242, 250, 274, 290, 298, 306, 314, 338, 346, 362, 370, 386, 394, 410, 442, 450, 458, 466, 482, 490, 514, 522, 530, 538, 554, 562, 578, 586, 610, 626, 634
Offset: 1

Views

Author

Ray Chandler, Aug 19 2004

Keywords

Comments

Intersection of A000404 (sum of squares) and complement of A024352 (difference of squares).
Numbers of the form 4k+2 = double of an odd number, with the odd number equal to the sum of 2 squares (sequence A057653). - Jean-Christophe Hervé, Oct 24 2015
Numbers that are the sum of two odd squares. - Jean-Christophe Hervé, Oct 25 2015

Examples

			2 = 1^2 + 1^2, 10 = 1^2 + 3^2, 18 = 3^2 + 3^2.
		

Crossrefs

Programs

  • PARI
    is(n)=if(n%4!=2,return(0)); my(f=factor(n/2)); for(i=1,#f[,1],if(bitand(f[i,2],1)==1&&bitand(f[i,1],3)==3, return(0))); 1 \\ Charles R Greathouse IV, May 31 2013
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A097269_gen(): # generator of terms
        return filter(lambda n:all(p & 3 != 3 or e & 1 == 0 for p, e in factorint(n//2).items()),count(2,4))
    A097269_list = list(islice(A097269_gen(),30)) # Chai Wah Wu, Jun 28 2022

A155578 Intersection of A000404 and A155717: N = a^2 + b^2 = c^2 + 7*d^2 for some positive integers a,b,c,d.

Original entry on oeis.org

8, 29, 32, 37, 53, 72, 109, 113, 116, 128, 137, 148, 149, 193, 197, 200, 212, 232, 233, 261, 277, 281, 288, 296, 317, 333, 337, 373, 389, 392, 400, 401, 421, 424, 436, 449, 452, 457, 464, 477, 512, 541, 548, 557, 569, 592, 596, 613, 617, 641, 648, 653, 673
Offset: 1

Views

Author

M. F. Hasler, Jan 25 2009

Keywords

Comments

Subsequence of A155568 (where a,b,c,d may be zero).

Crossrefs

Programs

  • PARI
    isA155578(n,/* optional 2nd arg allows us to get other sequences */c=[7,1]) = { for(i=1,#c, for(b=1,sqrtint((n-1)\c[i]), issquare(n-c[i]*b^2) & next(2)); return);1}
    for( n=1,999, isA155578(n) & print1(n","))
    
  • Python
    from math import isqrt
    def aupto(limit):
        cands = range(1, isqrt(limit)+1)
        left =  set(a**2 +   b**2 for a in cands for b in cands)
        right = set(c**2 + 7*d**2 for c in cands for d in cands)
        return sorted(k for k in left & right if k <= limit)
    print(aupto(673)) # Michael S. Branicky, Aug 29 2021

A155717 Numbers of the form N = a^2 + 7b^2 for some positive integers a,b.

Original entry on oeis.org

8, 11, 16, 23, 29, 32, 37, 43, 44, 53, 56, 64, 67, 71, 72, 77, 79, 88, 92, 99, 107, 109, 112, 113, 116, 121, 127, 128, 137, 144, 148, 149, 151, 161, 163, 172, 176, 179, 184, 191, 193, 197, 200, 203, 207, 211, 212, 224, 232, 233, 239, 253, 256, 259, 261, 263, 268
Offset: 1

Views

Author

M. F. Hasler, Jan 25 2009

Keywords

Comments

Subsequence of A020670 (which allows for a and b to be zero).
If N=a^2+7*b^2 is a term then 7*N=(7*b)^2+7*a^2 is also a term. Conversely,if 7*N is a term then N is a term. Example: N=56; N/7=8 is a term, N*7=7^2+7*7^2 is a term. Sequences A154777, A092572 and A154778 have the same property with 7 replaced by prime numbers 2,3 and 5 respectively. - Jerzy R Borysowicz, May 22 2020

Crossrefs

Programs

  • Mathematica
    Select[Range[300], Reduce[a>0 && b>0 && # == a^2 + 7b^2, {a, b}, Integers] =!= False&] (* Jean-François Alcover, Nov 17 2016 *)
  • PARI
    isA155717(n,/* optional 2nd arg allows us to get other sequences */c=7) = { for(b=1,sqrtint((n-1)\c), issquare(n-c*b^2) & return(1))}
    for( n=1,300, isA155717(n) & print1(n","))
    
  • Python
    def aupto(limit):
        cands = range(1, int(limit**.5)+2)
        nums = [a**2 + 7*b**2 for a in cands for b in cands]
        return sorted(set(k for k in nums if k <= limit))
    print(aupto(268)) # Michael S. Branicky, Aug 11 2021

A155707 Numbers expressible as a^2 + k b^2 with nonzero integers a,b, for k=2, k=3, k=5 and k=7.

Original entry on oeis.org

144, 576, 1009, 1129, 1201, 1296, 1801, 1849, 2304, 2521, 2689, 2881, 3049, 3361, 3529, 3600, 3889, 4036, 4201, 4356, 4489, 4516, 4561, 4729, 4804, 5184, 5209, 5569, 5881, 5929, 6841, 7009, 7056, 7204, 7396, 7561, 7681, 8089, 8521, 8689, 8761, 8929
Offset: 1

Views

Author

M. F. Hasler, Feb 10 2009

Keywords

Comments

Subsequence of A155708.

Crossrefs

Programs

  • Maple
    filter:= proc(x) local k,S;
       if numtheory:-quadres(x,3*5*7)<> 1 then return false fi;
       for k in [2,3,5,7] do
         S:= [isolve(x = a^2 + k*b^2)];
         if andmap(t -> subs(t,a*b) = 0, S) then return false fi;
       od;
       true
    end proc;
    select(filter, [$1..10000]); # Robert Israel, May 14 2025
  • PARI
    isA155707(n,/* optional 2nd arg allows us to get other sequences */c=[7, 5, 3, 2]) = { for(i=1, #c, for(b=1, sqrtint((n-1)\c[i]), issquare(n-c[i]*b^2) & next(2)); return); 1}
    for(n=1,9999, isA155707(n) & print1(n","))

A097271 Numbers that are neither the sum of two nonzero squares nor the difference of two nonzero squares.

Original entry on oeis.org

1, 4, 6, 14, 22, 30, 38, 42, 46, 54, 62, 66, 70, 78, 86, 94, 102, 110, 114, 118, 126, 134, 138, 142, 150, 154, 158, 166, 174, 182, 186, 190, 198, 206, 210, 214, 222, 230, 238, 246, 254, 258, 262, 266, 270, 278, 282, 286, 294, 302, 310, 318, 322, 326, 330, 334
Offset: 1

Views

Author

Ray Chandler, Aug 19 2004

Keywords

Comments

Complement of union of A000404 (sum of squares) and A024352 (difference of squares).
Differs from A062316 only in having an initial 1,4.

Crossrefs

Programs

  • Mathematica
    Module[{nn=70,sq},sq=Flatten[{Total[#],Abs[#[[1]]-#[[2]]]}&/@Tuples[ Range[ 3nn]^2,2]]//Union;Take[Complement[Range[Max[sq]],sq],nn]] (* Harvey P. Dale, Nov 04 2016 *)

A155715 Least number expressible as a^2 + k b^2 with positive integers a,b, for each k=1,...,n.

Original entry on oeis.org

2, 17, 73, 73, 241, 241, 1009, 1009, 1009, 1009, 7561, 7561, 21961, 32356, 32356, 32356, 44641, 44641, 349924, 349924, 349924, 349924, 1399696, 1399696, 1399696, 3027249, 3027249, 3027249, 4349601, 4349601, 18567396, 18567396, 18567396
Offset: 1

Views

Author

M. F. Hasler, Jan 27 2009

Keywords

Comments

Sequence A028372 considers primes with this property, but allowing for nonzero a,b (which obviously is irrelevant for n>2). Up to n=13, the terms of the present sequence are prime without imposing it explicitely and thus coincide with A028372 except for n=2.
a(n) > 10^9 for n >= 47. [From Donovan Johnson, Sep 29 2009]

Examples

			a(1) = 2 = 1^2 + 1^2 is the least number of the sequence A000404 (sum of positive squares). a(2) = 17 = 1^2 + 4^2 = 3^2 + 2*2^2 is the least number in sequence A000404 to be in sequence A154777 (a^2+2b^2)as well. a(3) = 73 = 3^2 + 8^2 = 1^2 + 2*6^2 = 5^2 + 3*4^2 is the least number in the intersection of sequences A000404, A154777 and A092572 (a^2+3b^2).
		

Crossrefs

Programs

  • PARI
    k=1; for( n=1,10^9, forstep( c=k,1,-1, for( b=1,sqrtint((n-1)\c), issquare(n-c*b^2) & next(2));next(2)); print1(n",");k++;n--)

Extensions

a(23)-a(46) and b-file from Donovan Johnson, Sep 29 2009

A097270 Numbers that are the difference of two nonzero squares but not the sum of two nonzero squares.

Original entry on oeis.org

3, 7, 9, 11, 12, 15, 16, 19, 21, 23, 24, 27, 28, 31, 33, 35, 36, 39, 43, 44, 47, 48, 49, 51, 55, 56, 57, 59, 60, 63, 64, 67, 69, 71, 75, 76, 77, 79, 81, 83, 84, 87, 88, 91, 92, 93, 95, 96, 99, 103, 105, 107, 108, 111, 112, 115, 119, 120, 121, 123, 124, 127, 129, 131, 132
Offset: 1

Views

Author

Ray Chandler, Aug 19 2004

Keywords

Comments

Intersection of A024352 (difference of squares) and complement of A000404 (sum of squares).

Crossrefs

A155708 Numbers expressible as a^2 + k*b^2 with nonzero integers a,b, for k=2, k=3 and k=5.

Original entry on oeis.org

36, 129, 144, 201, 241, 324, 409, 441, 489, 516, 576, 601, 769, 804, 849, 900, 921, 964, 1009, 1129, 1161, 1201, 1249, 1296, 1321, 1489, 1521, 1569, 1609, 1636, 1641, 1764, 1801, 1809, 1849, 1929, 1956, 2064, 2089, 2161, 2169, 2281, 2304, 2361, 2404, 2521
Offset: 1

Views

Author

M. F. Hasler, Feb 10 2009

Keywords

Crossrefs

Programs

  • Maple
    N:= 10000: # to get all terms <= N
    S[2]:= {}: S[3]:= {}: S[5]:= {}:
    for a from 1 to floor(sqrt(N)) do
      for k in [2,3,5] do
        S[k]:= S[k] union {seq(a^2 + k*b^2, b = 1 .. floor(sqrt((N-a^2)/k)))}
      od
    od:
    R:= S[2] intersect S[3] intersect S[5]:
    sort(convert(R,list)); # Robert Israel, Jul 11 2018
  • PARI
    isA155708(n, /* optional 2nd arg allows us to get other sequences */c=[5, 3, 2]) = { for(i=1, #c, for(b=1, sqrtint((n-1)\c[i]), issquare(n-c[i]*b^2) & next(2)); return); 1}
    for(n=1,9999, isA155708(n) & print1(n","))

A155712 Intersection of A092572 and A155716: N = a^2 + 3b^2 = c^2 + 6d^2 for some positive integers a,b,c,d.

Original entry on oeis.org

7, 28, 31, 49, 63, 73, 79, 97, 100, 103, 112, 124, 127, 151, 175, 193, 196, 199, 217, 223, 241, 252, 271, 279, 292, 313, 316, 337, 343, 367, 388, 400, 409, 412, 433, 439, 441, 448, 457, 463, 484, 487, 496, 508, 511, 553, 567, 577, 601, 604, 607, 631, 657, 673
Offset: 1

Views

Author

M. F. Hasler, Jan 25 2009

Keywords

Comments

From Robert Israel, Jan 19 2025: (Start)
If k is a term, then so is j^2 * k for all positive integers j.
The primes in this sequence appear to be A033199.
(End)

Crossrefs

Programs

  • Maple
    N:= 1000: # for terms <= N
    A:= {seq(seq(a^2 + 3*b^2, b=1 .. floor(sqrt((N-a^2)/3))),a=1..floor(sqrt(N)))}
       intersect {seq(seq(c^2 + 6*d^2, d = 1 .. floor(sqrt((N-c^2)/6))),c=1..floor(sqrt(N)))}:
    sort(convert(A,list)); # Robert Israel, Jan 19 2025
  • PARI
    isA155712(n,/* optional 2nd arg allows to get other sequences */c=[6,3]) = { for(i=1,#c, for(b=1,sqrtint((n-1)\c[i]), issquare(n-c[i]*b^2) && next(2)); return);1}
    for( n=1,999, isA155712(n) && print1(n",")) \\ Update to modern PARI syntax (& -> &&) by M. F. Hasler, Jan 18 2025
Showing 1-10 of 23 results. Next