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-9 of 9 results.

A206369 a(p^k) = p^k - p^(k-1) + p^(k-2) - ... +- 1, and then extend by multiplicativity.

Original entry on oeis.org

1, 1, 2, 3, 4, 2, 6, 5, 7, 4, 10, 6, 12, 6, 8, 11, 16, 7, 18, 12, 12, 10, 22, 10, 21, 12, 20, 18, 28, 8, 30, 21, 20, 16, 24, 21, 36, 18, 24, 20, 40, 12, 42, 30, 28, 22, 46, 22, 43, 21, 32, 36, 52, 20, 40, 30, 36, 28, 58, 24, 60, 30, 42, 43, 48, 20, 66, 48, 44, 24, 70, 35
Offset: 1

Views

Author

N. J. A. Sloane, Feb 06 2012

Keywords

Comments

For more information see the Comments in A061020.
a(n) is the number of integers j such that 1 <= j <= n and gcd(n,j) is a perfect square. For example, a(12) = 6 because |{1,4,5,7,8,11}|=6 and the respective GCDs with 12 are 1,4,1,1,4,1, which are squares. - Geoffrey Critzer, Feb 16 2015
If m is squarefree (A005117), then a(m) = A000010(m) where A000010 is the Euler totient function. - Michel Marcus, Nov 08 2017
Also it appears that the primorials (A002110) is the sequence of indices of minimum records for a(n)/n, and these records are A038110(n)/A060753(n). - Michel Marcus, Nov 09 2017
Also called rho(n). When rho(n) | n, then n is called k-imperfect, with k = n/rho(n), cf. A127724. - M. F. Hasler, Feb 13 2020

References

  • P. J. McCarthy, Introduction to Arithmetical Functions, Springer Verlag, 1986, page 25.

Crossrefs

Cf. A027748 row, A124010, A206475 (first differences).
Cf. A078429.
Cf. A127724 (k-imperfect), A127725 (2-imperfect), A127726 (3-imperfect).

Programs

  • Haskell
    a206369 n = product $
       zipWith h (a027748_row n) (map toInteger $ a124010_row n) where
               h p e = sum $ take (fromInteger e + 1) $
                             iterate ((* p) . negate) (1 - 2 * (e `mod` 2))
    -- Reinhard Zumkeller, Feb 08 2012
    
  • Maple
    a:= n-> mul(add(i[1]^(i[2]-j)*(-1)^j, j=0..i[2]), i=ifactors(n)[2]):
    seq(a(n), n=1..100);  # Alois P. Heinz, Nov 03 2017
  • Mathematica
    Table[Length[Select[Range[n], IntegerQ[GCD[n, #]^(1/2)] &]], {n, 72}] (* Geoffrey Critzer, Feb 16 2015 *)
    a[n_] := n*DivisorSum[n, LiouvilleLambda[#]/#&]; Array[a, 72] (* Jean-François Alcover, Dec 04 2017, after Enrique Pérez Herrero *)
    f[p_,e_] := Sum[(-1)^(e-k)*p^k, {k,0,e}]; a[1] = 1; a[n_] := Times @@ (f @@@ FactorInteger[n]); Array[a, 100] (* Amiram Eldar, Jan 01 2020 *)
  • PARI
    a(n) = sum(k=1, n, issquare(gcd(n, k)));
    
  • PARI
    ak(p,e)=my(s=1); for(i=1,e, s=s*p + (-1)^i); s
    a(n)=my(f=factor(n)); prod(i=1,#f~, ak(f[i,1],f[i,2])) \\ Charles R Greathouse IV, Dec 27 2016
    
  • PARI
    a(n) = sumdiv(n, d, eulerphi(n/d) * issquare(d)); \\ Daniel Suteu, Jun 27 2018
    
  • PARI
    apply( {A206369(n)=vecprod([f[1]^(f[2]+1)\/(f[1]+1)|f<-factor(n)~])}, [1..99]) \\ M. F. Hasler, Feb 13 2020
    
  • Python
    from math import prod
    from sympy import factorint
    def A206369(n): return prod((lambda x:x[0]+int((x[1]<<1)>=p+1))(divmod(p**(e+1),p+1)) for p, e in factorint(n).items()) # Chai Wah Wu, Mar 05 2024

Formula

a(n) = abs(A061020(n)).
a(n) = n*Sum_{d|n} lambda(d)/d, where lambda(n) is A008836(n). - Enrique Pérez Herrero, Sep 23 2012
Dirichlet g.f.: zeta(s - 1)*zeta(2*s)/zeta(s). - Geoffrey Critzer, Feb 25 2015
From Michel Marcus, Nov 05 2017: (Start)
a(2^n) = A001045(n+1);
a(3^n) = A015518(n+1);
a(5^n) = A015531(n+1);
a(7^n) = A015552(n+1);
a(11^n) = A015592(n+1). (End)
a(p^k) = p^k - a(p^(k - 1)) for k > 0 and prime p. - David A. Corneth, Nov 09 2017
a(n) = Sum_{d|n, d is a perfect square} phi(n/d), where phi(k) is the Euler totient function. - Daniel Suteu, Jun 27 2018
a(p^k) = A071324(p^k), for k >= 0 and prime p. - Michel Marcus, Aug 11 2018
Sum_{k=1..n} a(k) ~ Pi^2 * n^2 / 30. - Vaclav Kotesovec, Feb 07 2019
G.f.: Sum_{k>=1} lambda(k)*x^k/(1 - x^k)^2. - Ilya Gutkovskiy, May 23 2019
a(n) = Sum_{i=1..n} A010052(gcd(n,i)). - Ridouane Oudra, Nov 24 2019
a(p^k) = round(p^(k+1)/(p+1)). - M. F. Hasler, Feb 13 2020

A127724 k-imperfect numbers for some k >= 1.

Original entry on oeis.org

1, 2, 6, 12, 40, 120, 126, 252, 880, 2520, 2640, 10880, 30240, 32640, 37800, 37926, 55440, 75852, 685440, 758520, 831600, 2600640, 5533920, 6917400, 9102240, 10281600, 11377800, 16687440, 152182800, 206317440, 250311600, 475917120, 715816960, 866829600
Offset: 1

Views

Author

T. D. Noe, Jan 25 2007

Keywords

Comments

For prime powers p^e, define a multiplicative function rho(p^e) = p^e - p^(e-1) + p^(e-2) - ... + (-1)^e. A number n is called k-imperfect if there is an integer k such that n = k*rho(n). Sequence A061020 gives a signed version of the rho function. As with multiperfect numbers (A007691), 2-imperfect numbers are also called imperfect numbers. As shown by Iannucci, when rho(n) is prime, there is sometimes a technique for generating larger imperfect numbers.
Zhou and Zhu find 5 more terms, which are in the b-file. - T. D. Noe, Mar 31 2009
Does this sequence follow Benford's law? - David A. Corneth, Oct 30 2017
If a term t has a prime factor p from A065508 with exponent 1 and does not have the corresponding prime factor q from A074268, then t*p*q is also a term. - Michel Marcus, Nov 22 2017
For n >= 1, the least n-imperfect numbers are 1, 2, 6, 993803899780063855042560. - Michel Marcus, Feb 13 2018
For any m > 0, if n*p^(2m-1) is k-imperfect, q = rho(p^(2m)) is prime and gcd(pq,n) = 1, then n*p^(2m)*q is also k-imperfect. - M. F. Hasler, Feb 13 2020

Examples

			126 = 2*3^2*7, rho(126) = (2-1)*(9-3+1)*(7-1) = 42.  3*42 = 126, so 126 is 3-imperfect. - _Jud McCranie_ Sep 07 2019
		

References

  • R. K. Guy, Unsolved Problems in Theory of Numbers, Springer, 1994, B1.

Crossrefs

Cf. A127725 (2-imperfect numbers), A127726 (3-imperfect numbers), A127727 (related primes), A309806 (the k values).
Cf. A061020 (signed version of rho function), A206369 (the rho function).

Programs

  • Mathematica
    f[p_,e_]:=Sum[(-1)^(e-k) p^k, {k,0,e}]; rho[n_]:=Times@@(f@@@FactorInteger[n]); Select[Range[10^6], Mod[ #,rho[ # ]]==0&]
  • PARI
    isok(n) = denominator(n/sumdiv(n, d, d*(-1)^bigomega(n/d))) == 1; \\ Michel Marcus, Oct 28 2017
    
  • PARI
    upto(ulim) = {res = List([1]); rhomap = Map(); forprime(p = 2, 3, for(i = 1, logint(ulim, p), mapput(rhomap, p^i, rho(p^i)); iterate(p^i, mapget(rhomap, p^i), ulim))); listsort(res, 1); res}
    iterate(m, rhoo, ulim) = {my(c); if(m / rhoo == m \ rhoo, listput(res, m); my(frho = factor(rhoo)); for(i = 1, #frho~, if(m%frho[i, 1] != 0, for(e = 1, logint(ulim \ m, frho[i, 1]), if(mapisdefined(rhomap, frho[i, 1]^e) == 0, mapput(rhomap, frho[i, 1]^e, rho(frho[i, 1]^e))); iterate(m * frho[i, 1]^e, rhoo * mapget(rhomap, frho[i, 1]^e), ulim)); next(2))))}
    rho(n) = {my(f = factor(n), res = q = 1); for(i=1, #f~, q = 1; for(j = 1, f[i, 2], q = -q + f[i, 1]^j); res * =q); res} \\ David A. Corneth, Nov 02 2017
    
  • PARI
    A127724_vec=concat(1, select( {is_A127724(n)=!(n%A206369(n))}, [1..10^5]*2))
      /* It is known that the least odd term > 1 is > 10^49. This code defines an efficient function is_A127724, but A127724_vec is better computed with upto(.) */
      A127724(n)=A127724_vec[n] \\ Used in other sequences. - M. F. Hasler, Feb 13 2020

Extensions

Small correction in name from Michel Marcus, Feb 13 2018

A127726 Numbers that are 3-imperfect.

Original entry on oeis.org

6, 120, 126, 2520, 2640, 30240, 32640, 37800, 37926, 55440, 685440, 758520, 831600, 2600640, 5533920, 6917400, 9102240, 10281600, 11377800, 16687440, 152182800, 206317440, 250311600, 475917120, 866829600, 1665709920, 1881532800, 2082137400, 2147450880
Offset: 1

Views

Author

T. D. Noe, Jan 25 2007

Keywords

Comments

The new terms come from the paper by Zhou and Zhu. This sequence also contains n = 9223372034707292160 = 2^31*3*5*17*257*65537, which has the product of five Fermat primes (A019434). For this n, n/3 is a 2-imperfect number (A127725). - T. D. Noe, Apr 03 2009
From M. F. Hasler, Feb 13 2020: (Start)
By definition, n is k-imperfect iff n = k*A206369(n).
So a k-imperfect number is always a multiple of k, and up to the first odd 3-imperfect number (larger than 10^49, if it exists, see Zhou & Zhu (2009)), all terms are a multiple of 6. (End)

Examples

			6 = 2*3, so A206369(6) = (2 - 1)(3 - 1) = 2 = 6 / 3, so 6 is a term.
120 = 2^3 * 3 * 5, (8-4+2-1)*(3-1)*(5-1) = 40 = 120 / 3, so 120 is another term.
		

Crossrefs

Cf. A127724 (k-imperfect), A127725 (2-imperfect), A206369 (the rho function).

Programs

  • Mathematica
    okQ[n_] := 3 Sum[d*(-1)^PrimeOmega[n/d], {d, Divisors[n]}] == n;
    For[k = 3, k < 10^6, k = k + 3, If[okQ[k], Print[k]]] (* Jean-François Alcover, Feb 01 2019 *)
  • PARI
    isok(n) = 3*sumdiv(n, d, d*(-1)^bigomega(n/d)) == n; \\ Michel Marcus, Oct 28 2017
    
  • PARI
    select( {is_A127726(n)=A206369(n)*3==n}, [1..10^5]*6) \\ M. F. Hasler, Feb 13 2020

Extensions

Extended by T. D. Noe, Apr 03 2009

A309806 Values of k in k-imperfect numbers.

Original entry on oeis.org

1, 2, 3, 2, 2, 3, 3, 2, 2, 3, 3, 2, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
Offset: 1

Views

Author

Jud McCranie, Aug 17 2019

Keywords

Comments

The value of k in k-imperfect numbers, A127724. Except for the first term, all terms are > 1.
It appears that the first instance of a(n)=4 is for n=98 (993803899780063855042560), while no integer is currently known to be 5-imperfect. - Michel Marcus, Aug 20 2019
A number n is called k-imperfect iff k := n/rho(n) is an integer, where rho = A206369 is a sum-of divisors function with alternating signs. - M. F. Hasler, Feb 14 2020

Examples

			The first 3 terms of A127724 are 1, 2, and 6, that are respectively 1-, 2-, and 3-imperfect. So the first 3 terms of this sequence are 1, 2 and 3.
		

Crossrefs

Cf. A127724, A127725 (2-imperfect), A127726 (3-imperfect), A206369 (rho).

Programs

  • Mathematica
    {1}~Join~Map[If[IntegerQ@ #, #, Nothing] &[#/Times @@ (Sum[(-1)^(#2 - k) #1^k, {k, 0, #2}] & @@@ FactorInteger[#])] &, Range[2, 10^6]] (* Michael De Vlieger, Feb 15 2020 *)
  • PARI
    lista(lim) = {my(v = []); for (i=1, 4, my(vi = solveIMP(1, i, lim)); v = concat (v, vi);); apply(x->x/rhon(x), vecsort(v));} \\ uses the script in links section
    lista(10^24) \\ to get 98 terms; Michel Marcus, Aug 20 2019
    
  • PARI
    A309806(n)=(n=A127724(n))/A206369(n) \\ M. F. Hasler, Feb 14 2020

Formula

a(n) = m/A206369(m) with m = A127724(n). - M. F. Hasler, Feb 14 2020

Extensions

a(45)-a(50) from Giovanni Resta, Aug 19 2019

A307038 Unitary imperfect numbers: numbers n that equal to their unitary analog of the alternating sum of divisors, A307037(n).

Original entry on oeis.org

1, 20, 272, 65792, 2901600, 4596800, 29016000, 4295032832, 5789534400, 49085337600, 585248256000, 960935040000
Offset: 1

Views

Author

Amiram Eldar, Mar 21 2019

Keywords

Comments

Includes all the numbers of the form F(k)*(F(k)-1) with k > 0, where F(k) = 2^(2^k) + 1, the k-th Fermat number, is prime.
a(9) > 5*10^9.
Also in the sequence are 49085337600, 585248256000, 960935040000 and 46127952000000.
a(13) > 2*10^12. - Giovanni Resta, Mar 21 2019

Crossrefs

Cf. A000215, A127724 (k-imperfect), A127725 (2-imperfect), A127726 (3-imperfect), A307037.

Programs

  • Mathematica
    f[p_,e_] := p^e + (-1)^e; a[1] = 1; a[n_] := Times @@ f @@@ FactorInteger[n]; Select[Range[10^6], a[#] == # &]

Extensions

a(9)-a(12) from Giovanni Resta, Mar 21 2019

A206367 (2,3)-imperfect numbers.

Original entry on oeis.org

3, 15, 18, 36, 72, 255, 1152, 2709, 65535, 294912, 4294967295, 4380480000
Offset: 1

Views

Author

N. J. A. Sloane, Feb 06 2012

Keywords

Comments

a(13) > 10^10, if it exists. - Amiram Eldar, Sep 12 2023

Crossrefs

Cf. A127725 (2-imperfect).
Cf. A206369 (beta).

Programs

  • Mathematica
    f[p_, e_] := ((-1)^e + p^(e + 1))/(p + 1); s[n_] := Times @@ f @@@ FactorInteger[n]; s[1] = 1; Select[Range[300000], # == 3 * s[s[#]] &] (* Amiram Eldar, Sep 12 2023 *)
  • PARI
    beta(n) = sumdiv(n, d, d*(-1)^bigomega(n/d));
    isok(k) = 3*beta(beta(k)) == k; \\ Michel Marcus, Sep 11 2023

Extensions

a(7)-a(10) from Michel Marcus, Sep 11 2023
a(11)-a(12) from Amiram Eldar, Sep 12 2023

A328860 Numbers that are 4-imperfect.

Original entry on oeis.org

993803899780063855042560, 2028353759451110328141864960, 6476620014866676143312363520
Offset: 1

Views

Author

Michel Marcus, Feb 16 2020

Keywords

Crossrefs

Cf. A127724 (k-imperfect), A127725 (2-imperfect), A127726 (3-imperfect).
Cf. A309806 (the k values).
Cf. A206369 (the rho function).

Programs

  • PARI
    solveIMP(1, 4, 10^24)

A365470 (2,6)-imperfect numbers.

Original entry on oeis.org

6, 12, 24, 30, 60, 120, 252, 384, 510, 864, 1020, 1260, 1920, 2040, 2640, 5418, 12960, 21420, 21672, 32640, 75852, 98304, 108864, 131070, 262140, 346752, 379260, 491520, 524280, 1982988, 2296728, 5504940, 6447420, 8355840, 8388480, 36747648, 39009600, 57024000
Offset: 1

Views

Author

Michel Marcus, Sep 11 2023

Keywords

Comments

Based on testing the first 38 terms, it seems this is a subsequence of Zumkeller numbers (A083207). - Ivan N. Ianakiev, Sep 12 2023

Crossrefs

Cf. A127725 (2-imperfect), A206367 ((2,3)-imperfect).
Cf. A206369 (beta).
Subsequence of A008588.

Programs

  • Mathematica
    beta[n_]:=Sum[d*LiouvilleLambda[n/d],{d,Divisors[n]}]; Select[Range[5500],#==6*beta[beta[#]]&] (* Ivan N. Ianakiev, Sep 12 2023 *)
  • PARI
    beta(n) = sumdiv(n, d, d*(-1)^bigomega(n/d));
    isok(k) = 6*beta(beta(k)) == k;

A200758 Superimperfect numbers.

Original entry on oeis.org

2, 4, 8, 128, 32768, 2147483648
Offset: 1

Views

Author

Laszlo Toth, Nov 22 2011

Keywords

Comments

A number n is said to be superimperfect if 2*beta(beta(n)) = n, where beta is the multiplicative function defined by beta(p^e) = p^e - p^(e-1) + p^(e-2) - ... + (-1)^e for every prime power p^e. The function beta is called the alternating sum-of-divisors function. Here beta(n) is the absolute value of A061020(n). There are no other superimperfect numbers up to 10^7. The number 2^(2^k-1) is superimperfect if and only if k=1,2,3,4,5.

Crossrefs

Programs

  • PARI
    beta(n)=sumdiv(n,d,(-1)^bigomega(n/d)*d)
    for(n=1,1e8,if(2*beta(beta(n))==n,print1(n", "))) \\ Charles R Greathouse IV, Nov 22 2011
    
  • PARI
    ak(p,e)=my(s=1); for(i=1,e, s=s*p + (-1)^i); s
    beta(n)=my(f=factor(n)); prod(i=1,#f~, ak(f[i,1],f[i,2]))
    is(n)=my(b=beta(n)); 2*b-2 >= n && 2*beta(b)==n \\ Charles R Greathouse IV, Dec 27 2016
Showing 1-9 of 9 results.