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 11 results. Next

A001481 Numbers that are the sum of 2 squares.

Original entry on oeis.org

0, 1, 2, 4, 5, 8, 9, 10, 13, 16, 17, 18, 20, 25, 26, 29, 32, 34, 36, 37, 40, 41, 45, 49, 50, 52, 53, 58, 61, 64, 65, 68, 72, 73, 74, 80, 81, 82, 85, 89, 90, 97, 98, 100, 101, 104, 106, 109, 113, 116, 117, 121, 122, 125, 128, 130, 136, 137, 144, 145, 146, 148, 149, 153, 157, 160
Offset: 1

Views

Author

Keywords

Comments

Numbers n such that n = x^2 + y^2 has a solution in nonnegative integers x, y.
Closed under multiplication. - David W. Wilson, Dec 20 2004
Also, numbers whose cubes are the sum of 2 squares. - Artur Jasinski, Nov 21 2006 (Cf. A125110.)
Terms are the squares of smallest radii of circles covering (on a square grid) a number of points equal to the terms of A057961. - Philippe Lallouet (philip.lallouet(AT)wanadoo.fr), Apr 16 2007. [Comment corrected by T. D. Noe, Mar 28 2008]
Numbers with more 4k+1 divisors than 4k+3 divisors. If a(n) is a member of this sequence, then so too is any power of a(n). - Ant King, Oct 05 2010
A000161(a(n)) > 0; A070176(a(n)) = 0. - Reinhard Zumkeller, Feb 04 2012, Aug 16 2011
Numbers that are the norms of Gaussian integers. This sequence has unique factorization; the primitive elements are A055025. - Franklin T. Adams-Watters, Nov 25 2011
These are numbers n such that all of n's odd prime factors congruent to 3 modulo 4 occur to an even exponent (Fermat's two-squares theorem). - Jean-Christophe Hervé, May 01 2013
Let's say that an integer n divides a lattice if there exists a sublattice of index n. Example: 2, 4, 5 divide the square lattice. The present sequence without 0 is the sequence of divisors of the square lattice. Say that n is a "prime divisor" if the index-n sublattice is not contained in any other sublattice except the original lattice itself. Then A055025 (norms of Gaussian primes) gives the "prime divisors" of the square lattice. - Jean-Christophe Hervé, May 01 2013
For any i,j > 0 a(i)*a(j) is a member of this sequence, since (a^2 + b^2)*(c^2 + d^2) = (a*c + b*d)^2 + (a*d - b*c)^2. - Boris Putievskiy, May 05 2013
The sequence is closed under multiplication. Primitive elements are in A055025. The sequence can be split into 3 multiplicatively closed subsequences: {0}, A004431 and A125853. - Jean-Christophe Hervé, Nov 17 2013
Generalizing Jasinski's comment, same as numbers whose odd powers are the sum of 2 squares, by Fermat's two-squares theorem. - Jonathan Sondow, Jan 24 2014
By the 4 squares theorem, every nonnegative integer can be expressed as the sum of two elements of this sequence. - Franklin T. Adams-Watters, Mar 28 2015
There are never more than 3 consecutive terms. Runs of 3 terms start at 0, 8, 16, 72, ... (A082982). - Ivan Neretin, Nov 09 2015
Conjecture: barring the 0+2, 0+4, 0+8, 0+16, ... sequence, the sum of 2 distinct terms in this sequence is never a power of 2. - J. Lowell, Jan 14 2022
All the areas of squares whose vertices have integer coordinates. - Neeme Vaino, Jun 14 2023
Numbers represented by the definite binary quadratic forms x^2 + 2nxy + (n^2+1)y^2 for any integer n. This sequence contains the even powers of any integer. An odd power of a number appears only if the number itself belongs to the sequence. The equation given in the comment by Boris Putievskiy 2013 is Brahmagupta's identity with n = 1. It proves that any set of numbers of the form a^2 + nb^2 is closed under multiplication. - Klaus Purath, Sep 06 2023

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.
  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.
  • L. Euler, (E388) Vollständige Anleitung zur Algebra, Zweiter Theil, reprinted in: Opera Omnia. Teubner, Leipzig, 1911, Series (1), Vol. 1, p. 417.
  • S. R. Finch, Mathematical Constants, Cambridge, 2003, pp. 98-104.
  • G. H. Hardy, Ramanujan, pp. 60-63.
  • P. Moree and J. Cazaran, On a claim of Ramanujan in his first letter to Hardy, Expos. Math. 17 (1999), pp. 289-312.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Disjoint union of A000290 and A000415.
Complement of A022544.
A000404 gives another version. Subsequence of A091072, supersequence of A046711.
Column k=2 of A336820.

Programs

  • Haskell
    a001481 n = a001481_list !! (n-1)
    a001481_list = [x | x <- [0..], a000161 x > 0]
    -- Reinhard Zumkeller, Feb 14 2012, Aug 16 2011
    
  • Magma
    [n: n in [0..160] | NormEquation(1, n) eq true]; // Arkadiusz Wesolowski, May 11 2016
    
  • Maple
    readlib(issqr): for n from 0 to 160 do for k from 0 to floor(sqrt(n)) do if issqr(n-k^2) then printf(`%d,`,n); break fi: od: od:
  • Mathematica
    upTo = 160; With[{max = Ceiling[Sqrt[upTo]]}, Select[Union[Total /@ (Tuples[Range[0, max], {2}]^2)], # <= upTo &]]  (* Harvey P. Dale, Apr 22 2011 *)
    Select[Range[0, 160], SquaresR[2, #] != 0 &] (* Jean-François Alcover, Jan 04 2013 *)
  • PARI
    isA001481(n)=local(x,r);x=0;r=0;while(x<=sqrt(n) && r==0,if(issquare(n-x^2),r=1);x++);r \\ Michael B. Porter, Oct 31 2009
    
  • PARI
    is(n)=my(f=factor(n));for(i=1,#f[,1],if(f[i,2]%2 && f[i,1]%4==3, return(0))); 1 \\ Charles R Greathouse IV, Aug 24 2012
    
  • PARI
    B=bnfinit('z^2+1,1);
    is(n)=#bnfisintnorm(B,n) \\ Ralf Stephan, Oct 18 2013, edited by M. F. Hasler, Nov 21 2017
    
  • PARI
    list(lim)=my(v=List(),t); for(m=0,sqrtint(lim\=1), t=m^2; for(n=0, min(sqrtint(lim-t),m), listput(v,t+n^2))); Set(v) \\ Charles R Greathouse IV, Jan 05 2016
    
  • PARI
    is_A001481(n)=!for(i=2-bittest(n,0),#n=factor(n)~, bittest(n[1,i],1)&&bittest(n[2,i],0)&&return) \\ M. F. Hasler, Nov 20 2017
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A001481_gen(): # generator of terms
        return filter(lambda n:(lambda m:all(d & 3 != 3 or m[d] & 1 == 0 for d in m))(factorint(n)),count(0))
    A001481_list = list(islice(A001481_gen(),30)) # Chai Wah Wu, Jun 27 2022

Formula

n = square * 2^{0 or 1} * {product of distinct primes == 1 (mod 4)}.
The number of integers less than N that are sums of two squares is asymptotic to constant*N/sqrt(log(N)), hence lim_{n->infinity} a(n)/n = infinity.
Nonzero terms in expansion of Dirichlet series Product_p (1 - (Kronecker(m, p) + 1)*p^(-s) + Kronecker(m, p)*p^(-2s))^(-1) for m = -1.
a(n) ~ k*n*sqrt(log n), where k = 1.3085... = 1/A064533. - Charles R Greathouse IV, Apr 16 2012
There are B(x) = x/sqrt(log x) * (K + B2/log x + O(1/log^2 x)) terms of this sequence up to x, where K = A064533 and B2 = A227158. - Charles R Greathouse IV, Nov 18 2022

Extensions

Deleted an incorrect comment. - N. J. A. Sloane, Oct 03 2023

A004825 Numbers that are the sum of at most 3 positive cubes.

Original entry on oeis.org

0, 1, 2, 3, 8, 9, 10, 16, 17, 24, 27, 28, 29, 35, 36, 43, 54, 55, 62, 64, 65, 66, 72, 73, 80, 81, 91, 92, 99, 118, 125, 126, 127, 128, 129, 133, 134, 136, 141, 152, 153, 155, 160, 179, 189, 190, 192, 197, 216, 217, 218, 224, 225, 232, 243, 244, 250, 251, 253
Offset: 1

Views

Author

Keywords

Comments

Or: numbers which are the sum of 3 (not necessarily distinct) nonnegative cubes. - R. J. Mathar, Sep 09 2015
Deshouillers, Hennecart, & Landreau conjecture that this sequence has density 0.0999425... = lim_K Sum_{k=1..K} exp(c*rho(k,K)/K^2)/K where c = -gamma(4/3)^3/6 = -0.1186788..., K takes increasing values in A003418 (or, equivalently, A051451), and rho(k0,K) is the number of triples 1 <= k1,k2,k3 <= K such that k0 = k1^3 + k2^3 + k3^3 mod K. - Charles R Greathouse IV, Sep 16 2016

Crossrefs

A003072 is a subsequence.
Cf. A004999.
Column k=3 of A336820.

Programs

  • Maple
    isA004825 := proc(n)
        local x,y,zc ;
        for x from 0 do
            if 3*x^3 > n then
                return false;
            end if;
            for y from x do
                if x^3+2*y^3 > n then
                    break;
                else
                    zc := n-x^3-y^3 ;
                    if zc >= y^3 and isA000578(zc) then
                        return true;
                    end if;
                end if;
            end do:
        end do:
    end proc:
    A004825 := proc(n)
        option remember;
        local a;
        if n = 1 then
            0;
        else
            for a from procname(n-1)+1 do
                if isA004825(a) then
                    return a;
                end if;
            end do:
        end if;
    end proc:
    seq(A004825(n),n=1..100) ; # R. J. Mathar, Sep 09 2015
    # second Maple program:
    b:= proc(n, i, t) option remember; n=0 or i>0 and t>0
          and (b(n, i-1, t) or i^3<=n and b(n-i^3, i, t-1))
        end:
    a:= proc(n) option remember; local k;
          for k from 1+ `if`(n=1, -1, a(n-1))
          while not b(k, iroot(k, 3), 3) do od; k
        end:
    seq(a(n), n=1..100);  # Alois P. Heinz, Sep 16 2016
  • Mathematica
    q=7; imax=q^3; Select[Union[Flatten[Table[x^3+y^3+z^3, {x,0,q}, {y,x,q}, {z,y,q}]]], #<=imax&] (* Vladimir Joseph Stephan Orlovsky, Apr 20 2011 *)
  • PARI
    list(lim)=my(v=List(),k,t); for(x=0,sqrtnint(lim\=1,3), for(y=0, min(sqrtnint(lim-x^3,3),x), k=x^3+y^3; for(z=0,min(sqrtnint(lim-k,3), y), listput(v, k+z^3)))); Set(v) \\ Charles R Greathouse IV, Sep 14 2015

A336725 A(n,k) is the n-th number that is a sum of k positive k-th powers; square array A(n,k), n>=1, k>=1, read by antidiagonals.

Original entry on oeis.org

1, 2, 2, 3, 5, 3, 4, 10, 8, 4, 5, 19, 17, 10, 5, 6, 36, 34, 24, 13, 6, 7, 69, 67, 49, 29, 17, 7, 8, 134, 132, 98, 64, 36, 18, 8, 9, 263, 261, 195, 129, 84, 43, 20, 9, 10, 520, 518, 388, 258, 160, 99, 55, 25, 10, 11, 1033, 1031, 773, 515, 321, 247, 114, 62, 26, 11, 12, 2058, 2056, 1542, 1028, 642, 384, 278, 129, 66, 29, 12
Offset: 1

Views

Author

Alois P. Heinz, Aug 01 2020

Keywords

Examples

			Square array A(n,k) begins:
   1,  2,  3,   4,   5,   6,    7,    8,    9,   10, ...
   2,  5, 10,  19,  36,  69,  134,  263,  520, 1033, ...
   3,  8, 17,  34,  67, 132,  261,  518, 1031, 2056, ...
   4, 10, 24,  49,  98, 195,  388,  773, 1542, 3079, ...
   5, 13, 29,  64, 129, 258,  515, 1028, 2053, 4102, ...
   6, 17, 36,  84, 160, 321,  642, 1283, 2564, 5125, ...
   7, 18, 43,  99, 247, 384,  769, 1538, 3075, 6148, ...
   8, 20, 55, 114, 278, 734,  896, 1793, 3586, 7171, ...
   9, 25, 62, 129, 309, 797, 2193, 2048, 4097, 8194, ...
  10, 26, 66, 164, 340, 860, 2320, 6568, 4608, 9217, ...
		

Crossrefs

Rows n=1-3 give: A000027, A052944, A145071.
Main diagonal gives A000337.
Cf. A336820.

Programs

  • Maple
    A:= proc() local l, w, A; l, w, A:= proc() [] end, proc() [] end,
          proc(n, k) option remember; local b; b:=
            proc(x, y) option remember; `if`(x=0, {0}, `if`(y<1, {},
              {b(x, y-1)[], map(t-> t+l(k)[y], b(x-1, y))[]}))
            end;
            while nops(w(k)) < n do forget(b);
              l(k):= [l(k)[], (nops(l(k))+1)^k];
              w(k):= sort([select(h-> h
    				
  • Mathematica
    nmax = 12;
    pow[n_, k_] := IntegerPartitions[n, {k}, Range[n^(1/k) // Ceiling]^k];
    col[k_] := col[k] = Reap[Module[{j = k, n = 1, p}, While[n <= nmax, p = pow[j, k]; If[p =!= {}, Sow[j]; n++]; j++]]][[2, 1]];
    A[n_, k_] := col[k][[n]];
    Table[A[n-k+1, k], {n, 1, nmax}, {k, n, 1, -1}] // Flatten (* Jean-François Alcover, Dec 03 2020 *)

A004845 Numbers that are the sum of at most 5 positive 5th powers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 32, 33, 34, 35, 36, 64, 65, 66, 67, 96, 97, 98, 128, 129, 160, 243, 244, 245, 246, 247, 275, 276, 277, 278, 307, 308, 309, 339, 340, 371, 486, 487, 488, 489, 518, 519, 520, 550, 551, 582, 729, 730, 731, 761, 762, 793, 972, 973, 1004, 1024
Offset: 1

Views

Author

Keywords

Crossrefs

Column k=5 of A336820.

Programs

  • Maple
    b:= proc(n, i, t) option remember; n=0 or i>0 and t>0
          and (b(n, i-1, t) or i^5<=n and b(n-i^5, i, t-1))
        end:
    a:= proc(n) option remember; local k;
          for k from 1+ `if`(n=1, -1, a(n-1))
          while not b(k, iroot(k, 5), 5) do od; k
        end:
    seq(a(n), n=1..50);  # Alois P. Heinz, Sep 16 2016
  • Mathematica
    Select[Table[n, {n, 0, 1200}], Length[PowersRepresentations[#, 5, 5]] > 0 &] (* Vladimir Joseph Stephan Orlovsky, Jul 19 2011 *)

A004833 Numbers that are the sum of at most 4 nonzero 4th powers.

Original entry on oeis.org

0, 1, 2, 3, 4, 16, 17, 18, 19, 32, 33, 34, 48, 49, 64, 81, 82, 83, 84, 97, 98, 99, 113, 114, 129, 162, 163, 164, 178, 179, 194, 243, 244, 256, 257, 258, 259, 272, 273, 274, 288, 289, 304, 324, 337, 338, 339, 353, 354, 369, 418, 419, 434, 499, 512, 513, 514, 528, 529, 544, 593, 594, 609, 625, 626, 627, 628, 641, 642, 643
Offset: 1

Views

Author

Keywords

Crossrefs

Column k=4 of A336820.

Programs

  • Mathematica
    Reap[For[n = 0, n < 1000, n++, If[MatchQ[ PowersRepresentations[n, 4, 4], {{, , , }, _}], Print[n]; Sow[n]]]][[2, 1]] (* Jean-François Alcover, Oct 30 2017 *)
  • PARI
    N=1000; x='x+O('x^N); /* terms up to N-1 */
    S=ceil(N^(1/4));
    v=Vec(sum(k=-S,S,x^(k^4))^4);
    for(n=1,#v,if(v[n]!=0,print1(n-1,", "))); /* Joerg Arndt, Jun 25 2011 */

A004857 Numbers that are the sum of at most 6 nonzero 6th powers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 64, 65, 66, 67, 68, 69, 128, 129, 130, 131, 132, 192, 193, 194, 195, 256, 257, 258, 320, 321, 384, 729, 730, 731, 732, 733, 734, 793, 794, 795, 796, 797, 857, 858, 859, 860, 921, 922, 923, 985
Offset: 1

Views

Author

Keywords

Crossrefs

Column k=6 of A336820.

A004869 Numbers that are the sum of at most 7 positive 7th powers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 128, 129, 130, 131, 132, 133, 134, 256, 257, 258, 259, 260, 261, 384, 385, 386, 387, 388, 512, 513, 514, 515, 640, 641, 642, 768, 769, 896, 2187, 2188, 2189, 2190, 2191, 2192, 2193, 2315, 2316, 2317, 2318, 2319, 2320, 2443, 2444, 2445
Offset: 1

Views

Author

Keywords

Crossrefs

Column k=7 of A336820.

Programs

  • Maple
    b:= proc(n, i, t) option remember; n=0 or i>0 and t>0
          and (b(n, i-1, t) or i^7<=n and b(n-i^7, i, t-1))
        end:
    a:= proc(n) option remember; local k;
          for k from 1+ `if`(n=1, -1, a(n-1))
          while not b(k, iroot(k, 7), 7) do od; k
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Sep 16 2016
  • Mathematica
    b[n_, k_, i_, t_] := b[n, k, i, t] = n == 0 || i > 0 && t > 0 && (b[n, k, i - 1, t] || i^k <= n && b[n - i^k, k, i, t - 1]);
    A[n_, k_] := A[n, k] = Module[{m}, For[m = 1 + If[n == 1, -1, A[n - 1, k]], !b[m, k, m^(1/k) // Floor, k], m++]; m];
    a[n_] := A[n, 7];
    Table[a[n], {n, 1, 60}] (* Jean-François Alcover, May 20 2022, after Alois P. Heinz in A336820 *)

Extensions

More terms from Alois P. Heinz, Sep 16 2016

A004881 Numbers that are the sum of at most 8 nonzero 8th powers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 256, 257, 258, 259, 260, 261, 262, 263, 512, 513, 514, 515, 516, 517, 518, 768, 769, 770, 771, 772, 773, 1024, 1025, 1026, 1027, 1028, 1280, 1281, 1282, 1283, 1536, 1537, 1538, 1792, 1793, 2048, 6561, 6562, 6563, 6564, 6565, 6566
Offset: 1

Views

Author

Keywords

Crossrefs

Column k=8 of A336820.

Programs

  • Maple
    b:= proc(n, i, t) option remember; n=0 or i>0 and t>0
          and (b(n, i-1, t) or i^8<=n and b(n-i^8, i, t-1))
        end:
    a:= proc(n) option remember; local k;
          for k from 1+ `if`(n=1, -1, a(n-1))
          while not b(k, iroot(k, 8), 8) do od; k
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Sep 16 2016
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = n == 0 || i > 0 && t > 0 && (b[n, i - 1, t] || i^8 <= n && b[n - i^8, i, t - 1]);
    a[n_] := a[n] = (For[k = 1 + If[n == 1, -1, a[n - 1]], !b[k, k^(1/8) // Floor, 8], k++]; k);
    Array[a, 60] (* Jean-François Alcover, Apr 06 2017, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, Sep 16 2016

A004893 Numbers that are the sum of at most 9 positive 9th powers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 512, 513, 514, 515, 516, 517, 518, 519, 520, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1536, 1537, 1538, 1539, 1540, 1541, 1542, 2048, 2049, 2050, 2051, 2052, 2053, 2560, 2561, 2562, 2563, 2564, 3072, 3073, 3074, 3075, 3584
Offset: 1

Views

Author

Keywords

Crossrefs

Column k=9 of A336820.

Programs

  • Maple
    b:= proc(n, i, t) option remember; n=0 or i>0 and t>0
          and (b(n, i-1, t) or i^9<=n and b(n-i^9, i, t-1))
        end:
    a:= proc(n) option remember; local k;
          for k from 1+ `if`(n=1, -1, a(n-1))
          while not b(k, iroot(k, 9), 9) do od; k
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Sep 16 2016
  • Mathematica
    b[n_, k_, i_, t_] := b[n, k, i, t] = n == 0 || i > 0 && t > 0 && (b[n, k, i - 1, t] || i^k <= n && b[n - i^k, k, i, t - 1]);
    A[n_, k_] := A[n, k] = Module[{m}, For[m = 1 + If[n == 1, -1, A[n - 1, k]], !b[m, k, m^(1/k) // Floor, k], m++]; m];
    a[n_] := A[n, 9];
    Table[a[n], {n, 1, 60}] (* Jean-François Alcover, May 20 2022, after Alois P. Heinz in A336820 *)

Extensions

More terms from Alois P. Heinz, Sep 16 2016

A004905 Numbers that are the sum of at most 10 nonzero 10th powers.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 2048, 2049, 2050, 2051, 2052, 2053, 2054, 2055, 2056, 3072, 3073, 3074, 3075, 3076, 3077, 3078, 3079, 4096, 4097, 4098, 4099, 4100, 4101, 4102, 5120, 5121, 5122, 5123
Offset: 1

Views

Author

Keywords

Crossrefs

Column k=10 of A336820.

Programs

  • Maple
    b:= proc(n, i, t) option remember; n=0 or i>0 and t>0
          and (b(n, i-1, t) or i^10<=n and b(n-i^10, i, t-1))
        end:
    a:= proc(n) option remember; local k;
          for k from 1+ `if`(n=1, -1, a(n-1))
          while not b(k, iroot(k, 10), 10) do od; k
        end:
    seq(a(n), n=1..60);  # Alois P. Heinz, Sep 16 2016
  • Mathematica
    b[n_, i_, t_] := b[n, i, t] = n == 0 || i > 0 && t > 0 && (b[n, i - 1, t] || i^10 <= n && b[n - i^10, i, t - 1]);
    a[n_] := a[n] = (For[k = 1 + If[n == 1, -1, a[n - 1]], !b[k, k^(1/10) // Floor, 10], k++]; k);
    Array[a, 60] (* Jean-François Alcover, Apr 06 2017, after Alois P. Heinz *)

Extensions

More terms from Alois P. Heinz, Sep 16 2016
Showing 1-10 of 11 results. Next