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 41-50 of 98 results. Next

A167615 Total number of positive integers below 10^n with 4 positive squares in their representation as sum of squares.

Original entry on oeis.org

1, 15, 165, 1665, 16664, 166664, 1666663, 16666663, 166666661, 1666666662, 16666666661, 166666666660, 1666666666661, 16666666666660, 166666666666659, 1666666666666660, 16666666666666658, 166666666666666657, 1666666666666666660, 16666666666666666656
Offset: 1

Views

Author

Martin Renner, Jan 18 2011

Keywords

Comments

A049416(n) + A180416(n) + A180425(n) + a(n) = A002283(n).

Examples

			a(1) = 1 since 7 is the only natural number below 10 which is the sum of 4 but no fewer nonzero squares.
		

Crossrefs

Cf. A004215.

Programs

  • Maple
    a:=proc(n)
      local f,s,k;
      f:=(x,y)->ceil(10^y/2^(2*x+3)-7/8):
      s:=0:
      for k from 0 by 1 while not f(k,n)=0 do
        s:=s+f(k,n);
      od:
      return(s);
    end;
  • Mathematica
    a[n_] := Module[{f, s = 0, k}, f[x_, y_] := Ceiling[10^y/2^(2x+3) - 7/8]; For[k = 0, f[k, n] != 0, k++, s += f[k, n]]; Return[s]];
    Array[a, 20] (* Jean-François Alcover, Oct 31 2020, after Maple *)

Formula

a(n) = Sum_{i=0..k} ceiling(10^n/2^(2*i+3) - 7/8) with minimal k for which ceiling(10^n/2^(2*k+3) - 7/8) = 0.

A261904 Largest x such that n can be written as n = x^2 + y^2 + z^2 with x >= y >= z >= 0, or -1 if no such x exists.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, -1, 2, 3, 3, 3, 2, 3, 3, -1, 4, 4, 4, 3, 4, 4, 3, -1, 4, 5, 5, 5, -1, 5, 5, -1, 4, 5, 5, 5, 6, 6, 6, -1, 6, 6, 5, 5, 6, 6, 6, -1, 4, 7, 7, 7, 6, 7, 7, -1, 6, 7, 7, 7, -1, 6, 7, -1, 8, 8, 8, 7, 8, 8, 6, -1, 8, 8, 8, 7, 6, 8, 7, -1, 8, 9, 9
Offset: 0

Views

Author

N. J. A. Sloane, Sep 08 2015

Keywords

Comments

a(n) = -1 iff n is in A004215, a(n) >= 0 iff n is in A000378.
Somehow maximizing x seems like the right thing to do (since it is natural to try a greedy algorithm first). If we minimize x we get A261915.

Examples

			Tabls showing initial values of n,x,y,z:
0 0 0 0
1 1 0 0
2 1 1 0
3 1 1 1
4 2 0 0
5 2 1 0
6 2 1 1
7 -1 -1 -1
8 2 2 0
9 3 0 0
10 3 1 0
11 3 1 1
12 2 2 2
13 3 2 0
14 3 2 1
15 -1 -1 -1
16 4 0 0
17 4 1 0
18 4 1 1
19 3 3 1
20 4 2 0
...
		

Crossrefs

Analogs for 4 squares: A178786 and A122921.

Extensions

More terms from David Consiglio, Jr., Sep 08 2015

A261915 Smallest x such that n can be written as n = x^2 + y^2 + z^2 with x >= y >= z >= 0, or -1 if no such x exists.

Original entry on oeis.org

0, 1, 1, 1, 2, 2, 2, -1, 2, 2, 3, 3, 2, 3, 3, -1, 4, 3, 3, 3, 4, 4, 3, -1, 4, 4, 4, 3, -1, 4, 5, -1, 4, 4, 4, 5, 4, 6, 5, -1, 6, 4, 5, 5, 6, 5, 6, -1, 4, 6, 5, 5, 6, 6, 5, -1, 6, 5, 7, 5, -1, 6, 6, -1, 8, 6, 5, 7, 6, 7, 6, -1, 6, 6, 7, 5, 6, 6, 7, -1, 8, 6, 8
Offset: 0

Views

Author

N. J. A. Sloane, Sep 11 2015

Keywords

Comments

a(n) = -1 iff n is in A004215, a(n) >= 0 iff n is in A000378.
If we maximize x we get A261904.

Examples

			Table showing initial values of n,x,y,z:
   0  0  0  0
   1  1  0  0
   2  1  1  0
   3  1  1  1
   4  2  0  0
   5  2  1  0
   6  2  1  1
   7 -1 -1 -1
   8  2  2  0
   9  2  2  1
  10  3  1  0
  11  3  1  1
  12  2  2  2
  13  3  2  0
  14  3  2  1
  15 -1 -1 -1
  16  4  0  0
  17  3  2  2
  18  3  3  0
  19  3  3  1
  20  4  2  0
  ...
		

Crossrefs

Analogs for 4 squares: A178786 and A122921.

Extensions

a(17) corrected, more terms from David Consiglio, Jr., Sep 11 2015

A272405 Numbers n such that sum of the divisors of n is not of the form x^2 + y^2 + z^2 where x, y, z are integers.

Original entry on oeis.org

4, 8, 12, 16, 18, 24, 25, 32, 38, 48, 59, 64, 75, 91, 96, 99, 114, 125, 128, 130, 135, 158, 166, 169, 177, 192, 196, 203, 205, 209, 221, 239, 242, 251, 256, 268, 273, 283, 290, 315, 324, 347, 358, 365, 367, 375, 378, 379, 384, 387, 390, 392, 403, 422, 423, 427, 443, 445, 460, 474, 476, 493
Offset: 1

Views

Author

Altug Alkan, Apr 29 2016

Keywords

Comments

Numbers n such that sum of the positive divisors of n is the sum of 4 but no fewer nonzero squares.
Prime terms of this sequence are 59, 239, 251, 283, 347, 367, 379, 443, 571, ...
A006532 is a subsequence of complement of this sequence.
Pollack (2011) proved that the complementary sequence has asymptotic density 7/8. Therefore the asymptotic density of this sequence is 1/8. - Amiram Eldar, Apr 09 2020

Examples

			1 is not a term since sigma(1) = 1 = 0^2 + 0^2 + 1^2 is the sum of 3 squares.
4 is a term since sigma(4) = 7 is not the sum of 3 squares.
		

Crossrefs

Programs

  • Mathematica
    Select[Range@ 500, ! SquaresR[3, DivisorSigma[1, #]] > 0 &] (* Michael De Vlieger, Apr 29 2016 *)
  • PARI
    isA004215(n) = {n\4^valuation(n, 4)%8==7}
    lista(nn) = for(n=1, nn, if(isA004215(sigma(n)), print1(n, ", ")));
    
  • Python
    from itertools import count, islice
    from sympy import divisor_sigma
    def A272405_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:not (m:=(~(s:=int(divisor_sigma(n)))&s-1).bit_length())&1 and (s>>m)&7==7,count(max(startvalue,1)))
    A272405_list = list(islice(A272405_gen(),30)) # Chai Wah Wu, Jul 09 2022

Formula

{n: A000203(n) in A004215}. - R. J. Mathar, May 02 2016

A297970 Numbers that are not the sum of 3 squares and a nonnegative 7th power.

Original entry on oeis.org

112, 240, 368, 496, 624, 752, 880, 1008, 1136, 1264, 1392, 1520, 1648, 1776, 1904, 2032, 2160
Offset: 1

Views

Author

XU Pingya, Jan 10 2018

Keywords

Comments

The last term in this sequence is 2160. The reasons are as follows (let b, c, d, i, j, k, m, r, s, t, w, x, y and z be nonnegative integers).
For the Diophantine equation x^2 + y^2 + z^2 + w^7 = m:
(1) If m is not of the form 4^c * (8b + 7), then it follows from Legendre's three-square theorem that the equation has a solution with w = 0.
(2) 8b + 7 - 1^7 = 8b + 6. Then m = 8b + 7, the equation has a solution with w = 1.
(3) 4 * (8b + 7) - 1^7 = (8 * (4b + 3) + 3) = 8d + 3. Then m = 4 * (8b + 7), the equation has a solution with w = 1.
(4) For b >= 17, 16 * (8b + 7) - 3^7 = 8 * (16 * (b - 17) + 12) + 5 = 8i + 5. Then m = 16 * (8b + 7) and b >= 17, the equation has a solution with w = 3.
(5) 4^3 * (8b + 7) - 2^7 = 4^3 * (8b + 5). Then m = 4^3 * (8b + 7), the equation has a solution with w = 2. And 4^3 * (8b + 7) - 3^7 = 8 * (4^3 * (b - 4) + 38) + 5 = 8j + 5. Then m = 4^3 * (8b + 7) and b >= 4, the equation has a solution with w = 3.
(6) 4^4 * (8b + 7) - 2^7 = 4^3 * (8 * (4b + 3) + 3) = 4^3 * (8k + 3). 4^4 * (8b + 7) - 3^7 = 8 * (256b - 217) + 3 = 8r + 3. Then m = 4^4 * (8b + 7), the equation has a solution with w = 2 and when b > 0, the equation has a solution with w = 3.
(7) When c >= 5, 4^c * (8b + 7) - 2^7 = 4^3 * (8 * (b * 4^(c - 3) + 14 * 4^(c - 5) + 5) = 4^3 * (8s + 5). 4^c * (8b + 7) - 3^7 = 8 * (b * 4^(c - 3) + 14 * 4^(c - 3) - 273) + 3 = 8t + 3. Then n = 4^c * (8b + 7), the equation has solutions with w = 2 and 3.
In short, except for the 17 numbers in the sequence, every nonnegative integer can be represented as the sum of 3 squares and a nonnegative 7th power.

Crossrefs

Finite subsequence of A004215 and A296185.

Programs

  • Mathematica
    t1={};
    Do[Do[If[x^2+y^2+z^2+w^7==n, AppendTo[t1,n]&&Break[]], {x,0,n^(1/2)}, {y,x,(n-x^2)^(1/2)}, {z,y,(n-x^2-y^2)^(1/2)}, {w,0,(n-x^2-y^2-z^2)^(1/7)}], {n,0,3000}];
    t2={};
    Do[If[FreeQ[t1,k]==True, AppendTo[t2,k]], {k,0,3000}];
    t2

Formula

a(n) = 128n - 16 = 16 * A004771(n - 1), 1 <= n <= 17.

A063951 Every number is the sum of 4 squares; these are the odd numbers n such that the first square can be taken to be any positive square < n.

Original entry on oeis.org

1, 3, 5, 7, 9, 13, 15, 17, 21, 25, 33, 41, 45, 49, 57, 65, 73, 81, 89, 97, 105, 129, 145, 153, 169, 177, 185, 201, 209, 217, 225, 257, 273, 297, 305, 313, 329, 345, 353, 385, 425, 433, 441, 481, 513, 561, 585, 609, 689, 697, 713, 817, 825, 945
Offset: 1

Views

Author

N. J. A. Sloane, Sep 04 2001

Keywords

Comments

Odd numbers n such that for all k with 1 <= k < sqrt(n), n - k^2 is not in A004215. - Robert Israel, Jan 24 2018
The only numbers for which allowing k = 0 would make a difference are 7 and 15: These two are not in A063954.

References

  • J. H. Conway, personal communication, Aug 27, 2001.

Crossrefs

Programs

  • Maple
    isA004215:= proc(n)
      local t;
      t:= padic:-ordp(n,2);
      t::even and (n/2^t) mod 8 = 7
    end proc:
    filter:= proc(n) andmap(not(isA004215), [seq(n - k^2, k=1..floor(sqrt(n-1)))]) end proc:
    select(filter, [seq(i,i=1..1000,2)]); # Robert Israel, Jan 24 2018
  • Mathematica
    ok[n_] := Range[ Floor[ Sqrt[n] ]] == DeleteCases[ Union[ Flatten[ PowersRepresentations[n, 4, 2]]], 0, 1, 1]; A063951 = Select[ Range[1, 999, 2], ok] (* Jean-François Alcover, Sep 12 2012 *)
  • PARI
    is_A063951(n)=bittest(n,0)&&!forstep(k=sqrtint(n-1),1,-1,isA004215(n-k^2)&&return) \\ M. F. Hasler, Jan 26 2018
    
  • PARI
    A063951=select(is_A063951,[1..945]) \\ M. F. Hasler, Jan 26 2018

Formula

This A063951 = A063954 U { 7, 15 }. - M. F. Hasler, Jan 27 2018

A084953 Numbers k such that k! is the sum of 4 but no fewer nonzero squares.

Original entry on oeis.org

10, 12, 24, 25, 48, 49, 54, 60, 78, 91, 96, 97, 107, 114, 120, 121, 142, 151, 167, 170, 172, 180, 192, 193, 212, 222, 226, 238, 240, 241, 246, 252, 270, 279, 301, 307, 309, 318, 327, 333, 344, 345, 357, 360, 361, 367, 375, 379, 384, 385, 403, 405, 421, 424, 425
Offset: 1

Views

Author

Hugo Pfoertner, Jun 15 2003

Keywords

Comments

The asymptotic density of this sequence is 1/8 (Deshouillers and Luca, 2010). - Amiram Eldar, Jan 11 2021

Examples

			a(1) = 10 because 10! cannot be written as the sum of fewer than 4 squares.
		

Crossrefs

Complement of A267215.

Programs

  • C
    /* See Alpern link. */
    
  • Mathematica
    Select[Range[500], Mod[#!/4^IntegerExponent[#!, 4], 8] == 7 &] (* Amiram Eldar, Jan 11 2021 *)
  • PARI
    isA004215(n)= n\4^valuation(n, 4)%8==7;
    isok(n) = isA004215(n!); \\ Michel Marcus, Dec 30 2020
    
  • Python
    from math import factorial
    from itertools import count, islice
    def A084953_gen(startvalue=1): # generator of terms >= startvalue
            return filter(lambda n:(factorial(n)>>((n-n.bit_count())&-2))&7==7,count(max(startvalue,1)))
    A084953_list = list(islice(A084953_gen(),30)) # Chai Wah Wu, Jul 09 2022

Formula

Equivalently, k! is of the form (4^i)*(8*j+7), i >= 0, j >= 0.
a(n) ~ 8n. - Charles R Greathouse IV, Jan 06 2025

Extensions

Edited and extended by Robert G. Wilson v, Jun 17 2003
Added missing term 357 by Rob Burns, Dec 30 2020

A180347 The number of n-digit numbers requiring 4 nonzero squares in their representation as sum of squares.

Original entry on oeis.org

1, 14, 150, 1500, 14999, 150000, 1499999, 15000000, 149999998, 1500000001, 14999999999, 149999999999, 1500000000001, 14999999999999, 149999999999999, 1500000000000001, 14999999999999998, 149999999999999999, 1500000000000000003, 14999999999999999996
Offset: 1

Views

Author

Martin Renner, Jan 18 2011

Keywords

Comments

A049415(n) + A180426(n) + A180429(n) + a(n) = A052268(n).

Crossrefs

Formula

a(n) = A167615(n)-A167615(n-1).

A267321 Perfect powers that are not of the form x^2 + y^2 + z^2 where x, y and z are integers.

Original entry on oeis.org

343, 3375, 12167, 16807, 21952, 29791, 59319, 103823, 166375, 216000, 250047, 357911, 493039, 658503, 759375, 778688, 823543, 857375, 1092727, 1367631, 1404928, 1685159, 1906624, 2048383, 2460375, 2924207, 3442951, 3796416, 4019679, 4657463, 5359375, 6128487
Offset: 1

Views

Author

Altug Alkan, Jan 13 2016

Keywords

Comments

Perfect powers that are the sum of 4 but no fewer nonzero squares. See first comment in A004215.
Intersection of A001597 and A004215.
A134738 is a subsequence.
Motivation for this sequence is the equation m^k = x^2 + y^2 + z^2 where x, y, z are integers and m > 0, k >= 2.
Corresponding exponents are 3, 3, 3, 5, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 7, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, 3, 3, 3, 3, 3, ...
Numbers of the form (4^i*(8*j+7))^(2*k+3) where i,j,k>=0. - Robert Israel, Jan 14 2016

Examples

			16807 is a term because 16807 = 7^5 and there is no integer values of x, y and z for the equation 7^5 = x^2 + y^2 + z^2.
		

Crossrefs

Programs

  • Maple
    N:= 10^10; # to get all terms <= N
    sort(convert({seq(seq(seq((4^i*(8*j+7))^(2*k+3),
        k=0..floor(1/2*(log[4^i*(8*j+7)](N)-3))),
         j = 0 .. floor((N^(1/3)*4^(-i)-7)/8)),
    i=0..floor(log[4](N^(1/3)/7)))},list)); # Robert Israel, Jan 14 2016
  • PARI
    isA004215(n) = { my(fouri, j) ; fouri=1 ; while( n >=7*fouri, if( n % fouri ==0, j= n/fouri -7 ; if( j % 8 ==0, return(1) ) ; ) ; fouri *= 4 ; ) ; return(0) ; } { for(n=1, 400, if(isA004215(n), print1(n, ", ") ; ) ; ) ; }
    for(n=0, 1e7, if(isA004215(n) && ispower(n), print1(n, ", ")));

A273324 Integers n such that n^2 + 3 is the sum of 4 but no fewer nonzero squares.

Original entry on oeis.org

2, 5, 6, 10, 11, 14, 18, 21, 22, 26, 27, 30, 34, 37, 38, 42, 43, 46, 50, 53, 54, 58, 59, 62, 66, 69, 70, 74, 75, 78, 82, 85, 86, 90, 91, 94, 98, 101, 102, 106, 107, 110, 114, 117, 118, 122, 123, 126, 130, 133, 134, 138, 139, 142, 146, 149, 150, 154, 155, 158, 162, 165, 166, 170
Offset: 1

Views

Author

Altug Alkan, May 20 2016

Keywords

Comments

If n^2 + k is a term of A004215, then the minimum positive value of k is 3, obviously.
See also the first differences (A278536) of this sequence.

Examples

			2 is in the sequence because 2^2 + 3 = 7 is a term of A004215.
		

Crossrefs

Programs

  • PARI
    isA004215(n) = {n\4^valuation(n, 4)%8==7}
    lista(nn) = for(n=1, nn, if(isA004215(n^2+3), print1(n, ", ")));

Formula

a(n) = A000196(1+A278491(n)). - Antti Karttunen, Nov 26 2016
Previous Showing 41-50 of 98 results. Next