login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A235726
Lexicographically earliest sequence of positive integers such that a(nm) != a(n + m) for all positive integers n and m such that nm != n + m.
1
1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 4, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 5, 1, 2, 1, 2, 1, 2, 1, 3, 1, 2, 1, 2, 1, 2, 1, 4, 1, 2, 1, 4, 1, 2, 1
OFFSET
1,2
COMMENTS
a(n) != a(n-1) because a(n*1) = a((n-1)+1).
Records appear at: a(1) = 1, a(2) = 2, a(8) = 3, a(16) = 4, a(64) = 5, a(1024) = 6, a(4080) = 7, a(320000) = 8.
From Robert Israel, Apr 19 2017: (Start)
a(n) = 1 iff n is odd.
If n == 2 (mod 4), then a(n) = 2.
(End)
EXAMPLE
For n = 8,
a(8) != 1 because a(1 + 7) != a(1 * 7);
a(8) != 2 because a(2 * 4) != a(2 + 4);
a(8) = 3.
MAPLE
N:= 100: # to get a(1) to a(N)
A[1]:= 1: A[2]:= 2: A[3]:= 1: A[4]:= 2:
for n from 5 to N do
if n::odd then A[n]:= 1
else
A[n]:= min({$2..n} minus {seq(A[q+n/q], q=numtheory:-divisors(n) minus {1, n})});
fi
od:
seq(A[i], i=1..N); # Robert Israel, Apr 19 2017
PROG
(Haskell)
a 1 = 1
a 4 = 2
a n = head $ filter (`notElem` disallowedValues) [1..] where
disallowedValues = map a $ (n-1) : filter (<n) sums where
sums = map divisorSum divisors where
divisors = filter (\d -> n `mod` d == 0) [1..n]
divisorSum d = d + n `div` d
CROSSREFS
Cf. A072670.
Sequence in context: A356206 A318707 A363228 * A060938 A087942 A359237
KEYWORD
nonn
AUTHOR
Peter Kagey, Apr 18 2017
STATUS
approved