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 21-30 of 98 results. Next

A034045 Numbers that are imprimitively but not primitively represented by x^2+y^2+z^2.

Original entry on oeis.org

0, 4, 8, 12, 16, 20, 24, 32, 36, 40, 44, 48, 52, 56, 64, 68, 72, 76, 80, 84, 88, 96, 100, 104, 108, 116, 120, 128, 132, 136, 140, 144, 148, 152, 160, 164, 168, 172, 176, 180, 184, 192, 196, 200, 204, 208, 212, 216, 224, 228, 232, 236, 244, 248, 256
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

Union of A047449 and A034045 is A000378. Union of A034044 and A034045 is A034047. Numbers that are in A000378 and congruent to 0 mod 4. - Ray Chandler, Sep 05 2004

A034047 Numbers that are primitively or imprimitively represented by x^2+y^2+z^2, but not both.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 8, 10, 11, 12, 13, 14, 16, 17, 19, 20, 21, 22, 24, 26, 29, 30, 32, 33, 34, 35, 36, 37, 38, 40, 41, 42, 43, 44, 46, 48, 51, 52, 53, 56, 57, 58, 59, 61, 62, 64, 65, 66, 67, 68, 69, 70, 72, 73, 74, 76, 77, 78, 80, 82, 83, 84, 85, 86, 88, 89, 91, 93
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

Union of A034046 and A034047 is A000378. Union of A034044 and A034045 is A034047. Numbers that are in A000378 and either squarefree or congruent to 0 mod 4. - Ray Chandler, Sep 05 2004

A343633 Z-coordinate of the points following the 3D spiral defined in A343630.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Apr 28 2021

Keywords

Comments

See the main entry A343630 for details about this 3D generalization of an Ulam type spiral using the Euclidean norm.
Sequences A343631 and A343632 give the x and y-coordinates.
The sequence can be seen as a table with row lengths A005875, where A005875(r) is the number of points at distance sqrt(r) from the origin.
Sequence A343643 is the analog for the square spiral variant A343640.

Crossrefs

Cf. A343631, A343633 (list of x and z-coordinates).
Cf. A343643 (variant using the sup norm => square spiral).
Cf. A342563 (variant which scans each sphere by increasing z).
Cf. A005875 (number of points on a shell with given radius).
Cf. A004215 (numbers that can't be written as sum of 3 squares => empty shells).

Programs

  • PARI
    d=1; A343633_vec=concat([[P[3] | P<-S=A343630_row(n,d)]+(#S&&!d*=-1) | n<-[0..9]]) \\ the variable d is necessary to correct the z-scan direction in rows between A004215(2k-1) and A004215(2k).

A055045 Numbers of the form 4^i*(8*j+5).

Original entry on oeis.org

5, 13, 20, 21, 29, 37, 45, 52, 53, 61, 69, 77, 80, 84, 85, 93, 101, 109, 116, 117, 125, 133, 141, 148, 149, 157, 165, 173, 180, 181, 189, 197, 205, 208, 212, 213, 221, 229, 237, 244, 245, 253, 261, 269, 276, 277, 285, 293, 301, 308, 309, 317, 320, 325, 333, 336, 340, 341
Offset: 1

Views

Author

N. J. A. Sloane, Jun 01 2000

Keywords

Comments

Numbers not of the form x^2+2y^2+6z^2.

Crossrefs

Programs

  • Haskell
    a055045 n = a055045_list !! (n-1)
    a055045_list = filter ((== 5) . (flip mod 8) . f) [1..] where
       f x = if r == 0 then f x' else x  where (x', r) = divMod x 4
    -- Reinhard Zumkeller, Jan 02 2014
    
  • Mathematica
    A055045Q[k_] := Mod[k/4^IntegerExponent[k, 4], 8] == 5;
    Select[Range[500], A055045Q] (* Paolo Xausa, Mar 20 2025 *)
  • PARI
    is(n)=n/=4^valuation(n,4); n%8==5 \\ Charles R Greathouse IV and V. Raman, Dec 19 2013
    
  • Python
    from itertools import count, islice
    def A055045_gen(startvalue=1): # generator of terms >= startvalue
        return filter(lambda n:not (m:=(~n&n-1).bit_length())&1 and (n>>m)&7==5, count(max(startvalue, 1)))
    A055045_list = list(islice(A055045_gen(), 30)) # Chai Wah Wu, Jul 09 2022
    
  • Python
    def A055045(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))-5>>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) = A055042(n)/2. - Chai Wah Wu, Mar 19 2025

A063949 Every number is the sum of 4 squares; these are the numbers n for which the first square can be taken to be any positive square < n.

Original entry on oeis.org

0, 1, 2, 3, 4, 5, 6, 7, 9, 10, 12, 13, 14, 15, 17, 18, 20, 21, 22, 25, 26, 28, 30, 33, 34, 36, 38, 41, 42, 45, 46, 49, 50, 52, 54, 57, 58, 60, 62, 65, 66, 68, 70, 73, 74, 78, 81, 82, 84, 86, 89, 90, 94, 97, 98, 100, 102, 105, 106, 110, 114, 118, 122, 126, 129, 130
Offset: 1

Views

Author

N. J. A. Sloane, Sep 04 2001

Keywords

Comments

The only primes of this form are 2, 3, 5, 7, 13, 17, 41, 73, 89, 97, 257, 313, 353, 433.
Also, the numbers n such that for no 0 < k < sqrt(n), n-k^2 is in A004215, i.e., of the form 4^i(8j+7). The largest odd number in this sequence is a(322) = 945, cf. A063951. - M. F. Hasler, Jan 26 2018

References

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

Crossrefs

Programs

  • Mathematica
    t1 = {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}; Union[{0}, t1, 4*t1, 4*Range[0, 999] + 2] (* T. D. Noe, Feb 22 2012 *)
  • PARI
    is_A063949(n)=if(bittest(n,0),is_A063951(n),n%4==2||is_A063951(n/4)||!n) \\ M. F. Hasler, Jan 26 2018
    
  • PARI
    #A063949_vec=select( is_A063949, [0..3780]) /* or: setunion(setunion(concat(0,A063951), 4*A063951),apply(t->t-2,4*[1..945])) */
    
  • PARI
    A063949(n)=if(n>1054,n*4-438,A063949_vec[n]) \\ M. F. Hasler, Jan 26 2018

Formula

Consists of 0, the 54 odd numbers in A063951, 4 times those numbers and all numbers of the form 4m+2.
a(n) = 4*(n-110) + 2 for all n > 1054. - M. F. Hasler, Jan 26 2018

A343630 Coordinate triples (x(n), y(n), z(n); n >= 0) of the 3D spiral filling space with shells of increasing radius, using circles at fixed z-values which alternatingly move up and down as do the x-values.

Original entry on oeis.org

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

Views

Author

M. F. Hasler, Apr 28 2021

Keywords

Comments

This is a 3D generalization of a plane filling spiral using the Euclidean norm.
See A343640 for an analog using the sup- or oo-norm, where circles are squares and spheres are cubes.
The integer lattice points, Z^3, are listed in order of increasing Euclidean distance R^2 = x^2 + y^2 + z^2 from the origin. Each shell of given radius is filled using circles located at given latitude (i.e., z-value) on the sphere, and each circle is filled by points with increasing longitude, where the positive x axis corresponds to longitude 0. The latitudes / z-values are alternately increasing and decreasing (so over a period of two shells they follow the same cosine-type shape as the x-values do over the period of each circle).
The sequence can be seen as a table with row length of 3, where each row corresponds to the (x,y,z)-coordinates of one point (the three columns are then A343631, A343632 and A343633), or as a table with row lengths 3*A005875, where A005875(r) is the number of points at distance sqrt(r) from the origin.
Sequence A343640 gives a square spiral variant.

Examples

			Shell r = 0 is the origin, {(0,0,0)}.
Shell r = 1 contains the 6 points {(0,0,1), (1,0,0), (0,1,0), (-1,0,0), (0,-1,0), (0,0,-1)}, located on the North pole, equator and South pole of the unit sphere. The equator (as all circles in the sequel) is "scanned" by increasing longitude = polar coordinate phi in the (x,y) plane with given z, where (x,y,z) = (R,0,0) has longitude 0.
Shell r = R^2 = 2 contains the 12 points (now in order of increasing z-coordinate) {(1,0,-1), (0,1,-1), (-1,0,-1), (0,-1,-1); (1,1,0), (-1,1,0), (-1,-1,0), (1,-1,0); (1,0,1), (0,1,1), (-1,0,1), (0,-1,1)}.
Then again, the points of shell r = R^2 = 3 are ordered by decreasing z-coordinate.
There are no points in shell r = R^2 = 7 = A004215(1), so from there on up to the next empty shell, the shells with even r are filled by decreasing z-coordinate.
		

Crossrefs

Cf. A343631, A343632, A343633 (list of x, y resp. z-coordinates only).
Cf. A343640, A343641, A343642, A343643 (variant using the sup norm => square spiral).
Cf. A342561, A342562, A342563 for a variant which scans each sphere by increasing z.
Cf. A005875 (number of points on a shell with given radius).
Cf. A004215 (numbers that can't be written as sum of 3 squares => empty shells).

Programs

  • PARI
    A343630_row(n, dir=(-1)^n, Q=Qfb(1, 0, 1), L=List())={for(z=if(n, sqrtint((n-1)\3)+1), sqrtint(n), my(S=if(n>z^2, Set(apply(vecsort, abs(qfbsolve(Q, n-z^2, 3)))), [[0, 0]])); foreach(S, s, forperm(concat(s, z), p, listput(L, p)))); for(i=1, 3, for(j=1, #L, my(X=L[j]); (X[i]*=-1) && listput(L, X))); vecsort(L, (p, q)->if( p[3]!=q[3], (p[3]-q[3])*dir, p[1]==q[1], q[2]-p[2], p[2]*q[2]<0, q[2]-p[2], (q[1]-p[1])*(p[2]+q[2])))} \\ returns row n of the table, i.e., the list of points (x,y,z) in Z^3 with Euclidean norm equal to sqrt(n), sorted by increasing latitude for dir = +1, else decreasing, and increasing longitude.
    A343630_vec=concat([[Vec(P) | P<-A343630_row(n)] | n<-[0..6]]) \\ beyond the empty row 7 one must correct the second argument, e.g. by using {... P<-S=A343630_row(n,d)]+(#S&&!d*=-1) ...} to flip the sign of d, initialized to 1, at each nonempty shell.

A034044 Numbers that are primitively but not imprimitively represented by x^2+y^2+z^2.

Original entry on oeis.org

1, 2, 3, 5, 6, 10, 11, 13, 14, 17, 19, 21, 22, 26, 29, 30, 33, 34, 35, 37, 38, 41, 42, 43, 46, 51, 53, 57, 58, 59, 61, 62, 65, 66, 67, 69, 70, 73, 74, 77, 78, 82, 83, 85, 86, 89, 91, 93, 94, 97, 101, 102, 105, 106, 107, 109, 110, 113, 114, 115, 118, 122, 123
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

Union of A034043 and A034044 is A000378. Union of A034044 and A034045 is A034047. Numbers that are in A000378 and squarefree. - Ray Chandler, Sep 05 2004

A034046 Numbers that are both primitively and imprimitively represented by x^2+y^2+z^2.

Original entry on oeis.org

9, 18, 25, 27, 45, 49, 50, 54, 75, 81, 90, 98, 99, 117, 121, 125, 126, 147, 150, 153, 162, 169, 171, 189, 198, 225, 234, 242, 243, 245, 250, 261, 270, 275, 289, 294, 297, 306, 315, 325, 333, 338, 342, 350, 361, 363, 369, 378, 387, 405, 414, 425
Offset: 1

Views

Author

Keywords

Crossrefs

Formula

Union of A034046 and A034047 is A000378. Intersection of A047449 and A034043 is A034046. Numbers that are in A000378 and neither squarefree nor congruent to 0 mod 4. - Ray Chandler, Sep 05 2004

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

Original entry on oeis.org

1, 3, 5, 9, 13, 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

This sequence is finite, with 52 terms.
This is a variant of A063951 where the arbitrary first squares must be positive. This makes a difference only for n = 7 and n = 15, which are in A063951 but not in this sequence, because for these two n and k = 0, n - k^2 is in A004215, i.e., not the sum of fewer than 4 squares. - M. F. Hasler, Jan 27 2018

References

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

Crossrefs

Programs

  • Mathematica
    j[k_] := If[Union[Flatten[PowersRepresentations[k,4,2]]^2] == (#^2&/@Range[0,Sqrt[k]]), True, False]; Select[Range[1,1250,2], j] (* Ant King, Nov 01 2010 *)
  • PARI
    is_A063954(n)=bittest(n, 0)&&!forstep(k=sqrtint(n-1), 0, -1, isA004215(n-k^2)&&return) \\ M. F. Hasler, Jan 27 2018

A072400 (Factors of 4 removed from n) modulo 8.

Original entry on oeis.org

1, 2, 3, 1, 5, 6, 7, 2, 1, 2, 3, 3, 5, 6, 7, 1, 1, 2, 3, 5, 5, 6, 7, 6, 1, 2, 3, 7, 5, 6, 7, 2, 1, 2, 3, 1, 5, 6, 7, 2, 1, 2, 3, 3, 5, 6, 7, 3, 1, 2, 3, 5, 5, 6, 7, 6, 1, 2, 3, 7, 5, 6, 7, 1, 1, 2, 3, 1, 5, 6, 7, 2, 1, 2, 3, 3, 5, 6, 7, 5, 1, 2, 3, 5, 5, 6, 7, 6, 1, 2, 3, 7, 5, 6, 7, 6
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 16 2002

Keywords

Comments

a(n) <> 7 iff n equals the sum of 3 integer squares.
a(A004215(k)) = 7 for k>0;

Examples

			From _Michael De Vlieger_, May 08 2017: (Start)
a(4) = 1 since 4 = 1 * 4^1 and 4 / 4^1 = 1; 1 = 1 (mod 8).
a(5) = 5 since it is not a multiple of 4; 5 = 5 (mod 8).
a(12) = 3 since 12 = 3 * 4^1 and 12 / 4^1 = 3; 3 = 3 (mod 8).
a(44) = 3 since 44 = 11 * 4^1 and 44 / 4^1 = 11; 3 = 11 (mod 8).
a(64) = 1 since 64 = 1 * 4^3 and 64 / 4^3 = 1; 1 = 1 (mod 8). (End)
		

Crossrefs

Programs

  • Mathematica
    Array[Mod[If[Mod[#, 4] == 0, #/4^IntegerExponent[#, 4], #], 8] &, 96] (* Michael De Vlieger, May 08 2017 *)
  • PARI
    a(n) = (n >> (2*valuation(n, 4))) % 8; \\ Amiram Eldar, May 15 2025
  • Python
    def A072400(n): return (n>>((~n&n-1).bit_length()&-2))&7 # Chai Wah Wu, Aug 01 2023
    

Formula

a(n) = A065883(n) mod 8.
A072401(n) = 1 - A057427(7 - a(n)).
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 4. - Amiram Eldar, May 15 2025

Extensions

Offset corrected (from 0 to 1) by Antti Karttunen, May 08 2017
Previous Showing 21-30 of 98 results. Next