OFFSET
1,1
COMMENTS
Odd numbers with even abundance: primes and some composites too.
Odd numbers with odd abundance are in A016754. Even numbers with odd abundance are in A088827. Even numbers with even abundance are in A088829.
Or, odd numbers without the squares. - Gerald Hillier, Apr 12 2009
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = 2*n + s - ((s+1) mod 2) where s = round(sqrt(2*n-1)). - Gerald Hillier, Apr 15 2009
a(n) = 2*(n+h) + 1 where h = floor((1/4)*(sqrt(8*n) - 1)) is the largest value such that A014105(h) < n. - John Tyler Rascoe, Jul 05 2022
EXAMPLE
n = p prime, abundance = 1 - p = even and negative;
n = 21, sigma = 1 + 3 + 7 + 21 = 32, abundance = 32 - 42 = -20.
MATHEMATICA
Do[s=DivisorSigma[1, n]-2*n; If[ !OddQ[s]&&OddQ[n], Print[{n, s}]], {n, 1, 1000}]
Select[Range[1, 500, 2], EvenQ[DivisorSigma[1, #] - 2 #] &] (* Vladimir Joseph Stephan Orlovsky, Apr 15 2011 *)
PROG
(Magma) [ n: n in [1..140 by 2] | IsEven(SumOfDivisors(n)-2*n) ]; // Klaus Brockhaus, Apr 15 2009
(PARI) isok(n) = (n>0) && (n % 2) && ! issquare(n); \\ Michel Marcus, Aug 28 2013
(Python)
from itertools import count, islice
from sympy.ntheory.primetest import is_square
def A088828_gen(startvalue=1): # generator of terms >= startvalue
return filter(lambda n:not is_square(n), count(max(startvalue+(startvalue&1^1), 1), 2))
(Python)
from math import isqrt
def A088828(n): return (s:=(m:=isqrt(k:=(n<<1)-1))+(k-m*(m+1)>=1))+k+(s&1) # Chai Wah Wu, Jun 19 2024
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Labos Elemer, Oct 28 2003
EXTENSIONS
Entry revised by N. J. A. Sloane, Jan 31 2014 at the suggestion of Omar E. Pol
STATUS
approved