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

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

A383649 Numbers k such that A206369(k) is prime.

Original entry on oeis.org

3, 4, 6, 8, 9, 16, 18, 49, 64, 81, 98, 162, 169, 338, 625, 729, 1024, 1250, 1458, 4096, 4489, 6241, 8978, 12482, 14641, 19321, 22801, 26569, 29282, 37249, 38642, 45602, 53138, 65536, 74498, 113569, 121801, 143641, 208849, 227138, 243602, 262144, 287282, 292681, 375769, 413449, 417698
Offset: 1

Views

Author

Shreyansh Jaiswal, May 04 2025

Keywords

Comments

The corresponding primes are 2, 3, 2, 5, 7, 11, 7, 43, 43, 61, 43, 61, 157, 157, 521... Sorting and removing duplicates from this sequence of primes appears to give A127727.
All the terms are either prime powers or twice prime powers since A206369 is multiplicative and A206369(n) = 1 only for n = 1 and 2. 3 is the only prime term since A206369(p) = p-1 for a prime p. - Amiram Eldar, May 04 2025

Examples

			3 is a term since A206369(3) = 2, and 2 is a prime.
		

Crossrefs

Programs

  • Mathematica
    seq[max_] := Module[{s = {3, 6}, e}, Do[e = Select[Range[2, Floor[Log[p, max]]], PrimeQ[Sum[(-1)^(# - k)*p^k, {k, 0, #}]] &]; s = Join[s, p^e]; If[p > 2, e = Select[e, # <= Floor[Log[p, max/2]] &]; s = Join[s, 2*p^e]], {p, Prime[Range[Floor[Sqrt[max]]]]}]; Sort[s]]; seq[500000] (* Amiram Eldar, May 04 2025 *)
  • PARI
    isok(k) = ispseudoprime(sumdiv(k, d, eulerphi(k/d) * issquare(d))); \\ Michel Marcus, May 04 2025
  • Python
    from math import prod; from sympy import *
    def ok(n): return isprime(prod((lambda x:x[0]+int((x[1]<<1)>=p+1))(divmod(p**(e+1), p+1)) for p, e in factorint(n).items())) # using code from Chai Wah Wu in A206369
    print([k for k in range(1,10**5) if ok(k)])
    
Showing 1-2 of 2 results.