Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #16 May 09 2021 09:51:31
%S 0,2,2,1,2,2,1,1,2,2,1,1,1,2,1,1,2,2,2,1,1,2,1,1,1,2,1,1,1,2,1,1,2,2,
%T 2,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,2,1,1,2,1,1,1,2,1,1,1,2,1,1,2,2,2,1,
%U 1,2,1,1,1,2,1,1,1,2,1,1,1,2,2,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,2,1,1,2,1,1,1,2,1,1,1,2,1,1,1,2,2,1,1,2,1,1,1
%N a(n) = A001222(A285323(n)).
%C The sequence is completely determined by the positions of two least significant 1-bits of n: After initial zero, if n is a power of two (only one 1-bit present) or if prime(1+A285099(n)) > prime(1+A007814(n))^2, a(n) = 2, otherwise a(n) = 1.
%H Antti Karttunen, <a href="/A285110/b285110.txt">Table of n, a(n) for n = 0..8192</a>
%F a(n) = A001222(A285323(n)).
%o (Scheme)
%o (define (A285110 n) (A001222 (A285323 n)))
%o (define (A285110 n) (cond ((zero? n) n) ((or (= 1 (A000120 n)) (> (A000040 (+ 1 (A285099 n))) (A000290 (A000040 (+ 1 (A007814 n)))))) 2) (else 1)))
%o (Python)
%o from operator import mul
%o from sympy import prime, primefactors
%o from functools import reduce
%o def a001222(n): return 0 if n<2 else a001222(n//min(primefactors(n))) + 1
%o def a019565(n): return reduce(mul, (prime(i+1) for i, v in enumerate(bin(n)[:1:-1]) if v == '1')) if n > 0 else 1 # This function from _Chai Wah Wu_
%o def a007947(n): return 1 if n<2 else reduce(mul, primefactors(n))
%o def a065642(n):
%o if n==1: return 1
%o r=a007947(n)
%o n += r
%o while a007947(n)!=r:
%o n+=r
%o return n
%o def a285323(n): return a065642(a065642(a019565(n)))//a019565(n)
%o def a(n): return a001222(a285323(n))
%o print([a(n) for n in range(121)]) # _Indranil Ghosh_, Apr 20 2017
%Y Cf. A000040, A000290, A001222, A007814, A285099, A285323, A285324.
%K nonn
%O 0,2
%A _Antti Karttunen_, Apr 19 2017