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

A022544 Numbers that are not the sum of 2 squares.

Original entry on oeis.org

3, 6, 7, 11, 12, 14, 15, 19, 21, 22, 23, 24, 27, 28, 30, 31, 33, 35, 38, 39, 42, 43, 44, 46, 47, 48, 51, 54, 55, 56, 57, 59, 60, 62, 63, 66, 67, 69, 70, 71, 75, 76, 77, 78, 79, 83, 84, 86, 87, 88, 91, 92, 93, 94, 95, 96, 99, 102, 103, 105, 107, 108, 110, 111, 112, 114, 115, 118, 119, 120, 123, 124, 126, 127, 129, 131, 132, 133, 134, 135, 138, 139, 140, 141, 142, 143, 147, 150, 151, 152, 154, 155, 156, 158, 159, 161, 163, 165, 166, 167, 168, 171, 172, 174, 175, 176, 177, 179, 182, 183, 184, 186, 187, 188, 189, 190, 191, 192, 195, 198, 199
Offset: 1

Views

Author

Keywords

Comments

Conjecture: if k is not the sum of 2 squares then sigma(k) == 0 (mod 4) (the converse does not hold, as demonstrated by the entries in A025303). - Benoit Cloitre, May 19 2002
Numbers having some prime factor p == 3 (mod 4) to an odd power. sigma(n) == 0 (mod 4) because of this prime factor. Every k == 3 (mod 4) is a term. First differences are always 1, 2, 3 or 4, each occurring infinitely often. - David W. Wilson, Mar 09 2005
Complement of A000415 in the nonsquare positive integers A000037. - Max Alekseyev, Jan 21 2010
Integers with an equal number of 4k+1 and 4k+3 divisors. - Ant King, Oct 05 2010
A000161(a(n)) = 0; A070176(a(n)) > 0; A046712 is a subsequence. - Reinhard Zumkeller, Feb 04 2012, Aug 16 2011
There are arbitrarily long runs of consecutive terms. Record runs start at 3, 6, 21, 75, ... (A260157). - Ivan Neretin, Nov 09 2015
From Klaus Purath, Sep 04 2023: (Start)
There are no squares in this sequence.
There are also no numbers of the form n^2 + 1 (A002522) or n^2 + 4 (A087475).
Every term a(n) raised to an odd power belongs to the sequence just as every product of an odd number of terms. This is also true for all integer sequences represented by the indefinite binary quadratic forms a(n)*x^2 - y^2. These sequences also do not contain squares. (End)

References

  • Steven R. Finch, Mathematical Constants, Cambridge, 2003, pp. 98-104.

Crossrefs

Complement of A001481; subsequence of A111909.

Programs

  • Haskell
    import Data.List (elemIndices)
    a022544 n = a022544_list !! (n-1)
    a022544_list = elemIndices 0 a000161_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Magma
    [n: n in [0..160] | NormEquation(1, n) eq false]; // Vincenzo Librandi, Jan 15 2017
    
  • Mathematica
    Select[Range[199], Length[PowersRepresentations[ #, 2, 2]] == 0 &] (* Ant King, Oct 05 2010 *)
    Select[Range[200],SquaresR[2,#]==0&] (* Harvey P. Dale, Apr 21 2012 *)
  • PARI
    for(n=0,200,if(sum(i=0,n,sum(j=0,i,if(i^2+j^2-n,0,1)))==0,print1((n),",")))
    
  • PARI
    is(n)=if(n%4==3, return(1)); my(f=factor(n)); for(i=1,#f~, if(f[i,1]%4==3 && f[i,2]%2, return(1))); 0 \\ Charles R Greathouse IV, Sep 01 2015
    
  • Python
    def aupto(lim):
      squares = [k*k for k in range(int(lim**.5)+2) if k*k <= lim]
      sum2sqs = set(a+b for i, a in enumerate(squares) for b in squares[i:])
      return sorted(set(range(lim+1)) - sum2sqs)
    print(aupto(199)) # Michael S. Branicky, Mar 06 2021
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A022544_gen(): # generator of terms
        return filter(lambda n:any(p & 3 == 3 and e & 1 for p, e in factorint(n).items()),count(0))
    A022544_list = list(islice(A022544_gen(),30)) # Chai Wah Wu, Jun 28 2022

Formula

Limit_{n->oo} a(n)/n = 1.

Extensions

More terms from Benoit Cloitre, May 19 2002

A025441 Number of partitions of n into 2 distinct nonzero squares.

Original entry on oeis.org

0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 2, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0
Offset: 0

Views

Author

Keywords

Crossrefs

Cf. A060306 gives records; A052199 gives where records occur.
Column k=2 of A341040.
Cf. A004439 (a(n)=0), A025302 (a(n)=1), A025303 (a(n)=2), A025304 (a(n)=3), A025305 (a(n)=4), A025306 (a(n)=5), A025307 (a(n)=6), A025308 (a(n)=7), A025309 (a(n)=8), A025310 (a(n)=9), A025311 (a(n)=10), A004431 (a(n)>0).

Programs

  • Haskell
    a025441 n = sum $ map (a010052 . (n -)) $
                          takeWhile (< n `div` 2) $ tail a000290_list
    -- Reinhard Zumkeller, Dec 20 2013
    
  • Mathematica
    Table[Count[PowersRepresentations[n, 2, 2], pr_ /; Unequal @@ pr && FreeQ[pr, 0]], {n, 0, 107}] (* Jean-François Alcover, Mar 01 2019 *)
  • PARI
    a(n)=if(n>4,sum(k=1,sqrtint((n-1)\2),issquare(n-k^2)),0) \\ Charles R Greathouse IV, Jun 10 2016
    
  • PARI
    a(n)=if(n<5,return(0)); my(v=valuation(n, 2), f=factor(n>>v), t=1); for(i=1, #f[, 1], if(f[i, 1]%4==1, t*=f[i, 2]+1, if(f[i, 2]%2, return(0)))); if(t%2, t-(-1)^v, t)/2-issquare(n/2) \\ Charles R Greathouse IV, Jun 10 2016
    
  • Python
    from math import prod
    from sympy import factorint
    def A025441(n):
        f = factorint(n).items()
        return -int(not (any((e-1 if p == 2 else e)&1 for p,e in f) or n&1)) + (((m:=prod(1 if p==2 else (e+1 if p&3==1 else (e+1)&1) for p, e in f))+((((~n & n-1).bit_length()&1)<<1)-1 if m&1 else 0))>>1) if n else 0 # Chai Wah Wu, Sep 08 2022

Formula

a(A025302(n)) = 1. - Reinhard Zumkeller, Dec 20 2013
a(n) = Sum_{ m: m^2|n } A157228(n/m^2). - Andrey Zabolotskiy, May 07 2018
a(n) = [x^n y^2] Product_{k>=1} (1 + y*x^(k^2)). - Ilya Gutkovskiy, Apr 22 2019
a(n) = Sum_{i=1..floor((n-1)/2)} c(i) * c(n-i), where c is the square characteristic (A010052). - Wesley Ivan Hurt, Nov 26 2020
a(n) = A000161(n) - A093709(n). - Andrey Zabolotskiy, Apr 12 2022

A024508 Numbers that are a sum of 2 distinct nonzero squares in more than one way.

Original entry on oeis.org

65, 85, 125, 130, 145, 170, 185, 205, 221, 250, 260, 265, 290, 305, 325, 340, 365, 370, 377, 410, 425, 442, 445, 481, 485, 493, 500, 505, 520, 530, 533, 545, 565, 580, 585, 610, 625, 629, 650, 680, 685, 689, 697, 725, 730, 740, 745, 754, 765, 785, 793, 820, 845, 850, 865, 884, 890, 901, 905, 925, 949, 962, 965, 970, 985, 986, 1000, 1010, 1025, 1037, 1040, 1060, 1066, 1073, 1090, 1105, 1125
Offset: 1

Views

Author

Keywords

Comments

Appears to be n such that sigma(n)==0 (mod 4) and n is expressible as a sum of 2 squares. - Benoit Cloitre, Apr 20 2003
The comment that is in above is true most of the time. However if number of odd divisors of n that is a term of this sequence is not divisible by 4, then sigma(n) cannot be divisible by 4. For example; 325, 425, 625, 650, ... See also A000443 for more related examples. - Altug Alkan, Jun 09 2016
If m is a term then (a^2 + b^2) * m is a term for a,b > 0. Hence this sequence is closed under multiplication. - David A. Corneth, Jun 10 2016

Crossrefs

Cf. A001481, A025303 (exactly 2 ways), A025304 (exactly 3 ways), A025305 (exactly 4 ways), A025306 (exactly 5 ways).

Programs

  • Mathematica
    lst={};q=-1;k=1;Do[Do[x=a^2;Do[y=b^2;If[x+y==n,If[n==q&&k==1,AppendTo[lst,n]];If[n!=q,q=n;k=1,k++ ]],{b,Floor[(n-x)^(1/2)],a+1,-1}],{a,Floor[n^(1/2)],1,-1}],{n,2*6!}];lst (* Vladimir Joseph Stephan Orlovsky, Jan 22 2009 *)
  • PARI
    is(n) = {my(t=0,i);t=sum(i=1,sqrtint((n-1)\2),issquare(n-i^2));t>1} \\ David A. Corneth, Jun 10 2016
    
  • PARI
    is(n)=if(n<9,return(0)); my(v=valuation(n, 2), f=factor(n>>v), t=1); for(i=1, #f[, 1], if(f[i, 1]%4==1, t*=f[i, 2]+1, if(f[i, 2]%2, return(0)))); if(t%2, t-(-1)^v, t)/2-issquare(n/2)>1 \\ Charles R Greathouse IV, Jun 10 2016

A374256 a(n) is the smallest number which can be represented as the sum of n distinct positive n-th powers in exactly 2 ways, or -1 if no such number exists.

Original entry on oeis.org

-1, 65, 1009, 6834, 1158224, 19198660, 1518471174, 301963223843, 14599274102522, 1601155487573222
Offset: 1

Views

Author

Ilya Gutkovskiy, Jul 01 2024

Keywords

Examples

			a(2) = 65 = 1^2 + 8^2 = 4^2 + 7^2.
a(3) = 1009 = 1^3 + 2^3 + 10^3 = 4^3 + 6^3 + 9^3.
		

Crossrefs

Programs

  • Maple
    f:= proc(n) uses priqueue;
      local pq,w,t,g,i,count,newt;
      g:= proc(t) local i; [-add((t[i]+i)^n,i=1..n),op(t)] end proc;
      w:= [0$(n+1)];
      initialize(pq);
      insert(g([0$n]),pq);
      do
        t:= extract(pq);
        if t[1] = w[1] then return -t[1] fi;
        w:= t;
        for i from 2 to n+1 do
            if t[i]=t[-1] then
              newt:= g(t[2..-1] + [0$(i-2),1$(n+2-i)]);
            insert(newt,pq);
      fi od od;
    end proc:
    -1, seq(f(n),n=2..10); # Robert Israel, Jul 01 2024

Extensions

a(9)-a(10) from Robert Israel, Jul 01 2024

A232438 Squares or double-squares that are the sum of two distinct nonzero squares in exactly one way.

Original entry on oeis.org

25, 50, 100, 169, 200, 225, 289, 338, 400, 450, 578, 676, 800, 841, 900, 1156, 1225, 1352, 1369, 1521, 1600, 1681, 1682, 1800, 2025, 2312, 2450, 2601, 2704, 2738, 2809, 3025, 3042, 3200, 3362, 3364, 3600, 3721, 4050, 4624, 4900, 5202, 5329, 5408, 5476
Offset: 1

Views

Author

Jean-Christophe Hervé, Dec 01 2013

Keywords

Comments

Subsequence of A004431 and A001481.
Numbers with exactly one prime factor of form 4k+1 with multiplicity 2, and without prime factor of form 4k+3 to an odd multiplicity.

Examples

			25 = 5^2 = 16+9; 50 = 2*5^2 = 49+1.
		

Crossrefs

Analogs for square decompositions: A084645, A084646, A084647, A084648, A084649.

Programs

  • Mathematica
    Select[Range[10^4], (IntegerQ[Sqrt[#]] || IntegerQ[Sqrt[#/2]]) && Count[ PowersRepresentations[#, 2, 2], {x_, y_} /; Unequal[0, x, y]] == 1 &]
    (* or *) Select[Range[10^4], SquaresR[2, #] == 12 &] (* Jean-François Alcover, Dec 03 2013 *)

Formula

A004018(a(n)) = 12.
Terms are obtained by the products A125853(k)*A002144(p)^2 for k, p > 0, ordered by increasing values.

A350430 a(n) is the smallest n-th power which can be represented as the sum of n distinct positive n-th powers in exactly n ways, or -1 if none exists.

Original entry on oeis.org

1, 625, 157464
Offset: 1

Views

Author

Ilya Gutkovskiy, Dec 30 2021

Keywords

Comments

From Jon E. Schoenfield, Dec 30 2021: (Start)
222000^4 < a(4) < 4891341^4 = lcm(2829, 12259, 16359, 30381)^4 (see A039664, including the Wroblewski link).
10000^5 <= a(5) < 12528^5 = lcm(72, 1044, 1392, 2088, 3132)^5 (see A063923, including the Waldby link; note that, although the terms of A063923 include 72, 144, 1044, 1392, and 2088, whose LCM is only 4176, the primitive solution in which the sum of 5 distinct 5th powers is 144^5 is 0^5 + 27^5 + 84^5 + 110^5 + 133^5 = 144^5, which is not the sum of 5 positive n-th powers).
Conjecture: a(6) = -1. (End)

Examples

			For n = 2: 625 = 25^2 = 7^2 + 24^2 = 15^2 + 20^2.
For n = 3: 157464 = 54^3 = 6^3 + 36^3 + 48^3 = 12^3 + 19^3 + 53^3 = 27^3 + 36^3 + 45^3.
		

Crossrefs

Showing 1-6 of 6 results.