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

A179887 Nonprimes q such that antiharmonic mean B(q) of the numbers k < q such that gcd(k, q) = 1 is an integer, where B(q) = A053818(q) / A023896(q) = A175505(q) / A175506(q).

Original entry on oeis.org

1, 10, 22, 34, 46, 55, 58, 82, 85, 91, 94, 106, 110, 115, 118, 133, 142, 145, 166, 170, 178, 182, 187, 202, 205, 214, 217, 226, 230, 235, 247, 253, 259, 262, 265, 266, 274, 290, 295, 298, 301, 319, 334, 346, 355, 358, 374, 382, 391, 394, 403, 410, 415, 427
Offset: 1

Views

Author

Jaroslav Krizek, Jul 30 2010, Jul 31 2010

Keywords

Comments

Nonprimes q such that A175506(q) = 1.
Subsequence of A179871.
A179871 is the union of this sequence and A003627.
Corresponding values of B(q) in A179890.

Examples

			a(6) = 55 because B(55) = A053818(55) / A023896(55) = 40700 / 1100 = 37 (integer).
		

Crossrefs

Programs

  • Mathematica
    f[n_] := 2 Plus @@ (Select[ Range@n, GCD[ #, n] == 1 &]^2)/(n*EulerPhi@n); Select[ Range@ 433, ! PrimeQ@# && IntegerQ@ f@# &] (* Robert G. Wilson v, Aug 02 2010 *)
  • PARI
    isok(k) = if(isprime(k), 0, my(f = factor(k)); if(k == 1, 1, denominator(2*k/3 + (1/3) * prod(i = 1, #f~, 1 - f[i, 1])/eulerphi(f)) == 1)); \\ Amiram Eldar, May 26 2025

Extensions

More terms from Robert G. Wilson v, Aug 02 2010

A179890 Values of antiharmonic mean B(q) of the numbers k < q such that gcd(k, q) = 1 is an integer for nonprimes q from A179887, where B(q) = A053818(q) / A023896(q) = A175505(q) / A175506(q).

Original entry on oeis.org

1, 7, 15, 23, 31, 37, 39, 55, 57, 61, 63, 71, 73, 77, 79, 89, 95, 97, 111, 113, 119, 121, 125, 135, 137, 143, 145, 151, 153, 157, 165, 169, 173, 175, 177, 177, 183, 193, 197, 199, 201, 213, 223, 231, 237, 239, 249, 255, 261, 263, 269, 273, 277, 285, 289, 297, 301, 303, 303
Offset: 1

Views

Author

Jaroslav Krizek, Jul 30 2010, Jul 31 2010

Keywords

Examples

			a(6) = 37 because for A179887(6) = 55 holds: B(55) = A053818(55)/A023896(55) = 40700/1100 = 37.
		

Crossrefs

Programs

  • PARI
    list(lim) = print1(1, ", "); for(k = 2, lim, if(!isprime(k), my(f = factor(k), b = 2*k/3 + (1/3) * prod(i = 1, #f~, 1 - f[i, 1])/eulerphi(f)); if(denominator(b) == 1, print1(b, ", ")))); \\ Amiram Eldar, May 26 2025

Extensions

Incorrect formula removed by Amiram Eldar, May 26 2025

A179885 Antiharmonic mean B(h) of numbers k such that gcd(k, h) = 1 for numbers h >= 1 and k < h = A053818(n) / A023896(n) = A175505(h) / A175506(h).

Original entry on oeis.org

6, 7, 65, 66, 69, 70, 77, 78, 129, 130, 185, 186, 194, 195, 210, 211, 221, 222, 237, 238, 254, 255, 309, 310, 321, 322, 330, 331, 365, 366, 398, 399, 417, 418, 437, 438, 462, 463, 473, 474, 482, 483, 497, 498, 533, 534, 546, 547, 554, 555, 570, 571, 573, 574, 581
Offset: 1

Views

Author

Jaroslav Krizek, Jul 30 2010, Jul 31 2010

Keywords

Crossrefs

Formula

a(2*n-1) = A179879(n), a(2*n) = A179880(n) = A179879(n) + 1. - Amiram Eldar, May 26 2025

Extensions

More terms from Amiram Eldar, May 26 2025

A023896 Sum of positive integers in smallest positive reduced residue system modulo n. a(1) = 1 by convention.

Original entry on oeis.org

1, 1, 3, 4, 10, 6, 21, 16, 27, 20, 55, 24, 78, 42, 60, 64, 136, 54, 171, 80, 126, 110, 253, 96, 250, 156, 243, 168, 406, 120, 465, 256, 330, 272, 420, 216, 666, 342, 468, 320, 820, 252, 903, 440, 540, 506, 1081, 384, 1029, 500, 816, 624, 1378, 486, 1100, 672
Offset: 1

Views

Author

Keywords

Comments

Sum of totatives of n, i.e., sum of integers up to n and coprime to n.
a(1) = 1, since 1 is coprime to any positive integer.
Row sums of A038566. - Wolfdieter Lang, May 03 2015
Islam & Manzoor prove that a(n) is an injection for n > 1, see links. In other words, if a(m) = a(n), and min(m, n) > 1, then m = n. - Muhammed Hedayet, May 19 2024

Examples

			G.f. = x + x^2 + 3*x^3 + 4*x^4 + 10*x^5 + 6*x^6 + 21*x^7 + 16*x^8 + 27*x^9 + ...
a(12) = 1 + 5 + 7 + 11 = 24.
n = 40: The smallest positive reduced residue system modulo 40 is {1, 3, 7, 9, 11, 13, 17, 19, 21, 23, 27, 29, 31, 33, 37, 39}. The sum is a(40) = 320. Average is 20.
		

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 48, problem 16, the function phi_1(n).
  • David M. Burton, Elementary Number Theory, p. 171.
  • James J. Tattersall, Elementary Number Theory in Nine Chapters, Cambridge University Press, 2001, p. 163.
  • J. V. Uspensky and M. A. Heaslet, Elementary Number Theory, McGraw-Hill, NY, 1939, p. 111.

Crossrefs

Programs

  • Haskell
    a023896 = sum . a038566_row  -- Reinhard Zumkeller, Mar 04 2012
    
  • Magma
    [1] cat [n*EulerPhi(n)/2: n in [2..70]]; // Vincenzo Librandi, May 16 2015
    
  • Maple
    A023896 := proc(n)
        if n = 1 then
            1;
        else
            n*numtheory[phi](n)/2 ;
        end if;
    end proc: # R. J. Mathar, Sep 26 2013
  • Mathematica
    a[ n_ ] = n/2*EulerPhi[ n ]; a[ 1 ] = 1; Table[a[n], {n, 56}]
    a[ n_] := If[ n < 2, Boole[n == 1], Sum[ k Boole[1 == GCD[n, k]], { k, n}]]; (* Michael Somos, Jul 08 2014 *)
  • PARI
    {a(n) = if(n<2, n>0, n*eulerphi(n)/2)};
    
  • PARI
    A023896(n)=n*eulerphi(n)\/2 \\ about 10% faster. - M. F. Hasler, Feb 01 2021
    
  • Python
    from sympy import totient
    def A023896(n): return 1 if n == 1 else n*totient(n)//2 # Chai Wah Wu, Apr 08 2022
    
  • SageMath
    def A023896(n): return 1 if n == 1 else n*euler_phi(n)//2
    print([A023896(n) for n in range(1, 57)])  # Peter Luschny, Dec 03 2023

Formula

a(n) = n*A023022(n) for n > 2.
a(n) = phi(n^2)/2 = n*phi(n)/2 = A002618(n)/2 if n > 1, a(1)=1. See the Apostol reference for this exercise.
a(n) = Sum_{1 <= k < n, gcd(k, n) = 1} k.
If n = p is a prime, a(p) = T(p-1) where T(k) is the k-th triangular number (A000217). - Robert G. Wilson v, Jul 31 2004
Equals A054521 * [1,2,3,...]. - Gary W. Adamson, May 20 2007
a(n) = A053818(n) * A175506(n) / A175505(n). - Jaroslav Krizek, Aug 01 2010
If m,n > 1 and gcd(m,n) = 1 then a(m*n) = 2*a(m)*a(n). - Thomas Ordowski, Nov 09 2014
G.f.: Sum_{n>=1} mu(n)*n*x^n/(1-x^n)^3, where mu(n) = A008683(n). - Mamuka Jibladze, Apr 24 2015
G.f. A(x) satisfies A(x) = x/(1 - x)^3 - Sum_{k>=2} k * A(x^k). - Ilya Gutkovskiy, Sep 06 2019
For n > 1: a(n) = (n*A076512(n)/2)*A009195(n). - Jamie Morken, Dec 16 2019
Sum_{n>=1} 1/a(n) = 2 * A065484 - 1 = 3.407713... . - Amiram Eldar, Oct 09 2023

Extensions

Typos in programs corrected by Zak Seidov, Aug 03 2010
Name and example edited by Wolfdieter Lang, May 03 2015

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

A053818 a(n) = Sum_{k=1..n, gcd(n,k) = 1} k^2.

Original entry on oeis.org

1, 1, 5, 10, 30, 26, 91, 84, 159, 140, 385, 196, 650, 406, 620, 680, 1496, 654, 2109, 1080, 1806, 1650, 3795, 1544, 4150, 2756, 4365, 3164, 7714, 2360, 9455, 5456, 7370, 6256, 9940, 5196, 16206, 8778, 12324, 8560, 22140, 6972, 25585
Offset: 1

Views

Author

N. J. A. Sloane, Apr 07 2000

Keywords

Comments

Equals row sums of triangle A143612. - Gary W. Adamson, Aug 27 2008
a(n) = A175505(n) * A023896(n) / A175506(n). For number n >= 1 holds B(n) = a(n) / A023896(n) = A175505(n) / A175506(n), where B(n) = antiharmonic mean of numbers k such that GCD(k, n) = 1 for k < n. - Jaroslav Krizek, Aug 01 2010
n does not divide a(n) iff n is a term in A316860, that is, either n is a power of 2 or n is a multiple of 3 and no prime factor of n is congruent to 1 mod 3. - Jianing Song, Jul 16 2018

References

  • Tom M. Apostol, Introduction to Analytic Number Theory, Springer-Verlag, 1976, page 48, problem 15, the function phi_2(n).
  • Louis Comtet, Advanced Combinatorics, Reidel, 1974, p. 199, #2.

Crossrefs

Programs

  • Maple
    A053818 := proc(n)
        local a,k;
        a := 0 ;
        for k from 1 to n do
            if igcd(k,n) = 1 then
                a := a+k^2 ;
            end if;
        end do:
        a ;
    end proc: # R. J. Mathar, Sep 26 2013
  • Mathematica
    a[n_] := Plus @@ (Select[ Range@n, GCD[ #, n] == 1 &]^2); Array[a, 43] (* Robert G. Wilson v, Jul 01 2010 *)
    a[1] = 1; a[n_] := Module[{f = FactorInteger[n], p, e}, p = f[[;; , 1]]; e = f[[;; , 2]]; (n^2/3) * Times @@ ((p - 1)*p^(e - 1)) + (n/6) * Times @@ (1 - p)]; Array[a, 100] (* Amiram Eldar, Dec 03 2023 *)
  • PARI
    a(n) = sum(k=1, n, k^2*(gcd(n,k) == 1)); \\ Michel Marcus, Jan 30 2016
    
  • PARI
    a(n) = {my(f = factor(n)); if(n == 1, 1, (n^2/3) * eulerphi(f) + (n/6) * prod(i = 1, #f~, 1 - f[i, 1]));} \\ Amiram Eldar, Dec 03 2023

Formula

If n = p_1^e_1 * ... *p_r^e_r then a(n) = n^2*phi(n)/3 + (-1)^r*p_1*..._p_r*phi(n)/6.
a(n) = n^2*A000010(n)/3 + n*A023900(n)/6, n>1. [Brown]
a(n) = (A000010(n)/3) * (n^2 + (-1)^A001221(n)*A007947(n)/2) for n>=2. - Jaroslav Krizek, Aug 24 2010
G.f. A(x) satisfies: A(x) = x*(1 + x)/(1 - x)^4 - Sum_{k>=2} k^2 * A(x^k). - Ilya Gutkovskiy, Mar 29 2020
Sum_{k=1..n} a(k) ~ n^4 / (2*Pi^2). - Amiram Eldar, Dec 03 2023

A179871 Numbers h such that antiharmonic mean B(h) of the numbers k < h such that gcd(k, h) = 1 is an integer.

Original entry on oeis.org

1, 2, 5, 10, 11, 17, 22, 23, 29, 34, 41, 46, 47, 53, 55, 58, 59, 71, 82, 83, 85, 89, 91, 94, 101, 106, 107, 110, 113, 115, 118, 131, 133, 137, 142, 145, 149, 166, 167, 170, 173, 178, 179, 182, 187, 191, 197, 202, 205, 214
Offset: 1

Views

Author

Jaroslav Krizek, Jul 30 2010, Jul 31 2010

Keywords

Comments

Numbers h such that B(h) = A053818(h) / A023896(h) = A175505(h) / A175506(h) is an integer.
Numbers h such that A175506(h) = 1.
Complement of A179872.
See A179873 (odd positive integers) for corresponding values A175505(a(n)).
Union of A003627 (primes of form 3n-1) and A179887.

Examples

			a(9) = 29 because B(29) = A053818(29) / A023896(29) = 7714/406 = 19 (integer).
		

Crossrefs

Programs

  • Mathematica
    B[n_] := Plus @@ ((ks = Select[Range[n], GCD[n, #] == 1 &])^2)/Plus @@ ks; Select[Range[215], IntegerQ[B[#]] &] (* Ivan Neretin, May 22 2015 *)
  • PARI
    isok(k) = {my(f = factor(k)); if(k == 1, 1, denominator(2*k/3 + (1/3) * prod(i = 1, #f~, 1 - f[i, 1])/eulerphi(f)) == 1);} \\ Amiram Eldar, May 24 2025

A179882 a(n) is the corresponding value of contraharmonic mean B(h) of numbers k such that gcd(k, h) = 1 (k < h) for numbers h from A179877(n) and A179878(n).

Original entry on oeis.org

1, 7, 15, 31, 39, 55, 71, 111, 119, 151, 175, 177, 231, 239, 255, 303, 311, 313, 319, 329, 335, 337, 345, 375, 391, 393, 479, 521, 559, 575, 591, 593, 601, 607, 623, 655, 657, 679, 777, 785, 791, 823, 855, 863, 871, 879, 889, 905, 911, 929, 937, 959, 961, 991
Offset: 1

Views

Author

Jaroslav Krizek, Jul 30 2010, Jul 31 2010

Keywords

Comments

Subsequence of A179873 and A179874.
It appears that for n >= 3, (4*A005384(n)+1)/3 is a subsequence. - Hilko Koning, Jul 27 2018
This happens for this subsequence of A179877: 10, 22, 46, 58, 82, 106, 166, 178, ... apparently "Semiprimes of form prime - 1" >= 10 (see A077065). - Michel Marcus, Jul 27 2018

Crossrefs

Programs

  • Mathematica
    {1}~Join~Select[Partition[Table[ContraharmonicMean@ Select[Range[n - 1], GCD[#, n] == 1 &], {n, 2, 1500}], 2, 1], And[IntegerQ@ First@ #, SameQ @@ #] &][[All, 1]] (* Michael De Vlieger, Jul 30 2018 *)
  • PARI
    lista(nn) = {vch = vector(nn, k, ch(k)); for (i=1, nn-1, if ((vch[i] == vch[i+1]) && !frac(vch[i]), print1(vch[i], ", ")););} \\ Michel Marcus, Jul 27 2018

Formula

a(n) = A175505(A179877(n)) / A175506(A179877(n)).
a(n) = A175505(A179878(n)) / A175506(A179878(n)).

Extensions

More terms from Michel Marcus, Jul 27 2018

A179891 Composites h such that antiharmonic mean B(h) of the numbers k < h such that gcd(k, h) = 1 is not integer.

Original entry on oeis.org

4, 6, 8, 9, 12, 14, 15, 16, 18, 20, 21, 24, 25, 26, 27, 28, 30, 32, 33, 35, 36, 38, 39, 40, 42, 44, 45, 48, 49, 50, 51, 52, 54, 56, 57, 60, 62, 63, 64, 65, 66, 68, 69, 70, 72, 74, 75, 76, 77, 78, 80, 81, 84, 86, 87, 88, 90, 92, 93, 95, 96, 98, 99, 100, 102, 104, 105, 108, 111
Offset: 1

Views

Author

Jaroslav Krizek, Jul 30 2010

Keywords

Comments

Composites h such that B(h) = A053818(h) / A023896(h) = A175505(h) / A175506(h) is not integer.
Composites h such that A175506(h) > 1.
Subsequence of A179872.
A179872 is the union of this sequence and A007645.

Examples

			a(6) = 14 because B(14) = A053818(14) / A023896(14) = 406/42 = 29/3 (not integer).
		

Crossrefs

Programs

  • Mathematica
    f[n_] := 2 Plus @@ (Select[ Range@n, GCD[ #, n] == 1 &]^2)/(n*EulerPhi@n); Select[ Range@ 111, ! PrimeQ@# && ! IntegerQ@f@# &] (* Robert G. Wilson v, Aug 02 2010 *)
  • PARI
    isok(k) = if(isprime(k), 0, my(f = factor(k)); if(k == 1, 0, denominator(2*k/3 + (1/3) * prod(i = 1, #f~, 1 - f[i, 1])/eulerphi(f)) > 1)); \\ Amiram Eldar, May 25 2025

Extensions

More terms from Robert G. Wilson v, Aug 02 2010

A179875 Numbers h such that h and h+1 have same antiharmonic mean of the numbers k < h such that gcd(k, h) = 1.

Original entry on oeis.org

1, 6, 10, 22, 46, 58, 65, 69, 77, 82, 106, 129, 166, 178, 185, 194, 210, 221, 226, 237, 254, 262, 265, 309, 321, 330, 346, 358, 365, 382, 398, 417, 437, 454, 462, 466, 469, 473, 478, 482, 493, 497, 502
Offset: 1

Views

Author

Jaroslav Krizek, Jul 30 2010, Jul 31 2010

Keywords

Comments

Corresponding values of numbers h+1 see A179876.
Numbers h such that A175505(h) = A175505(h+1).
numbers h such that A175506(h) = A175506(h+1).
Antiharmonic mean B(h) of numbers k such that gcd(k, h) = 1 for numbers h >= 1 and k < h = A053818(n) / A023896(n) = A175505(h) / A175506(h).
Conjecture: also numbers k such that mu(k) = 1 and mu(k+1) = -1, where mu is the Möbius function (tested on the first 10^4 terms). - Amiram Eldar, Mar 06 2021

Examples

			For n=3: a(3) = 10; B(10) = A175505(10) / A175506(10) = 7, B(11) = A175505(11) / A175506(11) = 7.
		

Crossrefs

Showing 1-10 of 18 results. Next