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 14 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

A000404 Numbers that are the sum of 2 nonzero squares.

Original entry on oeis.org

2, 5, 8, 10, 13, 17, 18, 20, 25, 26, 29, 32, 34, 37, 40, 41, 45, 50, 52, 53, 58, 61, 65, 68, 72, 73, 74, 80, 82, 85, 89, 90, 97, 98, 100, 101, 104, 106, 109, 113, 116, 117, 122, 125, 128, 130, 136, 137, 145, 146, 148, 149, 153, 157, 160, 162, 164, 169, 170, 173, 178
Offset: 1

Views

Author

Keywords

Comments

From the formula it is easy to see that if k is in this sequence, then so are all odd powers of k. - T. D. Noe, Jan 13 2009
Also numbers whose cubes are the sum of two nonzero squares. - Joe Namnath and Lawrence Sze
A line perpendicular to y=mx has its first integral y-intercept at a^2+b^2. The remaining ones for that slope are multiples of that primitive value. - Larry J Zimmermann, Aug 19 2010
The primes in this sequence are sequence A002313.
Complement of A018825; A025426(a(n)) > 0; A063725(a(n)) > 0. - Reinhard Zumkeller, Aug 16 2011
If the two squares are not equal, then any power is still in the sequence: if k = x^2 + y^2 with x != y, then k^2 = (x^2-y^2)^2 + (2xy)^2 and k^3 = (x(x^2-3y^2))^2 + (y(3x^2-y^2))^2, etc. - Carmine Suriano, Jul 13 2012
There are never more than 3 consecutive terms that differ by 1. Triples of consecutive terms that differ by 1 occur infinitely many times, for example, 2(k^2 + k)^2, (k^2 - 1)^2 + (k^2 + 2 k)^2, and (k^2 + k - 1)^2 + (k^2 + k + 1)^2 for any integer k > 1. - Ivan Neretin, Mar 16 2017 [Corrected by Jerzy R Borysowicz, Apr 14 2017]
Number of terms less than 10^k, k=1,2,3,...: 3, 34, 308, 2690, 23873, 215907, 1984228, ... - Muniru A Asiru, Feb 01 2018
The squares in this sequence are the squares of the so-called hypotenuse numbers A009003. - M. F. Hasler, Jun 20 2025

Examples

			25 = 3^2 + 4^2, therefore 25 is a term. Note that also 25^3 = 15625 = 44^2 + 117^2, therefore 15625 is a term.
		

References

  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989.
  • GCHQ, The GCHQ Puzzle Book, Penguin, 2016. See page 103.
  • E. Grosswald, Representations of Integers as Sums of Squares. Springer-Verlag, NY, 1985, p. 75, Theorem 4, with Theorem 2, p. 15.
  • G. H. Hardy and E. M. Wright, An Introduction to the Theory of Numbers, 5th ed., Oxford Univ. Press, 1979, p. 219, th. 251, 252.
  • Ian Stewart, "Game, Set and Math", Chapter 8, 'Close Encounters of the Fermat Kind', Penguin Books, Ed. 1991, pp. 107-124.

Crossrefs

A001481 gives another version (allowing for zero squares).
Cf. A004431 (2 distinct squares), A063725 (number of representations), A024509 (numbers with multiplicity), A025284, A018825. Also A050803, A050801, A001105, A033431, A084888, A000578, A000290, A057961, A232499, A007692.
Cf. A003325 (analog for cubes), A003336 (analog for 4th powers).
Cf. A009003 (square roots of the squares in this sequence).
Column k=2 of A336725.

Programs

  • GAP
    P:=List([1..10^4],i->i^2);;
    A000404 := Set(Flat(List(P, i->List(P, j -> i+j)))); # Muniru A Asiru, Feb 01 2018
    
  • Haskell
    import Data.List (findIndices)
    a000404 n = a000404_list !! (n-1)
    a000404_list = findIndices (> 0) a025426_list
    -- Reinhard Zumkeller, Aug 16 2011
    
  • Magma
    lst:=[]; for n in [1..178] do f:=Factorization(n); if IsSquare(n) then for m in [1..#f] do d:=f[m]; if d[1] mod 4 eq 1 then Append(~lst, n); break; end if; end for; else t:=0; for m in [1..#f] do d:=f[m]; if d[1] mod 4 eq 3 and d[2] mod 2 eq 1 then t:=1; break; end if; end for; if t eq 0 then Append(~lst, n); end if; end if; end for; lst; // Arkadiusz Wesolowski, Feb 16 2017
    
  • Maple
    nMax:=178: A:={}: for i to floor(sqrt(nMax)) do for j to floor(sqrt(nMax)) do if i^2+j^2 <= nMax then A := `union`(A, {i^2+j^2}) else  end if end do end do: A; # Emeric Deutsch, Jan 02 2017
  • Mathematica
    nMax=1000; n2=Floor[Sqrt[nMax-1]]; Union[Flatten[Table[a^2+b^2, {a,n2}, {b,a,Floor[Sqrt[nMax-a^2]]}]]]
    Select[Range@ 200, Length[PowersRepresentations[#, 2, 2] /. {0, } -> Nothing] > 0 &] (* _Michael De Vlieger, Mar 24 2016 *)
    Module[{upto=200},Select[Union[Total/@Tuples[Range[Sqrt[upto]]^2,2]],#<= upto&]] (* Harvey P. Dale, Sep 18 2021 *)
  • PARI
    is_A000404(n)= for( i=1,#n=factor(n)~%4, n[1,i]==3 && n[2,i]%2 && return); n && ( vecmin(n[1,])==1 || (n[1,1]==2 && n[2,1]%2)) \\ M. F. Hasler, Feb 07 2009
    
  • PARI
    list(lim)=my(v=List(),x2); lim\=1; for(x=1,sqrtint(lim-1), x2=x^2; for(y=1,sqrtint(lim-x2), listput(v,x2+y^2))); Set(v) \\ Charles R Greathouse IV, Apr 30 2016
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A000404_gen(startvalue=1): # generator of terms >= startvalue
        for n in count(max(startvalue,1)):
            c = False
            for p in (f:=factorint(n)):
                if (q:= p & 3)==3 and f[p]&1:
                    break
                elif q == 1:
                    c = True
            else:
                if c or f.get(2,0)&1:
                    yield n
    A000404_list = list(islice(A000404_gen(),30)) # Chai Wah Wu, Jul 01 2022

Formula

Let k = 2^t * p_1^a_1 * p_2^a_2 * ... * p_r^a_r * q_1^b_1 * q_2^b_2 * ... * q_s^b_s with t >= 0, a_i >= 0 for i=1..r, where p_i == 1 (mod 4) for i=1..r and q_j == -1 (mod 4) for j=1..s. Then k is a term iff 1) b_j == 0 (mod 2) for j=1..s and 2) r > 0 or t == 1 (mod 2) (or both).
From Charles R Greathouse IV, Nov 18 2022: (Start)
a(n) ~ k*n*sqrt(log n), where k = 1.3085... = 1/A064533.
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. (End)

Extensions

Edited by Ralf Stephan, Nov 15 2004
Typo in formula corrected by M. F. Hasler, Feb 07 2009
Erroneous Mathematica program fixed by T. D. Noe, Aug 07 2009
PARI code fixed for versions > 2.5 by M. F. Hasler, Jan 01 2013

A057961 Number of points in square lattice covered by a disc centered at (0,0) as its radius increases.

Original entry on oeis.org

1, 5, 9, 13, 21, 25, 29, 37, 45, 49, 57, 61, 69, 81, 89, 97, 101, 109, 113, 121, 129, 137, 145, 149, 161, 169, 177, 185, 193, 197, 213, 221, 225, 233, 241, 249, 253, 261, 277, 285, 293, 301, 305, 317, 325, 333, 341, 349, 357, 365, 373, 377, 385, 401, 405, 421
Offset: 1

Views

Author

Ken Takusagawa, Oct 15 2000

Keywords

Comments

Useful for rasterizing circles.
Conjecture: the number of lattice points in a quadrant of the disk is equal to A000592(n-1). - L. Edson Jeffery, Feb 10 2014

Examples

			a(2)=5 because (0,0); (0,1); (0,-1); (1,0); (-1,0) are covered by any disc of radius between 1 and sqrt(2).
		

References

  • J. H. Conway and N. J. A. Sloane, "Sphere Packings, Lattices and Groups", Springer-Verlag, p. 106.

Crossrefs

Cf. A004018, A004020, A005883, A057962. Distinct terms of A057655.

Programs

  • Mathematica
    max = 100; A001481 = Select[Range[0, 4*max], SquaresR[2, #] != 0 &]; Table[SquaresR[2, A001481[[n]]], {n, 1, max}] // Accumulate (* Jean-François Alcover, Oct 04 2013 *)

A234300 Number of unit squares, aligned with a Cartesian grid, partially encircled along the edge of the first quadrant of a circle centered at the origin ordered by increasing radius.

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 3, 5, 3, 5, 4, 5, 5, 7, 5, 7, 5, 7, 7, 9, 7, 9, 8, 9, 7, 9, 7, 11, 9, 11, 9, 11, 10, 11, 9, 11, 11, 13, 11, 13, 11, 13, 11, 13, 11, 13, 13, 15, 12, 15, 13, 15, 13, 15, 13, 15, 13, 15, 15, 17, 13, 17, 15, 17, 16, 17, 15, 17, 15, 17, 15, 17, 17, 19, 17, 19, 15, 19, 17, 19, 17, 19, 17, 19, 18, 19, 17, 21, 19, 21, 19, 21, 19, 21, 19, 21, 19, 21, 19, 21
Offset: 0

Views

Author

Rajan Murthy, Dec 22 2013

Keywords

Comments

The first decrease from a(4) = 3 to a(5) = 2 occurs when the radius squared increases from an arbitrary position between 1 and 2 (when 3 squares are on the edge) to exactly 2 (when only 2 squares are on the edge because the circle of square radius 2 passes through the upper right corner on the y=x line). Similar decreases occur when the circle passes through other upper right corners. At least some (if not all) adjacent duplicates occur when the square radius corresponds to a perfect square, that is a corner which is only a lower right corner, i.e., on the y = 0 line. For example, a(6)=a(7)=3 occurs when, for n = 6 , a(n) corresponding to the interval between 2 and 4; and, for n=7, a(n) corresponding to the exact square radius of 4. Some of the confusion may come from the fact that for odd n, there is a unique circle corresponding to elements of a(n) (passing through the corner of specific square(s) on the grid), while for even n, there is a set of circles with a range of radii (which do not pass through corners) corresponding to the elements of a(n). It seems easier to organize the concept in terms of intervals and corners for the sake of consistency.
a(n) is even when the radius squared corresponds to an element of A024517.

Examples

			At radius 0, there are no partially filled squares.  At radius >1 but < sqrt(2), there are 3 partially filled squares along the edge of the circle.  At radius = sqrt(2), there are 2 partially filled squares along the edge of the circle.
		

Crossrefs

Cf. A001481 (corresponds to the square radius of alternate entries), A232499 (number of completely encircled squares when the radii are indexed by A000404), A235141 (first differences), A024517.
A237708 is the analog for the 3-dimensional Cartesian lattice and A239353 for the 4-dimensional Cartesian lattice.

Programs

  • Scilab
    function index = n_edgeindex (N)
        if N < 1 then
            N = 1
        end
        N = floor(N)
        i = 0:ceil(N/2)
        i = i^2
        index = i
        for j = 1:length(i)
           index = [index i+ i(j).*ones(i)]
        end
        index = unique(index)
        index = index(1:ceil(N))
        d = diff(index)/2
        d = d +  index(1:length(d))
        index = gsort([index d],"g","i")
        index = index(1:N)
    endfunction
    function l = n_edge_n (i)
            l=0
            h=0
            while (i > (2*h^2))
                h=h+1
            end
            if i < (2*h^2) then
                    l = l+1
            end
            if i >1 then
                t=[0 1]
               while (i>max(t))
                   t = [t (sqrt(max(t))+1)^2]
               end
            for j = 1:h
               b=t
               t=[2*(j)^2 (j+1)^2 + (j)^2]
               while (i>max(t))
                   t = [t (sqrt(max(t)-(j)^2)+1)^2 + (j)^2]
               end
               l = l+ 2*(length(b)-length(t))
               if max(t) == i then
                   l = l-2
               end
            end
           end
    endfunction
    function a =n_edge (N)
        if N <1 then
            N =1
        end
        N = floor(N)
        a= []
        index = n_edgeindex(N)
        for i = index
            a = [a n_edge_n(i)]
        end
    endfunction

Formula

a(2k+1) = a(2k) + 2*A000161(A001481(k+1)) - A010052(A001481(k+1)/2). - Rajan Murthy, Jan 14 2013
a(2k) = a(2k-1) - 2*(A000161(A001481(k+1)) - A010052(A001481(k+1))) + A010052(A001481(k+1)/2). - Rajan Murthy, Jan 14 2013

A235141 First differences of A234300.

Original entry on oeis.org

1, 0, 2, -1, 1, 0, 2, -2, 2, -1, 1, 0, 2, -2, 2, -2, 2, 0, 2, -2, 2, -1, 1, -2, 2, -2, 4, -2, 2, -2, 2, -1, 1, -2, 2, 0, 2, -2, 2, -2, 2, -2, 2, -2, 2, 0, 2, -3, 3, -2, 2, -2, 2, -2, 2, -2, 2, 0, 2, -4, 4, -2, 2, -1, 1, -2, 2, -2, 2, -2, 2, 0, 2, -2, 2, -4, 4, -2, 2, -2, 2
Offset: 1

Views

Author

Rajan Murthy, Jan 03 2014

Keywords

Comments

A geometric interpretation of the sequence is the number of added or subtracted squares along the edge of (not completely within) an origin centered circle in a quadrant of a Cartesian grid as the radius increases. The number of squares increase or decrease when the radius squared changes from being exactly on a corner of a square (r^2 = m^2+n^2) to the open interval between corners given by (m^2+n^2,(m+1)^2+(n+1)^2). The square radii that correspond to corners are given by A001481, so each a(n) corresponds to the radius changing from a point to an element of an open set bounded by adjacent elements of A001481.
a(n) is 0 when the radius squared increases from the open interval less than a perfect square to the perfect square itself (corresponding to a radius that intersects the x and y axes at an integer), see below for example.
a(n) is odd when the square radius changes to or from an integer which is twice a square integer (on a corner on the y= x line), see below for example.

Examples

			a(6) = 0 corresponding to a change of square radius from the open interval (3,4) to 4, i.e., the interval (A001481(3),A001481(4)) to A001481(4).
a(48) and a(49) are odd,  corresponding to the transition from (49,50) to 50 and 50 to (50,52) respectively (r = 5).
		

Crossrefs

First differences of A234300.
Cf. A001481 (see comments).
Cf. A232499 (number of completely encircled squares when the radii are indexed by A000404).

Formula

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

A237707 Number of unit cubes, aligned with a three-dimensional Cartesian mesh, completely within the first octant of a sphere centered at the origin, ordered by increasing radius.

Original entry on oeis.org

1, 4, 7, 10, 11, 17, 20, 23, 26, 32, 35, 38, 44, 48, 54, 60, 66, 69, 75, 78, 87, 96, 102, 105, 108, 114, 120, 121, 127, 133, 139, 145, 157, 163, 169, 178, 184, 196, 202, 214, 217, 220, 232, 238, 241, 244, 256, 263, 266, 278, 284, 296, 299, 308, 314, 329, 332
Offset: 1

Views

Author

Rajan Murthy, Feb 11 2014

Keywords

Examples

			When the radius of the sphere reaches 3^(1/2), one cube is completely within the sphere. When the radius reaches 6^(1/2), four cubes are completely within the sphere.
		

Crossrefs

The radii corresponding to the terms are given by the square roots of A000408 starting with squared radius 3.
Cf. A232499 (2-dimensional analog).
Partial sums of A014465 and A063691 (but then with repeated terms omitted).

Programs

  • Mathematica
    (* Illustrates the sequence *)
    Cube[x_,y_,z_]:=Cuboid[{x-1,y-1,z-1},{x,y,z}]
    Cubes[r_]:=Cube@@#&/@Select[Flatten[Table[{x,y,z},{x,1,r},{y,1,r},{z,1,r}],2],Norm[#]<=r&]
    Draw[r_]:=Graphics3D[Union[Cubes[r],{{Green, Opacity[0.3], Sphere[{0,0,0},r]}}],PlotRange->{{0,r},{0,r},{0,r}},ViewPoint->{r,3r/4,3r/5}];
    Draw/@Sqrt/@{3,6,9,11,12,14} (* Charles R Greathouse IV, Mar 12 2014 *)
  • Scilab
    // See Murthy link.

Formula

a(n) ~ (Pi*sqrt(30)/25)*n^(3/2). - Charles R Greathouse IV, Mar 14 2014

Extensions

Duplicate terms deleted by Rajan Murthy, Mar 06 2014
Terms a(36) and beyond added from b-file by Andrew Howroyd, Feb 27 2018

A323621 The order of square grid cells touched by a circle expanding from the middle of a cell read by antidiagonals.

Original entry on oeis.org

0, 1, 1, 3, 2, 3, 6, 4, 4, 6, 9, 7, 5, 7, 9, 13, 10, 8, 8, 10, 13, 18, 14, 11, 10, 11, 14, 18, 23, 19, 15, 12, 12, 15, 19, 23, 29, 24, 20, 17, 16, 17, 20, 24, 29, 35, 30, 25, 21, 20, 20, 21, 25, 30, 35, 42, 36, 31, 26, 24, 22, 24, 26, 31, 36, 42, 48, 43, 37, 33, 28, 27, 27, 28, 33, 37, 43, 48, 57, 49, 44, 39, 34, 33, 32, 33, 34, 39, 44, 49, 57
Offset: 0

Views

Author

Rok Cestnik, Jan 20 2019

Keywords

Comments

Related to, but not the same as the case with the circle centered at the corner of a cell, see A232499.

Crossrefs

For the first row of the grid see A323622.
For the second row of the grid see A323623.
For the diagonal of the grid see A323624.
For the (2,1) diagonal of the grid see A323625.
Cf. A232499.

Programs

  • Python
    N = 8
    from math import sqrt
    # the distance to the edge of each cell
    edges = [[-1 for j in range(N)] for i in range(N)]
    edges[0][0] = 0
    for i in range(1,N):
        edges[i][0] = i-0.5
        edges[0][i] = i-0.5
    for i in range(1,N):
        for j in range(1,N):
            edges[i][j] = sqrt((i-0.5)**2+(j-0.5)**2)
    # the values of the distances
    values = []
    for i in range(N):
        for j in range(N):
            values.append(edges[i][j])
    values = list(set(values))
    values.sort()
    # the cell order
    board = [[-1 for j in range(N)] for i in range(N)]
    count = 0
    for v in values:
        for i in range(N):
            for j in range(N):
                if(edges[i][j] == v):
                    board[i][j] = count
        count += 1
    # print out the sequence
    for i in range(N):
        for j in range(i+1):
            print(str(board[j][i-j])+" ", end="")

A239353 Number of unit hypercubes, aligned with a four-dimensional Cartesian mesh, completely within the first 2^4-ant of a hypersphere centered at the origin, ordered by increasing radius.

Original entry on oeis.org

1, 5, 11, 15, 19, 31, 32, 44, 48, 54, 58, 70, 82, 94, 100, 112, 124, 148, 164, 176, 194, 206, 219, 235, 247, 275, 281, 317, 333, 345, 369, 393, 417, 421, 437
Offset: 1

Views

Author

Rajan Murthy, Mar 16 2014

Keywords

Examples

			When the radius of the sphere reaches 2, one cube is completely within the sphere. When the radius reaches 7^(1/2), five cubes are completely within the sphere.
		

Crossrefs

Cf. A237707 (3-dimensional analog), A232499 (2-dimensional analog). The square radii corresponding to the elements of {a(n)} are the indices of the nonzero terms of A025428.

A323622 The first row of the order of square grid cells touched by a circle expanding from the middle of a cell.

Original entry on oeis.org

0, 1, 3, 6, 9, 13, 18, 23, 29, 35, 42, 48, 57, 65, 74, 84, 94, 104, 115, 127, 138, 151, 163, 177, 192, 205, 221, 235, 250, 267, 284, 301, 317, 337, 356, 376, 394, 415, 436, 456, 477, 500, 521, 546, 568, 590, 616, 640, 666, 690, 716, 745, 770, 798, 826, 855, 884, 913, 942, 973, 1003, 1033, 1066
Offset: 0

Views

Author

Rok Cestnik, Jan 20 2019

Keywords

Comments

Related to, but not the same as the case with the circle centered at the corner of a cell, see A232499.

Crossrefs

For the grid read by antidiagonals see A323621.
For the second row of the grid see A323623.
For the diagonal of the grid see A323624.
For the (2,1) diagonal of the grid see A323625.
Cf. A232499.

Programs

  • Python
    N = 12
    from math import sqrt
    # the distance to the edge of each cell
    edges = [[-1 for j in range(N)] for i in range(N)]
    edges[0][0] = 0
    for i in range(1,N):
        edges[i][0] = i-0.5
        edges[0][i] = i-0.5
    for i in range(1,N):
        for j in range(1,N):
            edges[i][j] = sqrt((i-0.5)**2+(j-0.5)**2)
    # the values of the distances
    values = []
    for i in range(N):
        for j in range(N):
            values.append(edges[i][j])
    values = list(set(values))
    values.sort()
    # the cell order
    board = [[-1 for j in range(N)] for i in range(N)]
    count = 0
    for v in values:
        for i in range(N):
            for j in range(N):
                if(edges[i][j] == v):
                    board[i][j] = count
        count += 1
    # print out the sequence
    for i in range(N):
        print(str(board[i][0])+" ", end="")

A323623 The second row of the order of square grid cells touched by a circle expanding from the middle of a cell.

Original entry on oeis.org

1, 2, 4, 7, 10, 14, 19, 24, 30, 36, 43, 49, 58, 66, 75, 85, 95, 105, 116, 128, 139, 152, 164, 178, 193, 206, 222, 236, 251, 268, 285, 302, 318, 338, 357, 377, 395, 416, 437, 457, 478, 501, 522, 547, 569, 591, 617, 641, 667, 691, 717, 746, 771, 799, 827, 856, 885, 914, 943, 974, 1004, 1034, 1067
Offset: 0

Views

Author

Rok Cestnik, Jan 20 2019

Keywords

Comments

Related to, but not the same as the case with the circle centered at the corner of a cell, see A232499.

Crossrefs

For the grid read by antidiagonals see A323621.
For the first row of the grid see A323622.
For the diagonal of the grid see A323624.
For the (2,1) diagonal of the grid see A323625.
Cf. A232499.

Programs

  • Python
    N = 12
    from math import sqrt
    # the distance to the edge of each cell
    edges = [[-1 for j in range(N)] for i in range(N)]
    edges[0][0] = 0
    for i in range(1,N):
        edges[i][0] = i-0.5
        edges[0][i] = i-0.5
    for i in range(1,N):
        for j in range(1,N):
            edges[i][j] = sqrt((i-0.5)**2+(j-0.5)**2)
    # the values of the distances
    values = []
    for i in range(N):
        for j in range(N):
            values.append(edges[i][j])
    values = list(set(values))
    values.sort()
    # the cell order
    board = [[-1 for j in range(N)] for i in range(N)]
    count = 0
    for v in values:
        for i in range(N):
            for j in range(N):
                if(edges[i][j] == v):
                    board[i][j] = count
        count += 1
    # print out the sequence
    for i in range(N):
        print(str(board[i][1])+" ", end="")
Showing 1-10 of 14 results. Next