login
The OEIS Foundation is supported by donations from users of the OEIS and by a grant from the Simons Foundation.

 

Logo


Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A341475 2-near-perfect numbers. 1
12, 18, 24, 30, 36, 40, 48, 54, 56, 66, 80, 84, 90, 96, 112, 126, 132, 156, 176, 198, 200, 208, 220, 270, 280, 304, 352, 364, 380, 448, 550, 570, 594, 690, 736, 882, 910, 918, 928, 945, 992, 1026, 1040, 1120, 1216, 1372, 1376, 1488, 1638, 1696, 1722, 1782 (list; graph; refs; listen; history; text; internal format)
OFFSET

1,1

COMMENTS

A number n is k-near-perfect if n is the sum of all but k of the proper divisors of n.  Perfect numbers are 0-near-perfect and sequence A181595 lists the 1-near-perfect numbers.

LINKS

Michael S. Branicky, Table of n, a(n) for n = 1..2000

Paul Pollack and Vladimir Shevelev, On perfect and near-perfect numbers, J. Number Theory 132 (2012), pp. 3037-3046; also on arXiv, arXiv:1011.6160 [math.NT], 2010-2012.

EXAMPLE

48 is 2-near-perfect because its proper divisors are {1, 2, 3, 4, 6, 8, 12, 16, 24} and 48 = 1+2+3+4+6+8+24.

PROG

(Python)

from sympy import divisors

def ok(n):

  proper_divs = divisors(n)[:-1]

  s = sum(proper_divs)

  if s - 3 < n: return False

  if s - sum(proper_divs[-2:]) > n: return False

  for i, c1 in enumerate(proper_divs[:-1]):

    if s - c1 - proper_divs[i+1] < n: return False

    if s - c1 - n in proper_divs[i+1:]: return True

  return False

def aupto(limit): return [m for m in range(1, limit+1) if ok(m)]

print(aupto(1782)) # Michael S. Branicky, Feb 21 2021

CROSSREFS

Cf. A000396, A181595.

Sequence in context: A175837 A136446 A074726 * A091013 A159886 A258914

Adjacent sequences:  A341472 A341473 A341474 * A341476 A341477 A341478

KEYWORD

nonn

AUTHOR

Jeffrey Shallit, Feb 13 2021

STATUS

approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recent
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified May 15 18:26 EDT 2021. Contains 343920 sequences. (Running on oeis4.)