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.

A160053 Duplicate of A140612.

Original entry on oeis.org

0, 1, 4, 8, 9, 16, 17, 25, 36, 40, 49, 52, 64, 72, 73, 80, 81, 89, 97, 100, 116, 121, 136
Offset: 1

Views

Author

Zak Seidov, May 01 2009

Keywords

A050795 Numbers n such that n^2 - 1 is expressible as the sum of two nonzero squares in at least one way.

Original entry on oeis.org

3, 9, 17, 19, 33, 35, 51, 73, 81, 99, 105, 129, 145, 147, 161, 163, 179, 195, 201, 233, 243, 273, 289, 291, 297, 339, 361, 387, 393, 451, 465, 467, 483, 489, 513, 521, 577, 579, 585, 611, 627, 649, 675, 721, 723, 739, 777, 801, 809, 819, 849, 883, 899, 915
Offset: 1

Views

Author

Patrick De Geest, Sep 15 1999

Keywords

Comments

Analogous solutions exist for the sum of two identical squares z^2-1 = 2.r^2 (e.g. 99^2-1 = 2.70^2). Values of 'z' are the terms in sequence A001541, values of 'r' are the terms in sequence A001542.
Looking at a^2 + b^2 = c^2 - 1 modulo 4, we must have a and b even and c odd. Taking a = 2u, b = 2v and c = 2w - 1 and simplifying, we get u^2 + v^2 = w(w+1). - Franklin T. Adams-Watters, May 19 2008
If n is in this sequence, then so is n^(2^k), for all k >= 0. - Altug Alkan, Apr 13 2016

Examples

			E.g. 51^2 - 1 = 10^2 + 50^2 = 22^2 + 46^2 = 34^2 + 38^2.
		

Crossrefs

Programs

  • Mathematica
    t={}; Do[i=c=1; While[iJayanta Basu, Jun 01 2013 *)
    Select[Range@ 1000, Length[PowersRepresentations[#^2 - 1, 2, 2] /. {0, } -> Nothing] > 0 &] (* _Michael De Vlieger, Apr 13 2016 *)
  • PARI
    select( {is_A050795(n)=#qfbsolve(Qfb(1,0,1),n^2-1,2)}, [1..999]) \\ M. F. Hasler, Mar 07 2022
  • Python
    from itertools import islice, count
    from sympy import factorint
    def A050795_gen(startvalue=2): # generator of terms >= startvalue
        for k in count(max(startvalue,2)):
            if all(map(lambda d: d[0] % 4 != 3 or d[1] % 2 == 0, factorint(k**2-1).items())):
                yield k
    A050795_list = list(islice(A050795_gen(),20)) # Chai Wah Wu, Mar 07 2022
    

Formula

a(n) = 2*A140612(n) + 1. - Franklin T. Adams-Watters, May 19 2008
{k : A025426(k^2-1)>0}. - R. J. Mathar, Mar 07 2022

A304441 Numbers k such that 8k, 8k+1 and 8k+2 are the sum of two squares; A082982 / 8.

Original entry on oeis.org

0, 1, 2, 9, 10, 18, 29, 36, 45, 65, 72, 73, 100, 101, 136, 137, 144, 153, 164, 200, 208, 218, 225, 234, 245, 281, 288, 289, 298, 324, 325, 353, 416, 424, 441, 450, 514, 522, 541, 578, 640, 648, 666, 676, 738, 757
Offset: 1

Views

Author

M. F. Hasler, May 13 2018

Keywords

Comments

Numbers n such that n and n+1 are in the sequence: 0, 1, 9, 72, 100, 136, 288, 324, ...: appear to be in A155562, A140612, and A243180, and in A020684 (except for 1), A034024 & A135571 (except for 0, 1).

Crossrefs

Programs

Formula

a(n) = A082982(n) / 8.

A328224 Numbers k such that each of k, k+1, k+2, and k+4 is a sum of two squares.

Original entry on oeis.org

0, 16, 144, 288, 576, 1152, 1600, 2304, 3328, 3600, 4624, 5184, 7056, 8352, 10368, 10656, 10816, 11808, 12112, 12240, 12544, 13120, 13840, 16704, 17424, 19600, 19728, 20736, 20752, 21312, 21904, 22048, 23200, 24480, 24784, 25920, 27792, 28960, 29520, 29824, 30976, 31264, 32400
Offset: 1

Views

Author

Max Alekseyev, Oct 08 2019

Keywords

Comments

All terms are divisible by 16. - Robert Israel, Oct 10 2019

Crossrefs

Intersection of A082982 and A328223.

Programs

  • Magma
    [k:k in [0..33000]| forall{k+a: a in [0,1,2,4]|NormEquation(1, k+a) eq true}]; // Marius A. Burtea, Oct 08 2019
  • Maple
    ss:=  proc(n) option remember;
      andmap(t -> t[2]::even or t[1] mod 4 <> 3, ifactors(n)[2])
    end proc:
    select(k -> ss(k) and ss(k+1) and ss(k+2) and ss(k+4), 16*[$0..10^4]); # Robert Israel, Oct 10 2019
  • Mathematica
    ok[n_] := AllTrue[{0,1,2,4}, SquaresR[2, #+n] > 0 &]; Select[ Range[0, 32400], ok] (* Giovanni Resta, Oct 08 2019 *)

A298950 Numbers k such that 5*k - 4 is a square.

Original entry on oeis.org

1, 4, 8, 17, 25, 40, 52, 73, 89, 116, 136, 169, 193, 232, 260, 305, 337, 388, 424, 481, 521, 584, 628, 697, 745, 820, 872, 953, 1009, 1096, 1156, 1249, 1313, 1412, 1480, 1585, 1657, 1768, 1844, 1961, 2041, 2164, 2248, 2377, 2465, 2600, 2692, 2833, 2929, 3076, 3176, 3329, 3433
Offset: 1

Views

Author

Bruno Berselli, Jan 30 2018

Keywords

Comments

a(n) is a member of A140612. Proof: a(n) = n^2 + (n/2-1)^2 for even n, otherwise a(n) = (n-1)^2 + ((n+1)/2)^2; also, a(n) + 1 = (n-1)^2 + (n/2+1)^2 for even n, otherwise a(n) + 1 = n^2 + ((n-3)/2)^2. Therefore, both a(n) and a(n) + 1 belong to A001481.
Primes in sequence are listed in A245042.
Squares in sequence are listed in A081068.

Crossrefs

Cf. A195162: numbers k such that 5*k + 4 is a square.
Subsequence of A001481, A020668, A036404, A140612.
Cf. A036666, A081068, A106833 (first differences), A245042.

Programs

  • GAP
    List([1..60], n -> (10*n*(n-1)+(2*n-1)*(-1)^n+9)/8);
    
  • Magma
    [(10*n*(n-1)+(2*n-1)*(-1)^n+9)/8: n in [1..60]];
    
  • Mathematica
    Table[(10 n (n - 1) + (2 n - 1) (-1)^n + 9)/8, {n, 1, 60}]
    LinearRecurrence[{1,2,-2,-1,1},{1,4,8,17,25},60] (* Harvey P. Dale, Sep 16 2022 *)
  • Maxima
    makelist((10*n*(n-1)+(2*n-1)*(-1)^n+9)/8, n, 1, 60);
    
  • PARI
    Vec((1+x^2)*(1+3*x+x^2)/((1-x)^3*(1+x)^2)+O(x^60))
    
  • PARI
    vector(60, n, nn; (10*n*(n-1)+(2*n-1)*(-1)^n+9)/8)
    
  • Python
    [(10*n*(n-1)+(2*n-1)*(-1)**n+9)/8 for n in range(1, 60)]
  • Sage
    [(10*n*(n-1)+(2*n-1)*(-1)^n+9)/8 for n in (1..60)]
    

Formula

G.f.: x*(1 + x^2)*(1 + 3*x + x^2)/((1 - x)^3*(1 + x)^2).
a(n) = a(1-n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
a(n) = (10*n*(n-1) + (2*n-1)*(-1)^n + 9)/8.
a(n) = A036666(n) + 1.

A328223 Numbers k such that both k and k+4 are sums of two squares.

Original entry on oeis.org

0, 1, 4, 5, 9, 13, 16, 25, 32, 36, 37, 41, 45, 49, 61, 64, 68, 81, 85, 97, 100, 109, 113, 117, 121, 144, 145, 149, 153, 160, 169, 181, 193, 196, 208, 221, 225, 229, 241, 256, 257, 261, 265, 277, 288, 289, 292, 313, 320, 324, 333, 349, 356, 361, 365, 369, 373, 388, 397, 400
Offset: 1

Views

Author

Max Alekseyev, Oct 08 2019

Keywords

Crossrefs

Subsequence of A001481. Contains A328224 as a subsequence.

Programs

  • Magma
    [k: k in [0..400] | NormEquation(1, k) eq true and NormEquation(1, k+4) eq true]; // Marius A. Burtea, Oct 08 2019
  • Mathematica
    ok[n_] := AllTrue[{0, 4}, SquaresR[2, # + n] > 0 &]; Select[Range[0, 400], ok] (* Giovanni Resta, Oct 08 2019 *)

A333443 Numbers k such that both k and k+1 are sums of two positive squares in 2 or more ways.

Original entry on oeis.org

985, 1585, 1768, 1780, 2249, 2329, 2500, 2929, 3280, 3649, 3977, 4264, 4329, 4705, 4849, 5017, 5044, 5065, 5140, 5161, 5512, 5617, 5625, 6340, 6409, 6697, 7240, 7684, 7785, 7956, 7969, 8020, 8065, 8320, 8584, 8905, 9089, 9265, 9529, 9553, 9593, 9700, 9809
Offset: 1

Views

Author

Mateusz Winiarski, Mar 21 2020

Keywords

Comments

Numbers k such that both k and k+1 belong to A007692.

Examples

			985 is a term since 12^2 + 29^2 = 16^2 + 27^2 = 985 and 5^2 + 31^2 = 19^2 + 25^2 = 986.
625 is not a term because 626 cannot be written as the sum of two positive squares in more than one way.
		

Crossrefs

Subsequence of A007692.

Programs

  • Mathematica
    ok[n_] := Length@ IntegerPartitions[n, {2}, Range[Sqrt@ n]^2] >= 2; Select[ Range@ 10000, ok[#] && ok[#+1] &] (* Giovanni Resta, Mar 24 2020 *)
  • Python
    n=100
    t=[]
    prev=0
    A333443=[]
    for i in range(1,n+1):
        t.append(i*i)
    for j in range(n**2):
        n=0
        for k in t[:j+1]:
            if j-k in t and k<=j-k:
                n=n+1
                if n>1:
                    if j-prev==1:
                        A333443.append(j-1)
                    prev=j

A374087 a(n) is the number of ways to partition {1,2,...,n} into two sets X and Y such that the sum of the elements of each is a square.

Original entry on oeis.org

1, 1, 0, 0, 1, 0, 0, 0, 1, 8, 0, 0, 0, 0, 0, 0, 365, 8, 0, 0, 0, 0, 0, 0, 0, 91514, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 104742767, 0, 0, 0, 6519062, 0, 0, 0, 0, 0, 0, 0, 0, 531168463492, 0, 0, 15329991499, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11530164811834907, 0, 0, 0, 0
Offset: 0

Views

Author

Gonzalo Martínez, Jun 27 2024

Keywords

Comments

{X, Y} satisfies the property if there exists an integer k such that n*(n+1)/2 - k^2 is a square, where k^2 is the sum of the elements of X and n*(n + 1)/2 - k^2 the sum of the elements of Y.
Note that k can also be zero. If n is A001108(k), i.e., if n*(n + 1)/2 is a perfect square, it suffices to take X = {1, 2, ..., n} and Y = { }.
a(n) > 0 if and only if n is a term of A140612.
Proof: (==>) If n is such that a(n) > 0, then it is possible to partition {1,2,...,n} into two sets, X and Y, whose sums of elements are b^2 and c^2, respectively, for some integers b, c. Then, n*(n + 1)/2 = b^2 + c^2, so, n*(n + 1) = 2*(b^2 + c^2) = (b + c)^2 + (b - c)^2, i.e., n*(n + 1) is a sum of two squares, whence necessarily n and (n + 1) are sums of two squares. Thus, n is in A140612.
(<==) If n is A140612, then n and (n + 1) are sums of two squares, whence it follows that n*(n + 1) is a sum of 2 squares and is also even. Then n*(n + 1)/2 is also a sum of two squares. Then, there exist integers k and m such that n*(n + 1)/2 = k^2 + m^2, so that n*(n + 1)/2 - k^2 = m^2. Therefore, given the set {1,2,...,n}, if we choose X such that the sum of the elements is k^2, it follows that a(n) > 0.

Examples

			If n = 4, then the only way is {1}, {2, 3, 4}.
If n = 8, then the only way is { }, {1, 2, 3, 4, 5, 6, 7, 8}.
If n = 9, there are 8 ways, which are shown below:
  {9},  {1, 2, 3, 4, 5, 6, 7, 8}
  {1, 8}, {2, 3, 4, 5, 6, 7, 9}
  {2, 7}, {1, 3, 4, 5, 6, 8, 9}
  {3, 6}, {1, 2, 4, 5, 7, 8, 9}
  {4, 5}, {1, 2, 3, 6, 7, 8, 9}
  {1, 2, 6}, {3, 4, 5, 7, 8, 9}
  {1, 3, 5}, {2, 4, 6, 7, 8, 9}
  {2, 3, 4}, {1, 5, 6, 7, 8, 9}
In each of the 8 cases, the sum of the elements of the subsets are 9 and 36, respectively.
If n = 25, there are 91514 ways. Some examples with sums different from each other:
  {1}, {2, 3, ..., 25}, where the sums are 1^2 and 18^2, respectively.
  {1, 2, 3, 4, 5, 6, 7, 8}, {9, 10, 11, ..., 25}, where the sums are 6^2 and 17^2.
  X = {6, 22, 23, 24, 25}, Y = {1, 2, ..., 25} - X, whose sums are 10^2 and 15^2.
		

Crossrefs

Extensions

a(36)-a(68) from Alois P. Heinz, Jun 29 2024
Showing 1-8 of 8 results.