OFFSET
1,1
COMMENTS
Up to the first odd perfect number (known to be > 10^300, if it exists), also: positive integers of the form 6k+28m, k>=0, m>=0. Contains all even numbers > 50, since any such number is either of the form 6k or 6k+28 or 6k+28*2. - M. F. Hasler, Feb 09 2012
LINKS
Reinhard Zumkeller, Table of n, a(n) for n = 1..1000
Eric Weisstein's World of Mathematics, Perfect Number
Wikipedia, Perfect number
FORMULA
A204879 = { 2k; k>25 } union { 6k; k>0 } union { 28, 34, 40, 46 }
PROG
(Haskell)
import Data.List (findIndices)
a204879 n = a204879_list !! (n-1)
a204879_list = map (+ 1) $ findIndices (> 0) a097796_list
(PARI) (Contribution from M. F. Hasler, Feb 09 2012) (Start)
/* The following code is valid up to occurrence of the first odd perfect number (if it exists), thus at least up to 10^300 */
is_A204879(n)={ n%2&return; n>50 || n%6==0 || n==28 || n==34 || n==40 || n==46 }
A204879(n)={ if(n>12, n+13, 3*n-if(n>4, n*3\2-6))*2 } \\ (End)
CROSSREFS
KEYWORD
nonn
AUTHOR
Reinhard Zumkeller, Jan 20 2012
STATUS
approved