%I #12 May 11 2017 11:41:09
%S 1,2,5,12,2,16,5,38,7,16,9,94,2,16,23,138,2,67,5,80,16,16,9,355,7,16,
%T 38,80,2,436,5,530,16,16,40,706,2,16,23,302,2,436,5,80,67,16,9,1228,7,
%U 67,23,80,2,277,23,302,16,16,14,2021,2,16,80,2082,16,436,5,80,16,436,9,2704,2,16,80,80,16,436,5,1178,121,16,9,2086,16,16,23,302,2,1771
%N Compound filter: a(n) = P(A112049(n), A046523(n)), where P(n,k) is sequence A000027 used as a pairing function.
%C Here the information combined together to a(n) consists of A046523(n), giving essentially the prime signature of n, and the index of the first prime p >= 1 for which the Jacobi symbol J(p,2n+1) is not +1 (i.e. is either 0 or -1), the value which is returned by A112049(n).
%H Antti Karttunen, <a href="/A286466/b286466.txt">Table of n, a(n) for n = 1..10000</a>
%F a(n) = (1/2)*(2 + ((A112049(n)+A046523(n))^2) - A112049(n) - 3*A046523(n)).
%o (PARI)
%o A112049(n) = for(i=1,(2*n),if((kronecker(i,(n+n+1)) < 1),return(primepi(i))));
%o A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ This function from _Charles R Greathouse IV_, Aug 17 2011
%o A286466(n) = (1/2)*(2 + ((A112049(n)+A046523(n))^2) - A112049(n) - 3*A046523(n));
%o for(n=1, 10000, write("b286466.txt", n, " ", A286466(n)));
%o (Scheme) (define (A286466 n) (* (/ 1 2) (+ (expt (+ (A112049 n) (A046523 n)) 2) (- (A112049 n)) (- (* 3 (A046523 n))) 2)))
%o (Python)
%o from sympy import jacobi_symbol as J, factorint, isprime, primepi
%o def P(n):
%o f = factorint(n)
%o return sorted([f[i] for i in f])
%o def a046523(n):
%o x=1
%o while True:
%o if P(n) == P(x): return x
%o else: x+=1
%o def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
%o def a049084(n): return primepi(n) if isprime(n) else 0
%o def a112046(n):
%o i=1
%o while True:
%o if J(i, 2*n + 1)!=1: return i
%o else: i+=1
%o def a112049(n): return a049084(a112046(n))
%o def a(n): return T(a112049(n), a046523(n)) # _Indranil Ghosh_, May 11 2017
%Y Cf. A000027, A046523, A112049, A286258, A286465.
%K nonn
%O 1,2
%A _Antti Karttunen_, May 10 2017