
COMMENTS

This is a highly irregular sequence with high points belonging to hexagonal numbers A000384(n) = n*(2n1) or second hexagonal numbers A014105(n) = n*(2n+1). All other elements of this sequence are equal to 1, n, (n+1) or (2n+1).
Numbers n such that a(n) = 1 are {24, 25, 27, 32, 34, 38, 45, 49, 55, 57, 62, 64, 76, 77, 80, 84, 85, 87, 91, 92, 93, 94, ...}. a(n) = n only iff n is prime such that 2n+1 is composite. Such primes (nonSophie Germain primes) are listed in A053176(n) = {7, 13, 17, 19, 31, 37, 43, 47, 59, 61, 67, 71, 73, 79, 97, ...}. a(n) = n+1 for n = {1, 10, 12, 16, 22, 28, 40, 42, 46, 52, 58, 60, 66, 70, 72, 82, 88, 100, ...}, which coincides with one exception (4) with A109274(n) = {1, 4, 10, 12, 16, 22, 28, 40, 42, 46, 52, 58, 60, ...} Numbers n such that n+1 is prime, 2n+1 composite. a(n) = 2n+1 for n = {8, 9, 14, 15, 20, 21, 26, 33, 35, 39, 44, 48, 50, 51, 54, 56, 63, 65, 68, 69, 74, 75, 81, 86, 90, 95, 98, 99, ...} = A096784(n) Numbers n such that both n and n+1 are composite numbers that sum up to a prime. a(n) = n*(2n+1) for n = {2, 5, 11, 23, 29, 41, 53, 83, 89, 113, 131, 173, 179, 191, ...}, which coincides with one exception (3) with A005384(n) = {2, 3, 5, 11, 23, 29, 41, 53, 83, 89, 113, 131, 173, 179, 191, ...} Sophie Germain primes p: 2p+1 is also prime. a(n) = (n+1)*(2n+1) for n = 6k, where k = {1, 3, 5, 6, 13, 16, 23, 26, 33, 35, 38, 45, 51, 55, 56, 61, 63, 73, 83, 91, 96, 100, ...}.  Alexander Adamchuk, Nov 15 2006
Numbers n such that a(n) = 1 are listed in A123608(n) = {24, 25, 27, 32, 34, 38, 45, 49, 55, 57, 62, 64, 76, 77, 80, 84, 85, 87, 91, 92, 93, 94, ...} Numbers n such that n, n+1 and 2n+1 are composite.  Alexander Adamchuk, Jan 05 2007
