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.

Previous Showing 11-20 of 98 results. Next

A124966 Numbers which can be expressed as the ordered sum of 3 squares in 2 or more different ways.

Original entry on oeis.org

9, 17, 18, 25, 26, 27, 29, 33, 34, 36, 38, 41, 45, 49, 50, 51, 53, 54, 57, 59, 61, 62, 65, 66, 68, 69, 72, 73, 74, 75, 77, 81, 82, 83, 85, 86, 89, 90, 94, 97, 98, 99, 100, 101, 102, 104, 105, 106, 107, 108, 109, 110, 113, 114, 116, 117, 118, 121, 122, 123, 125, 126, 129
Offset: 1

Views

Author

Artur Jasinski, Nov 14 2006

Keywords

Examples

			a(1)=9 because 9 = 3^2 + 0^2 + 0^2 or 2^2 + 2^2 + 1^2.
		

Crossrefs

Programs

  • Mathematica
    Select[Range[129], Length@PowersRepresentations[#, 3, 2] >= 2 &] (* Ray Chandler, Oct 31 2019 *)

Formula

Equals = A000027 - A094942 - A004215.

Extensions

Corrected and extended by Ray Chandler, Nov 30 2006

A000419 Numbers that are the sum of 3 but no fewer nonzero squares.

Original entry on oeis.org

3, 6, 11, 12, 14, 19, 21, 22, 24, 27, 30, 33, 35, 38, 42, 43, 44, 46, 48, 51, 54, 56, 57, 59, 62, 66, 67, 69, 70, 75, 76, 77, 78, 83, 84, 86, 88, 91, 93, 94, 96, 99, 102, 105, 107, 108, 110, 114, 115, 118, 120, 123, 126, 129, 131, 132, 133, 134, 138, 139, 140, 141, 142
Offset: 1

Views

Author

Keywords

Comments

A002828(a(n)) = 3; A025427(a(n)) > 0. - Reinhard Zumkeller, Feb 26 2015

References

  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers. 3rd ed., Oxford Univ. Press, 1954, p. 311.

Crossrefs

Programs

  • Haskell
    a000419 n = a000419_list !! (n-1)
    a000419_list = filter ((== 3) . a002828) [1..]
    -- Reinhard Zumkeller, Feb 26 2015
    
  • Mathematica
    Select[Range[150],SquaresR[3,#]>0&&SquaresR[2,#]==0&] (* Harvey P. Dale, Nov 01 2011 *)
  • PARI
    is(n)=my(f=factor(n)); for(i=1, #f[, 1], if(f[i, 2]%2 && f[i, 1]%4==3, return( n/4^valuation(n,4)%8 !=7 ))); 0 \\ Charles R Greathouse IV, Feb 07 2017
    
  • Python
    def aupto(lim):
      squares = [k*k for k in range(1, int(lim**.5)+2) if k*k <= lim]
      sum2sqs = set(a+b for i, a in enumerate(squares) for b in squares[i:])
      sum3sqs = set(a+b for a in sum2sqs for b in squares)
      return sorted(set(range(lim+1)) & (sum3sqs - sum2sqs - set(squares)))
    print(aupto(142)) # Michael S. Branicky, Mar 06 2021

Formula

Legendre: a nonnegative integer is a sum of three (or fewer) squares iff it is not of the form 4^k m with m == 7 (mod 8).

Extensions

More terms from Arlin Anderson (starship1(AT)gmail.com)

A072401 1 iff n is of the form 4^m*(8k+7).

Original entry on oeis.org

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

Views

Author

Reinhard Zumkeller, Jun 16 2002

Keywords

Comments

Characteristic function of A004215, indicating numbers not the sum of 3 integer squares.
a(n) + 1 is the smallest positive number such that (a(n) + 1) * n is the sum of three squares. - Peter Schorn, Jul 18 2023

Crossrefs

Programs

  • Mathematica
    A072400[n_] := Mod[If[Mod[n, 4] == 0, n/4^IntegerExponent[n, 4], n], 8];
    a[n_] := 1 - Sign[7 - A072400[n]];
    Table[a[n], {n, 0, 96}] (* Jean-François Alcover, Dec 13 2021 *)
  • PARI
    a(n) = if(n, (n >> (2*valuation(n, 4))) % 8 == 7, 0); \\ Amiram Eldar, May 15 2025
  • Python
    def A072401(n): return ((m:=(~n&n-1).bit_length())&1^1)&int((n>>m)&7==7) # Chai Wah Wu, Aug 01 2023
    

Formula

a(n) = 1 - A057427(7 - A072400(n)).
a(A004215(k)) = 1 for k>0.
a(n) = A057427(A064873(n)).
For n<112: a(n) = A064873(n), but A064873(112) = 2, as also a(112 - 1) = 1.
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 1/6. - Amiram Eldar, May 15 2025

A055039 Numbers of the form 2^(2i+1)*(8j+7).

Original entry on oeis.org

14, 30, 46, 56, 62, 78, 94, 110, 120, 126, 142, 158, 174, 184, 190, 206, 222, 224, 238, 248, 254, 270, 286, 302, 312, 318, 334, 350, 366, 376, 382, 398, 414, 430, 440, 446, 462, 478, 480, 494, 504, 510, 526, 542, 558, 568, 574, 590, 606, 622
Offset: 1

Views

Author

N. J. A. Sloane, Jun 01 2000

Keywords

Comments

The numbers not of the form x^2+y^2+2z^2.
Numbers of the form 6*x^2 + 8*x^2*(2*y -1). (Steve Waterman).
These are the numbers not occurring as norms in the face-centered cubic lattice (cf. A004015).
Numbers whose base 4 representation ends in 3,2 followed by some number of zeros. - Franklin T. Adams-Watters, Dec 04 2006
Numbers k such that the k-th coefficient of eta(x)^4/eta(x^4) is 0 where eta is the Dedekind eta function. - Benoit Cloitre, Mar 15 2025
The asymptotic density of this sequence is 1/12. - Amiram Eldar, Mar 29 2025

Examples

			In base 4: 32, 132, 232, 320, 332, 1032, 1132, 1232, 1320, 1332, 2032, ...
		

Crossrefs

Equals twice A004215. Not the same as A044075 - see A124169.
Complement of A000401.
Cf. A004015.

Programs

  • Mathematica
    Select[Range[650], Mod[# / 4^IntegerExponent[#, 4], 16] == 14 &] (* Amiram Eldar, Mar 29 2025 *)
  • Python
    from itertools import count, islice
    def A055039_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:(m:=(~n&n-1).bit_length())&1 and (n>>m)&7==7,count(max(startvalue,1)))
    A055039_list = list(islice(A055039_gen(),30)) # Chai Wah Wu, Jul 09 2022
    
  • Python
    def A055039(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x>>i)-7>>3)+1 for i in range(1,x.bit_length(),2))
        return bisection(f,n,n) # Chai Wah Wu, Feb 24 2025

A047449 Numbers that are primitively represented by x^2 + y^2 + z^2.

Original entry on oeis.org

1, 2, 3, 5, 6, 9, 10, 11, 13, 14, 17, 18, 19, 21, 22, 25, 26, 27, 29, 30, 33, 34, 35, 37, 38, 41, 42, 43, 45, 46, 49, 50, 51, 53, 54, 57, 58, 59, 61, 62, 65, 66, 67, 69, 70, 73, 74, 75, 77, 78, 81, 82, 83, 85, 86, 89, 90, 91, 93, 94, 97, 98, 99, 101, 102, 105, 106
Offset: 1

Views

Author

Keywords

Crossrefs

Programs

Formula

Numbers that are congruent to {1, 2, 3, 5, 6} mod 8.
Union of A047449 and A034045 is A000378. Intersection of A047449 and A034043 is A034046. Numbers that are in A000378 and not congruent to 0 mod 4. - Ray Chandler, Sep 05 2004
G.f.: x*(1 + x + x^2 + 2*x^3 + x^4 + 2*x^5) / ( (x^4 + x^3 + x^2 + x + 1)*(x-1)^2 ). - R. J. Mathar, Dec 07 2011
a(n) = a(n-1) + a(n-5) - a(n-6); a(1)=1, a(2)=2, a(3)=3, a(4)=5, a(5)=6, a(6)=9. - Harvey P. Dale, Mar 05 2015

A055046 Numbers of the form 4^i*(8*j+3).

Original entry on oeis.org

3, 11, 12, 19, 27, 35, 43, 44, 48, 51, 59, 67, 75, 76, 83, 91, 99, 107, 108, 115, 123, 131, 139, 140, 147, 155, 163, 171, 172, 176, 179, 187, 192, 195, 203, 204, 211, 219, 227, 235, 236, 243, 251, 259, 267, 268, 275, 283, 291, 299, 300, 304, 307, 315, 323, 331, 332
Offset: 1

Views

Author

N. J. A. Sloane, Jun 01 2000

Keywords

Comments

Numbers not of the form x^2+y^2+5z^2.
Also values of n such that numbers of the form x^2+n*y^2 for some integers x, y cannot have prime factor of 2 raised to an odd power. - V. Raman, Dec 18 2013

Crossrefs

Programs

  • Mathematica
    A055046Q[k_] := Mod[k/4^IntegerExponent[k, 4], 8] == 3;
    Select[Range[500], A055046Q] (* Paolo Xausa, Mar 20 2025 *)
  • PARI
    is(n)=n/=4^valuation(n,4); n%8==3 \\ Charles R Greathouse IV and V. Raman, Dec 19 2013
    
  • Python
    from itertools import count, islice
    def A055046_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:not (m:=(~n&n-1).bit_length())&1 and (n>>m)&7==3,count(max(startvalue,1)))
    A055046_list = list(islice(A055046_gen(),30)) # Chai Wah Wu, Jul 09 2022
    
  • Python
    def A055046(n):
        def bisection(f,kmin=0,kmax=1):
            while f(kmax) > kmax: kmax <<= 1
            kmin = kmax >> 1
            while kmax-kmin > 1:
                kmid = kmax+kmin>>1
                if f(kmid) <= kmid:
                    kmax = kmid
                else:
                    kmin = kmid
            return kmax
        def f(x): return n+x-sum(((x>>(i<<1))-3>>3)+1 for i in range(x.bit_length()>>1))
        return bisection(f,n,n) # Chai Wah Wu, Feb 14 2025

Formula

a(n) = 6n + O(log n). - Charles R Greathouse IV, Dec 19 2013
a(n) = A055043(n)/2. - Chai Wah Wu, Mar 19 2025

A113505 Numbers not the sum of at most three perfect powers (A001597).

Original entry on oeis.org

7, 15, 23, 87, 111, 119, 167, 335, 1391, 1455, 1607, 1679, 1991, 25887, 26375
Offset: 1

Views

Author

R. P. van der Hilst (R.P.vanderHilst(AT)students.uu.nl), Jan 12 2006

Keywords

Comments

Cannot be written in the form a^x + b^y + c^z with a, b, c >= 0 and x, y, z > 1.
a(16), if it exists, is larger than 10^8. - Giovanni Resta, May 07 2017
From Brian Trial, Jun 07 2025: (Start)
Per Legendre's three-square theorem (A004215) only integers of the form 4^i(8j+7) are eligible.
Every integer > 5042631 (= 1424^2 + 734*2 + 19^5) and < 10^9 can be expressed as either a^2 + b^2 + c^2 or a^2 + b^2 + c^3, a,b,c >= 0 so a(16) >= 10^9. (End)

Crossrefs

A056828 is a subset, A001694, A274459.

Programs

  • Mathematica
    lmt = 40000; s = Union@ Join[{0, 1}, Flatten@ Table[n^i, {n, 2, Sqrt@ lmt}, {i, 2, Log[n, lmt]}]]; t = Select[ Union[Plus @@@ Tuples[s, 3]], # < lmt + 1 &]; Complement[Range@ lmt, t] (* Robert G. Wilson v *)

Extensions

Edited by Robert G. Wilson v, May 01 2006

A119869 Sizes of successive clusters in f.c.c. lattice centered at a lattice point.

Original entry on oeis.org

1, 13, 19, 43, 55, 79, 87, 135, 141, 177, 201, 225, 249, 321, 321, 369, 381, 429, 459, 531, 555, 603, 627, 675, 683, 767, 791, 887, 935, 959, 959, 1055, 1061, 1157, 1205, 1253, 1289, 1409, 1433, 1481, 1505, 1553, 1601, 1721, 1745, 1865, 1865, 1961, 1985, 2093, 2123
Offset: 0

Views

Author

Hugo Pfoertner, May 26 2006

Keywords

References

  • N. J. A. Sloane and B. K. Teo, Theta series and magic numbers for close-packed spherical clusters, J. Chem. Phys. 83 (1985) 6520-6534.

Crossrefs

Cf. A055039 [missing polyhedra]. Properties of Waterman polyhedra: A119870 [vertices], A119871 [faces], A119872 [edges], A119873 [volume]. Waterman polyhedra with different centers: A119874, A119875, A119876, A119877, A119878.

Programs

  • Maple
    maxd:=20001: read format: temp0:=trunc(evalf(sqrt(maxd)))+2: a:=0: for i from -temp0 to temp0 do a:=a+q^( (i+1/2)^2): od: th2:=series(a,q,maxd): a:=0: for i from -temp0 to temp0 do a:=a+q^(i^2): od: th3:=series(a,q,maxd): th4:=series(subs(q=-q,th3),q,maxd):
    t1:=series((th3^3+th4^3)/2,q,maxd): t1:=series(subs(q=sqrt(q),t1),q,floor(maxd/2)): t2:=seriestolist(t1): t4:=0; for n from 1 to nops(t2) do t4:=t4+t2[n]; lprint(n-1, t4); od: # N. J. A. Sloane, Aug 09 2006
  • Mathematica
    a[n_] := Sum[SquaresR[3, 2k], {k, 0, n}]; Table[a[n], {n, 0, 50}] (* Jean-François Alcover, Jul 12 2012, after formula *)
    Accumulate[SquaresR[3,2*Range[0,70]]] (* Harvey P. Dale, Jun 01 2015 *)

Formula

Partial sums of A004015, which has an explicit generating function.

Extensions

Edited by N. J. A. Sloane, Aug 09 2006
Additional links from Steve Waterman, Nov 26 2006

A006892 Representation as a sum of squares requires n squares with greedy algorithm.

Original entry on oeis.org

1, 2, 3, 7, 23, 167, 7223, 13053767, 42600227803223, 453694852221687377444001767, 51459754733114686962148583993443846186613037940783223
Offset: 1

Views

Author

Keywords

Comments

Of course Lagrange's theorem tells us that any positive integer can be written as a sum of at most four squares (cf. A004215).
Records in A053610. - Hugo van der Sanden, Jun 24 2015

Examples

			Here is why a(5) = 23: start with 23, subtract largest square <= 23, which is 16, getting 7.
Now subtract largest square <= 7, which is 4, getting 3.
Now subtract largest square <= 3, which is 1, getting 2.
Now subtract largest square <= 2, which is 1, getting 1.
Now subtract largest square <= 1, which is 1, getting 0.
Thus 23 = 16+4+1+1+1.
It took 5 steps to get to 0, and 23 is the smallest number which takes 5 steps. - _N. J. A. Sloane_, Jan 29 2014
		

References

  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • PARI
    a(n) = if (n <= 3, n , ((a(n-1)+3)/2)^2 - 2) \\ Michel Marcus, May 25 2013

Formula

For n >= 4, a(n) = a(n-1) + ((a(n-1)+1)/2)^2. - Joe K. Crump (joecr(AT)carolina.rr.com), Apr 16 2000
a(n) = n for n <= 3; for n > 3, a(n) = ((a(n-1)+3)/2)^2 - 2. - Arkadiusz Wesolowski, Mar 30 2013
a(n+2) = 2 * A053630(n) - 3. - Thomas Ordowski, Jul 14 2014
a(n+3) = A053630(n)^2 - 2. - Thomas Ordowski, Jul 19 2014

Extensions

Four more terms from Rick L. Shepherd, Jan 27 2014

A034043 Numbers that are imprimitively represented by x^2+y^2+z^2.

Original entry on oeis.org

0, 4, 8, 9, 12, 16, 18, 20, 24, 25, 27, 32, 36, 40, 44, 45, 48, 49, 50, 52, 54, 56, 64, 68, 72, 75, 76, 80, 81, 84, 88, 90, 96, 98, 99, 100, 104, 108, 116, 117, 120, 121, 125, 126, 128, 132, 136, 140, 144, 147, 148, 150, 152, 153, 160, 162, 164, 168, 169
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

Union of A034043 and A034044 is A000378. Intersection of A047449 and A034043 is A034046. Numbers that are in A000378 and not squarefree. - Ray Chandler, Sep 05 2004
Previous Showing 11-20 of 98 results. Next