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

A341422 a(n) is the number of solutions of the congruence j^2 + j + 1 == 0 (mod k = A034017(n+1)), for j from {0, 1, 2, ..., k-1}, for n >= 1.

Original entry on oeis.org

1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 4, 4, 2, 4, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 4, 2, 2, 2, 4, 2, 2, 2, 2, 2, 4, 2, 4, 2, 2, 2, 2, 4, 2, 2, 2, 2, 4, 4, 2, 2, 2, 4, 2, 2
Offset: 1

Views

Author

Wolfdieter Lang, Apr 08 2021

Keywords

Comments

This gives the row lengths of the irregular triangle A343232.
This sequence gives the number of representative parallel primitive forms (rpapfs) of the positive definite binary quadratic form F = x^2 + x*y + y^2 (with Discriminant Disc = -3) representing positive integers k. Only certain odd k, namely k = k(n) = A034017(n+1), for n >= 1, have proper solutions F = k.
Positive definite binary quadratic primitive forms F = [a, b, c], with a > 0 and gcd(a, b, c) = 1, with odd discriminants Disc = b^2 - 4*a*c = -D < 0, that is, D == 3 (mod 4), and representation of positive integers k have representative parallel primitive forms (rpapfs) Fpa(D,k;j) = [k, 2*j+1, (j^2 + j + (D+1)/4)/k].
Each rpapf produces a trivial proper solution to F = k, obtained from the trivial solution of Fpa(D,k;j) = k by (x, y) = (1,0), via equivalence transformations of determinant +1 achieved by applying the inverse of products of matrices R(t) = Mat([0,-1], [1t]]) for certain values t. The R(t) transformations are used to obtain from a primitive form F = [a, b, c] the equivalent so-called unique half-reduced (right) neighbor form F' = [c, -b + 2*c*t, a - b*t + c*t^2], with the choice t = ceiling((b/c - 1)/2). (c > 0 because a > 0 for positive definite forms with D > 0.)

Crossrefs

Cf. A000086 (with zeros), A002061, A034017, A343232.

Formula

a(n) = |M(k(n))|, with the set M(k(n)) := {j from {0, 1, ..., k(n)-1} | j^2 + j + 1 == 0 (mod k(n))}, where j^2 + j + 1 = 2*T(j) + 1 = A002061(j+1) and k(n) = A034017(n+1), for n >= 1.

A343232 Irregular triangle T read by rows: T(n, m) gives the solutions j of the congruence A002061(j+1) = j^2 + j + 1 == 0 (mod k(n)), with k(n) = A034017(n+1), for j from {0, 1, ..., k(n)-1}, and n >= 1.

Original entry on oeis.org

0, 1, 2, 4, 3, 9, 7, 11, 4, 16, 5, 25, 10, 26, 16, 22, 6, 36, 18, 30, 7, 49, 13, 47, 29, 37, 8, 64, 23, 55, 9, 16, 74, 81, 25, 67, 35, 61, 46, 56, 45, 63, 10, 100, 19, 107, 49, 79, 11, 30, 102, 121, 42, 96, 67, 79
Offset: 1

Views

Author

Wolfdieter Lang, Apr 08 2021

Keywords

Comments

The length of row n is A341422(n), the number of representative parallel primitive forms (rpapfs) for positive binary quadratic forms of Discriminant = -3 representing k = k(n) = A034017(n+1), for n >= 1.
These rpapfs for each j are [k(n), 2*j+1, (j^2 + j + 1)/k(n)], for n >= 1.
The solutions for k(n) >= 7 come in pairs j and k(n) - (1 + j). For k(1) = 1 and k(2) = 3 these pairs collapse to one solution.

Examples

			The irregular triangle T(n, m) begins:
n,   k(n)\m  1   2   3   4 ...   rpapfs
1,    1:     0                  [1,1,1]
2,    3:     1                  [3,3,1]
3,    7:     2   4              [7,5,1],      [7,9,3]
4,   13:     3   9              [13,7,1],     [13,19,7]
5,   19:     7  11              [19,15,3],    [19,23,7]
6,   21:    14  16              [21,9,1],     [21,33,13]
7,   31:     5  25              [31,11,1],    [31,51,21]
8,   37:    10  26              [37,21,3],    [37,53,19]
9,   39:    16  22              [39,33,7],    [39,45,13]
10,  43:     6  36              [43,13,1],    [43,73,31]
11,  49:    18  30              [49,37,7],    [49,61,19]
12,  57:     7  49              [57,15,1],    [57,99,43]
13,  61:    13  47              [61,27,3],    [61,95,37]
14,  67:    29  37              [67,59,13],   [67,75,21]
15,  73:     8  64              [73,17,1],    [73,129,57]
16,  79:    23  55              [79,47,7],    [79,111,39]
17,  91:     9  16              [91,19,1],    [91,33,3], [91,149,61],
                                [91,163,73]
18,  93:    25  67              [93,51,7],    [93,135,49]
19,  97:    35  61              [97,71,13] ,  [97,123,39]
20, 103:    46  56              [103,93,21],  [103,113,31]
21, 109:    45  63              [109,91,19],  [109,127,37]
22, 111:    10 100              [111,21,1],   [111,201,91]
23, 127:    19 107              [127,39,3],   [127,215,91]
24, 129:    49  79              [129,99,19],  [129,159,49]
25, 133:    11  30 102 121      [133, 23,1],  [133,61,7], [133,205,79],
                                [133,243,111]
26, 139     42  96              [139,85,13],  [139,193, 67]
27, 147:    67  79              [147,135,31], [147,159,43]
28, 151:    32 118              [151,65,7],   [151,237,93]
29, 157:    12 144              [157,25,1],   [157,289,133]
30, 163:    58 104              [163,117,21], [163,209,67]
...
		

Crossrefs

Formula

T(n, m) gives the solutions j of A002061(j+1) = j^2 + j + 1 == 0 (mod k(n)), for k(n) = A034017(n+1), for n >= 1.

A003136 Loeschian numbers: numbers of the form x^2 + xy + y^2; norms of vectors in A2 lattice.

Original entry on oeis.org

0, 1, 3, 4, 7, 9, 12, 13, 16, 19, 21, 25, 27, 28, 31, 36, 37, 39, 43, 48, 49, 52, 57, 61, 63, 64, 67, 73, 75, 76, 79, 81, 84, 91, 93, 97, 100, 103, 108, 109, 111, 112, 117, 121, 124, 127, 129, 133, 139, 144, 147, 148, 151, 156, 157, 163, 169, 171, 172, 175, 181, 183, 189, 192
Offset: 1

Views

Author

Keywords

Comments

Equally, numbers of the form x^2 - xy + y^2. - Ray Chandler, Jan 27 2009
Also, numbers of the form X^2+3Y^2 (X=y+x/2, Y=x/2), cf. A092572. - Zak Seidov, Jan 20 2009
Theorem (Schering, Delone, Watson): The only positive definite binary quadratic forms that represent the same numbers are x^2+xy+y^2 and x^2+3y^2 (up to scaling). - N. J. A. Sloane, Jun 22 2014
Equivalently, numbers n such that the coefficient of x^n in Theta3(x)*Theta3(x^3) is nonzero. - Joerg Arndt, Jan 16 2011
Equivalently, numbers n such that the coefficient of x^n in a(x) (resp. b(x)) is nonzero where a(), b() are cubic AGM functions. - Michael Somos, Jan 16 2011
Relative areas of equilateral triangles whose vertices are on a triangular lattice. - Anton Sherwood (bronto(AT)pobox.com), Apr 05 2001
2 appended to a(n) (for positive n) corresponds to capsomere count in viral architectural structures (cf. A071336). - Lekraj Beedassy, Apr 14 2006
The triangle in A132111 gives the enumeration: n^2 + k*n + k^2, 0 <= k <= n.
The number of coat proteins at each corner of a triangular face of a virus shell. - Parthasarathy Nambi, Sep 04 2007
Numbers of the form (x^2 + y^2 + (x + y)^2)/2. If we let z = - x - y, then all the solutions to x^2 + y^2 + z^2 = k with x + y + z = 0 are k = 2a(n) for any n. - Jon Perry, Dec 16 2012
Sequence of divisors of the hexagonal lattice, except zero (where it is said that an integer n divides a lattice if there exists a sublattice of index n; example: 3 divides the hexagonal lattice). - Jean-Christophe Hervé, May 01 2013
Numbers of the form - (x*y + y*z + x*z) with x + y + z = 0. Numbers of the form x^2 + y^2 + z^2 - (x*y + y*z + x*z) = (x - y)*(x - z) + (y - x) * (y - z) + (z - x) * (z - y). - Michael Somos, Jun 26 2013
Equivalently, the existence spectrum of affine Mendelsohn triple systems, cf. A248107. - David Stanovsky, Nov 25 2014
Lame's solutions to the Helmholtz equation with Dirichlet boundary conditions on the unit-edged equilateral triangle have eigenvalues of the form: (x^2+x*y+y^2)*(4*Pi/3)^2. The actual set, starting at 1 and counting degeneracies, is given by A060428, e.g., the first degeneracy is 49 where (x,y)=(0,7) and (3,5). - Robert Stephen Jones, Oct 01 2015
Curvatures of spheres in one bowl of integers, the Loeschian spheres. Mod 12, numbers equal to 0, 1, 3, 4, 7, 9. - Ed Pegg Jr, Jan 10 2017
Norms of Eisenstein integers Z[omega] or k(rho). - Juris Evertovskis, Dec 07 2017
Named after the German economist August Lösch (1906-1945). - Amiram Eldar, Jun 10 2021
Starting from the second element, these and only these numbers of congruent equilateral triangles can be used to cover a regular tetrahedron without overlaps or gaps. - Alexander M. Domashenko, Feb 01 2025
This sequence is closed under multiplication: (x; y)*(u; v) = (x*v - y*u; x*u + y*(u + v)) for x*v - y*u >= 0 , (x; y)*(u; v) = (y*u - x*v; x*u + v*(x + y)) for x*v - y*u < 0. - Alexander M. Domashenko, Feb 03 2025

References

  • J. H. Conway and N. J. A. Sloane, Sphere Packings, Lattices and Groups, Springer-Verlag, p. 111.
  • Ivars Peterson, The Jungles of Randomness: A Mathematical Safari, John Wiley and Sons, (1998) pp. 53.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

See A092572 for numbers of form x^2 + 3 y^2 with positive x,y.
See A088534 for the number of representations.
Cf. A034020 (complement), A007645 (primes); partitions: A198726, A198727.

Programs

  • Haskell
    import Data.Set (singleton, union, fromList, deleteFindMin)
    a003136 n = a003136_list !! (n-1)
    a003136_list = f 0 $ singleton 0 where
    f x s | m < x ^ 2 = m : f x s'
    | otherwise = m : f x'
    (union s' $ fromList $ map (\y -> x'^2+(x'+y)*y) [0..x'])
    where x' = x + 1
    (m,s') = deleteFindMin s
    -- Reinhard Zumkeller, Oct 30 2011
    
  • Julia
    function isA003136(n)
        n % 3 == 2 && return false
        n in [0, 1, 3] && return true
        M = Int(round(2*sqrt(n/3)))
        for y in 0:M, x in 0:y
            n == x^2 + y^2 + x*y && return true
        end
        return false
    end
    A003136list(upto) = [n for n in 0:upto if isA003136(n)]
    A003136list(192) |> println # Peter Luschny, Mar 17 2018
    
  • Magma
    [n: n in [0..192] | NormEquation(3, n) eq true]; // Arkadiusz Wesolowski, May 11 2016
    
  • Maple
    readlib(ifactors): for n from 2 to 200 do m := ifactors(n)[2]: flag := 1: for i from 1 to nops(m) do if m[i,1] mod 3 = 2 and m[i,2] mod 2 = 1 then flag := 0; break fi: od: if flag=1 then printf(`%d,`,n) fi: od: # James Sellers, Dec 07 2000
  • Mathematica
    ok[n_] := Resolve[Exists[{x, y}, Reduce[n == x^2 + x*y + y^2, {x, y}, Integers]]]; Select[Range[0, 192], ok] (* Jean-François Alcover, Apr 18 2011 *)
    nn = 14; Select[Union[Flatten[Table[x^2 + x*y + y^2, {x, 0, nn}, {y, 0, x}]]], # <= nn^2 &] (* T. D. Noe, Apr 18 2011 *)
    QP = QPochhammer; s = QP[q]^3 / QP[q^3]/3 + O[q]^200; Position[ CoefficientList[s, q], n_ /; n != 0] - 1 // Flatten (* Jean-François Alcover, Nov 27 2015, adapted from PARI *)
  • PARI
    isA003136(n)=local(fac,flag);if(n==0,1,fac=factor(n);flag=1;for(i=1,matsize(fac)[1],if(Mod(fac[i,1],3)==2 && Mod(fac[i,2],2)==1,flag=0));flag)
    
  • PARI
    is(n)=#bnfisintnorm(bnfinit(z^2+z+1),n) \\ Ralf Stephan, Oct 18 2013
    
  • PARI
    x='x+O('x^200); p=eta(x)^3/eta(x^3); for(n=0, 199, if(polcoeff(p, n) != 0, print1(n, ", "))) \\ Altug Alkan, Nov 08 2015
    
  • PARI
    list(lim)=my(v=List(),y,t); for(x=0,sqrtint(lim\3), my(y=x,t); while((t=x^2+x*y+y^2)<=lim, listput(v,t); y++)); Set(v) \\ Charles R Greathouse IV, Feb 05 2017
    
  • PARI
    is_a003136(n) = !n || #qfbsolve(Qfb(1, 1, 1), n, 3) \\ Hugo Pfoertner, Aug 04 2023
    
  • Python
    from itertools import count, islice
    from sympy import factorint
    def A003136_gen(): return (n for n in count(0) if all(e % 2 == 0 for p,e in factorint(n).items() if p % 3 == 2))
    A003136_list = list(islice(A003136_gen(),30)) # Chai Wah Wu, Jan 20 2022

Formula

Either n=0 or else in the prime factorization of n all primes of the form 3a+2 must occur to even powers only (there is no restriction of primes congruent to 0 or 1 mod 3).
If n is in the sequence, then n^k is in the sequence (but the converse is not true). n is in the sequence iff n^(2k+1) is in the sequence. - Ray Chandler, Feb 03 2009
A088534(a(n)) > 0. - Reinhard Zumkeller, Oct 30 2011
The sequence is multiplicative in the sense that if m and n are in the sequence, so is m*n. - Jon Perry, Dec 18 2012
Comments from Richard C. Schroeppel, Jul 20 2016: (Start)
The set is also closed under restricted division: If M and N are members, and M divides N, then N/M is a member.
If N == 2 (mod 3), N is not in the sequence.
The density of members (relative to the integers>0) gradually falls to 0. The density goes as O(1/sqrt(log N)). This implies that, if N is a member, the average expected number of representations of N is O(sqrt(log N)).
Representations usually come in sets of 6: (K,L), (K+L,-K), (K+L,-L) and their negatives. (End)
Since Q(zeta), where zeta is a primitive 3rd root of unity has class number 1, the situation as to whether an integer is of the form x^2 + xy + y^2 is similar to the situation with x^2 + y^2: n is of that form if and only if every prime p dividing n which is = 5 mod 6 divides it to an even power. The density of 1/sqrt(x) that Rich mentioned is an old result due to Landau. - Victor S. Miller, Jul 20 2016
From Juris Evertovskis, Dec 07 2017; Jan 01 2020: (Start)
In the prime factorization of n, let S_1 be the set of distinct prime factors p_i for which p_i == 1 (mod 3), let S_2 be the set of distinct prime factors p_j for which p_j == 2 (mod 3), and let M be the exponent of 3. Then n = 3^M * (Product_{p_i in S_1} p_i ^ e_i) * (Product_{p_j in S_2} p_j ^ e_j), and the number of solutions for x^2+xy+y^2=n is 6*Product_{p_i in S_1} (e_i + 1) if all e_j are even and 0 otherwise.
For all Löschian numbers there are nonnegative X,Y such that X^2+XY+Y^2=n. For x,y such that x^2+xy+y^2=n take X=min(|x|,|y|), Y=|x+y| if xy<0 and X=|x|, Y=|y| otherwise. (End)

A007645 Generalized cuban primes: primes of the form x^2 + xy + y^2; or primes of the form x^2 + 3*y^2; or primes == 0 or 1 (mod 3).

Original entry on oeis.org

3, 7, 13, 19, 31, 37, 43, 61, 67, 73, 79, 97, 103, 109, 127, 139, 151, 157, 163, 181, 193, 199, 211, 223, 229, 241, 271, 277, 283, 307, 313, 331, 337, 349, 367, 373, 379, 397, 409, 421, 433, 439, 457, 463, 487, 499, 523, 541, 547, 571, 577, 601, 607, 613
Offset: 1

Views

Author

Keywords

Comments

Also, odd primes p such that -3 is a square mod p. - N. J. A. Sloane, Dec 25 2017
Equivalently, primes of the form p = (x^3 - y^3)/(x - y). If x=y+1 we get the cuban primes A002407, which is therefore a subsequence.
These are not to be confused with the Eisenstein primes, which are the primes in the ring of integers Z[w], where w = (-1+sqrt(-3))/2. The present sequence gives the rational primes which are also Eisenstein primes. - N. J. A. Sloane, Feb 06 2008
Also primes of the form x^2+3y^2 and, except for 3, x^2+xy+7y^2. See A140633. - T. D. Noe, May 19 2008
Conjecture: this sequence is Union(A002383,A162471). - Daniel Tisdale, Jul 04 2009
Primes p such that antiharmonic mean B(p) of the numbers k < p such that gcd(k, p) = 1 is not integer, where B(p) = A053818(p) / A023896(p) = A175505(p) / A175506(p) = (2p - 1) / 3. Primes p such that A175506(p) > 1. Subsequence of A179872. Union a(n) + A179891 = A179872. Example: a(6) = 37 because B(37) = A053818(37) / A023896(37) = A175505(37) / A175506(37) = 16206 / 666 = 73 / 3 (not integer). Cf. A179871, A179872, A179873, A179874, A179875, A179876, A179877, A179878, A179879, A179880, A179882, A179883, A179884, A179885, A179886, A179887, A179890, A179891, A003627, A034934. - Jaroslav Krizek, Aug 01 2010
Subsequence of Loeschian numbers, cf. A003136 and A024614; A088534(a(n)) > 0. - Reinhard Zumkeller, Oct 30 2011
Primes such that there exist a unique x, y, with 1 < x <= y < p, x + y == 1 (mod p) and x * y == 1 (mod p). - Jon Perry, Feb 02 2014
The prime factors of A002061. - Richard R. Forberg, Dec 10 2014
This sequence gives the primes p which solve s^2 == -3 (mod 4*p) (see Buell, Proposition 4.1., p. 50, for Delta = -3). p = 2 is not a solution. x^2 == -3 (mod 4) has solutions for all odd x. x^2 == -3 (mod p) has for odd primes p, not 3, the solutions of Legendre(-3|p) = +1 which are p == {1, 7} (mod 12). For p = 3 the representative solution is x = 0. Hence the solution of s^2 == -3 (mod 4*p) are the odd primes p = 3 and p == {1, 7} (mod 12) (or the primes p = 0, 1 (mod 3)). - Wolfdieter Lang, May 22 2021

References

  • D. A. Buell, Binary Quadratic Forms. Springer-Verlag, NY, 1989, p. 50.
  • Conway, J. H. and Guy, R. K. The Book of Numbers. New York: Springer-Verlag, pp. 220-223, 1996.
  • David A. Cox, "Primes of the Form x^2 + n y^2", Wiley, 1989, p. 7.
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
  • Wagon, S. "Eisenstein Primes." Section 9.8 in Mathematica in Action. New York: W. H. Freeman, pp. 319-323, 1991.

Crossrefs

Subsequence of A003136.
Subsequences include A002407, A002648, and A201477.
Apart from initial term, same as A045331.
Cf. A001479, A001480 (x and y such that a(n) = x^2 + 3y^2).
Primes in A003136 and A034017.

Programs

  • Haskell
    a007645 n = a007645_list !! (n-1)
    a007645_list = filter ((== 1) . a010051) $ tail a003136_list
    -- Reinhard Zumkeller, Jul 11 2013, Oct 30 2011
  • Maple
    select(isprime,[3, seq(6*k+1, k=1..1000)]); # Robert Israel, Dec 12 2014
  • Mathematica
    Join[{3},Select[Prime[Range[150]],Mod[#,3]==1&]] (* Harvey P. Dale, Aug 21 2021 *)
  • PARI
    forprime(p=2,1e3,if(p%3<2,print1(p", "))) \\ Charles R Greathouse IV, Jun 16 2011
    

Formula

p == 0 or 1 (mod 3).
{3} UNION A002476. - R. J. Mathar, Oct 28 2008

Extensions

Entry revised by N. J. A. Sloane, Jan 29 2013

A000086 Number of solutions to x^2 - x + 1 == 0 (mod n).

Original entry on oeis.org

1, 0, 1, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 2, 0, 0
Offset: 1

Views

Author

Keywords

Comments

Number of elliptic points of order 3 for Gamma_0(n).
Equivalently, number of fixed points of Gamma_0(n) of type rho.
Values are 0 or a power of 2.
Shadow transform of central polygonal numbers A002061. - Michel Marcus, Jun 06 2013
Empirical: a(n) == A001615(n) (mod 3) for all natural numbers n. - John M. Campbell, Apr 01 2018
From Jianing Song, Jul 03 2018: (Start)
The comment above is true. Since both a(n) and A001615(n) are multiplicative we just have to verify that for prime powers. Note that A001615(p^e) = (p+1)*p^(e-1). For p == 1 (mod 3), p+1 == 2 (mod 3) so (p+1)*p^(e-1) == 2 (mod 3); for p == 2 (mod 3), p+1 is a multiple of 3 so (p+1)*p^(e-1) == 0 (mod 3). For p = 3, if e = 1 then p+1 == 1 (mod 3); if e > 1 then (p+1)*p^(e-1) == 0 (mod 3).
Equivalently, number of solutions to x^2 + x + 1 == 0 (mod n). (End)

Examples

			G.f. = x + x^3 + 2*x^7 + 2*x^13 + 2*x^19 + 2*x^21 + 2*x^31 + 2*x^37 + 2*x^39 + ...
		

References

  • Bruno Schoeneberg, Elliptic Modular Functions, Springer-Verlag, NY, 1974, p. 101.
  • Goro Shimura, Introduction to the Arithmetic Theory of Automorphic Functions, Princeton, 1971, see p. 25, Eq. (3).

Crossrefs

Cf. A341422 (without zeros).

Programs

  • Haskell
    a000086 n = if n `mod` 9 == 0 then 0
      else product $ map ((* 2) . a079978 . (+ 2)) $ a027748_row $ a038502 n
    -- Reinhard Zumkeller, Jun 23 2013
  • Maple
    with(numtheory); A000086 := proc (n) local d, s; if modp(n,9) = 0 then RETURN(0) fi; s := 1; for d in divisors(n) do if isprime(d) then s := s*(1+eval(legendre(-3,d))) fi od; s end: # Gene Ward Smith, May 22 2006
  • Mathematica
    Array[ Function[ n, If[ EvenQ[ n ] || Mod[ n, 9 ]==0, 0, Count[ Array[ Mod[ #^2-#+1, n ]&, n, 0 ], 0 ] ] ], 84 ]
    a[ n_] := If[ n < 1, 0, Length[ Select[ (#^2 - # + 1)/n & /@ Range[n], IntegerQ]]]; (* Michael Somos, Aug 14 2015 *)
    a[n_] := a[n] = Product[{p, e} = pe; Which[p==1 || p==3 && e==1, 1, p==3 && e>1, 0, Mod[p, 3]==1, 2, Mod[p, 3]==2, 0, True, a[p^e]], {pe, FactorInteger[n]}]; Array[a, 105] (* Jean-François Alcover, Oct 18 2018 *)
  • PARI
    {a(n) = if( n<1, 0, sum( x=0, n-1, (x^2 - x + 1)%n==0))}; \\ Nov 15 2002
    
  • PARI
    {a(n) = if( n<1, 0, direuler( p=2, n, if( p==3, 1 + X, if( p%3==2, 1, (1 + X) / (1 - X)))) [n])}; \\ Nov 15 2002
    

Formula

Multiplicative with a(p^e) = 1 if p = 3 and e = 1; 0 if p = 3 and e > 1; 2 if p == 1 (mod 3); 0 if p == 2 (mod 3). - David W. Wilson, Aug 01 2001
a(A226946(n)) = 0; a(A034017(n)) > 0. - Reinhard Zumkeller, Jun 23 2013
a(2*n) = a(3*n + 2) = a(9*n) = a(9*n + 6) = 0. - Michael Somos, Aug 14 2015
Asymptotic mean: Limit_{m->oo} (1/m) * Sum_{k=1..m} a(k) = 2*sqrt(3)/(3*Pi) = 0.367552... (A165952). - Amiram Eldar, Oct 11 2022

A004611 Divisible only by primes congruent to 1 mod 3.

Original entry on oeis.org

1, 7, 13, 19, 31, 37, 43, 49, 61, 67, 73, 79, 91, 97, 103, 109, 127, 133, 139, 151, 157, 163, 169, 181, 193, 199, 211, 217, 223, 229, 241, 247, 259, 271, 277, 283, 301, 307, 313, 331, 337, 343, 349, 361, 367, 373, 379, 397, 403, 409, 421, 427, 433, 439, 457
Offset: 1

Views

Author

Keywords

Comments

In other words, if a prime p divides n, then p == 1 mod 3.
Equivalently, products of primes == 1 (mod 6), products of elements of A002476.
Positive integers n such that n+d+1 is divisible by 3 for all divisors d of n. For example, a(13)=91 since 91=7*13, 91+1+1=93=3*31, 91+7+1=99=9*11, 91+13+1=105=3*7*5, 91+91+1=183=3*61. The only prime p such that x+d+1 is divisible by p for all divisors d of x is p=3. The sequence consists of 1 and all integers whose prime divisors are of the form 6k+1. - Walter Kehowski, Aug 09 2006
Also z such that z^2 = x^2 + x*y + y^2 and gcd(x,y,z) = 1. - Frank M Jackson, Jul 30 2013
From Jean-Christophe Hervé, Nov 24 2013: (Start)
Apart from the first term (for all in this comment), this sequence is the analog of A008846 (hypotenuses of primitive Pythagorean triangles) for triangles with integer sides and a 120-degree angle: a(n), n>1, is the sequence of lengths of the longest side of the primitive triangles.
Not only the square of these numbers is equal to x^2 + xy + y^2 with x and y > 0, but the numbers themselves also are; the sequence starting at n=2 is then a subsequence of A024606.
(End)
Numbers n such that 3/n cannot be written as the sum of 2 unit fractions. - Carl Schildkraut, Jul 19 2016
a(n), n>1, is the sequence of lengths of the middle side b of the primitive triangles such that A < B < C with an angle B = 60 degrees (A335895). Compare with comment of Nov 24 2013 where a(n), n>1, is the sequence of lengths of the longest side of the primitive triangles that have an angle = 120 degrees. - Bernard Schott, Mar 29 2021

Crossrefs

Multiplicative closure of A002476.

Programs

  • Magma
    [n: n in [1..500] | forall{d: d in PrimeDivisors(n) | d mod 3 eq 1}]; // Vincenzo Librandi, Aug 21 2012
    
  • Maple
    with(numtheory): for n from 1 to 1801 by 6 do it1 := ifactors(n)[2]: it2 := 1: for i from 1 to nops(it1) do if it1[i][1] mod 6 > 1 then it2 := 0; break fi: od: if it2=1 then printf(`%d,`,n) fi: od:
    with(numtheory): cnt:=0: L:=[]: for w to 1 do for n from 1 while cnt<100 do dn:=divisors(n); Q:=map(z-> n+z+1, dn); if andmap(z-> z mod 3 = 0, Q) then cnt:=cnt+1; L:=[op(L),[cnt,n]]; fi; od od; L; # Walter Kehowski, Aug 09 2006
  • Mathematica
    ok[1]=True;ok[n_]:=And@@(Mod[#,3]==1&)/@FactorInteger[n][[All,1]];Select[Range[500],ok] (* Vincenzo Librandi, Aug 21 2012 *)
    lst={}; maxLen=331; Do[If[Reduce[m^2+m*n+n^2==k^2&&m>=n>=0&&GCD[k, m, n]==1, {m, n}, Integers]===False, Null[], AppendTo[lst, k]], {k, maxLen}]; lst (* Frank M Jackson, Jul 04 2013 from A034017 *)
  • PARI
    is(n)=my(f=factor(n)[,1]);for(i=1,#f,if(f[i]%3!=1,return(0)));1 \\ Charles R Greathouse IV, Feb 06 2013
    
  • PARI
    list(lim)=my(v=List([1]), mn, mx, t); forprime(p=7, lim\=1, if(p%6==1, listput(v, p))); if(lim<49, return(Vec(v))); forprime(p=7, sqrtint(lim), if(p%6>1, next); mx=1; while(v[mx+1]*p<=lim, for(i=mn=mx+1, mx=#v, t=p*v[i]; if(t>lim, break); listput(v, t)))); Set(v) \\ Charles R Greathouse IV, Jan 11 2018

Extensions

More terms from James Sellers, Oct 30 2000
Edited by N. J. A. Sloane at the suggestion of Andrew S. Plewe, May 31 2007

A045897 Has both a primitive and imprimitive representation as x^2 + xy + y^2.

Original entry on oeis.org

49, 147, 169, 343, 361, 507, 637, 931, 961, 1029, 1083, 1183, 1369, 1519, 1813, 1849, 1911, 2107, 2197, 2401, 2527, 2793, 2883, 2989, 3211, 3283, 3549, 3577, 3721, 3871, 4107, 4459, 4489, 4557, 4693, 4753, 5047, 5239, 5329, 5341, 5439, 5547, 6223, 6241
Offset: 1

Views

Author

Keywords

Examples

			49 = 7^2 = 5^2 + 5*3 + 3^2.
		

Crossrefs

Intersection of A034017 and A034019.

Programs

  • PARI
    is(n)=my(f=factor(n), t); for(i=1, #f~, if(f[i, 1]%3!=1 && (f[i, 1]!=3 || f[i, 2]>1), return(0)); if(f[i, 1]%3<2 && f[i, 2]>1, t=1); if(f[i, 1]%3==2, if(f[i, 2]%2, return(0), t=1))); t \\ Charles R Greathouse IV, Nov 04 2015

Extensions

Extended by Ray Chandler, Jan 29 2009

A339860 Perimeter of primitive integer-sided triangles whose sides a < b < c form a geometric progression.

Original entry on oeis.org

19, 37, 61, 91, 109, 129, 127, 169, 193, 219, 247, 217, 273, 271, 301, 367, 403, 331, 399, 397, 433, 471, 511, 553, 597, 469, 637, 733, 547, 589, 633, 679, 727, 777, 829, 883, 631, 723, 823, 721, 769, 871, 1039, 1099, 817, 921, 1033, 1153, 1281, 919, 973, 1029, 1087
Offset: 1

Views

Author

Bernard Schott, Jan 08 2021

Keywords

Comments

The triples of sides (a, b, c) with a < b < c are in increasing lexicographic order.
These perimeters are of the form r^2 + r*s + s^2, r < s, gcd(r, s) = 1 and q = r/s (A034017), so they are all odd but not in increasing order. For example, a(6) = 129 for triple (25, 40, 64) while a(7) = 127 for triple (36, 42, 49).
For the corresponding primitive triples and miscellaneous properties, see A339859.

Examples

			a(1) = 19 = 4+6+9 for the smallest such triangle (4, 6, 9) with 4 * 9 = 6^2 and a ratio q = 3/2.
a(2) = 37 = 9+12+16 for the triple (9, 12, 16) with 9 * 16 = 12^2 and a ratio q = 4/3.
		

Crossrefs

Cf. A339856 (triples), A339857 (smallest side), A339858 (middle side), A339859 (largest side), this sequence (perimeter).
Cf. A336754 (similar for sides in arithmetic progression).
Cf. A335897 (similar for angles in arithmetic progression).
Subsequence of A034017.

Programs

  • Maple
    for a from 1 to 300 do
    for b from a+1 to floor((1+sqrt(5))/2 *a) do
    for c from b+1 to floor((1+sqrt(5))/2 *b) do k:=a*c;
    if k=b^2 and igcd(a, b, c)=1 then print(a+b+c); end if;
    end do;
    end do;
    end do;
  • PARI
    lista(nn) = {my(phi = (1+sqrt(5))/2); for (a=1, nn, for (b=a+1, floor(a*phi), for (c=b+1, floor(b*phi), if ((a*c == b^2) && (gcd([a, b, c])==1), print1(a+b+c, ", ")); ); ); ); } \\ Michel Marcus, Jan 08 2021

Formula

a(n) = A339856(n, 1) + A339856(n, 2) + A339856(n, 3).

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

Original entry on oeis.org

0, 1, 3, 4, 7, 9, 12, 13, 16, 19, 21, 25, 27, 28, 31, 36, 37, 39, 43, 48, 52, 57, 61, 63, 64, 67, 73, 75, 76, 79, 81, 84, 91, 93, 97, 100, 103, 108, 109, 111, 112, 117, 121, 124, 127, 129, 133, 139, 144, 148, 151, 156, 157, 163, 171, 172, 175, 181, 183, 189, 192, 193, 196, 199, 201, 208, 211, 217, 219, 223, 225
Offset: 1

Views

Author

Keywords

Comments

a(n) = A198772(n) for n <= 32. - Reinhard Zumkeller, Oct 30 2011

Crossrefs

Symmetric difference of A034017 and A034019.
After the initial 0, differs from A329963 next time at a(63) = 196, term which is not present in the latter.

Programs

  • PARI
    prim(f)=for(i=1, #f~, if(f[i, 1]%3!=1 && (f[i, 1]!=3 || f[i, 2]>1), return(factorback(f)==0))); 1
    imprim(f)=my(t); for(i=1, #f~, if(f[i, 1]%3<2 && f[i, 2]>1, t=1); if(f[i, 1]%3==2, if(f[i, 2]%2, return(0), t=1))); t
    is(n)=my(f=factor(n)); prim(f)+imprim(f)==1 \\ Charles R Greathouse IV, Nov 04 2015

Extensions

Extended by Ray Chandler, Jan 29 2009
Data section further extended up to a(71), to better differentiate from nearby sequences, by Antti Karttunen, Jul 04 2024

A226946 Numbers that can't be written as x^2 + x*y + y^2, with 0 <= x <= y and gcd(x,y) = 1.

Original entry on oeis.org

2, 4, 5, 6, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 20, 22, 23, 24, 25, 26, 27, 28, 29, 30, 32, 33, 34, 35, 36, 38, 40, 41, 42, 44, 45, 46, 47, 48, 50, 51, 52, 53, 54, 55, 56, 58, 59, 60, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 80, 81, 82
Offset: 1

Views

Author

Reinhard Zumkeller, Jun 23 2013

Keywords

Comments

A000086(a(n)) = 0.
Also numbers n with psi(n) congruent to 0 mod 3, where psi is A001615, and also numbers divisible by 9 or by at least one prime of the form 3k-1: A003627. - Enrique Pérez Herrero, Dec 08 2013

Crossrefs

Cf. A034017 (complement).

Programs

  • Haskell
    a226946 n = a226946_list !! (n-1)
    a226946_list = filter ((== 0) . a000086) [1..]
    -- Reinhard Zumkeller, Dec 16 2013, Jun 23 2013
  • Mathematica
    Select[Range[1000],Mod[# * Times@@(1+1/Transpose[FactorInteger[#]][[1]]),3]==0&] (* Enrique Pérez Herrero, Dec 08 2013 *)
    nn = 10; lim = 1 + nn + nn^2; Complement[Range[2, lim], Select[Union[Flatten[Table[If[GCD[x, y] == 1, x^2 + x*y + y^2, 0], {y, nn}, {x, y}]]], # <= lim &]] (* T. D. Noe, Dec 09 2013 *)

Extensions

The original definition was too weak; thanks to T. D. Noe for having corrected this. - Reinhard Zumkeller, Dec 09 2013
Showing 1-10 of 16 results. Next