%I #11 May 11 2017 11:52:53
%S 1,2,2,5,12,2,2,23,5,2,16,9,18,29,2,5,23,16,2,23,5,2,67,9,25,16,2,23,
%T 23,2,2,80,23,2,16,14,9,67,16,5,138,2,16,23,5,16,16,31,9,67,2,5,467,2,
%U 2,23,5,16,67,40,33,16,29,5,23,2,16,302,5,2,16,31,31,67,2,5,80,16,2,23,23,2,436,9,42,67,2,80,23,2,2,23,23,16,277,14,9,436,2,5
%N Compound filter: a(1) = 1, a(n) = P(A112049(n-1), A278223(n)), where P(n,k) is sequence A000027 used as a pairing function.
%C After a(1) = 1, the information combined together to a(n) consists of A046523(2n-1), giving essentially the prime signature of 2n-1, 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-1).
%H Antti Karttunen, <a href="/A286465/b286465.txt">Table of n, a(n) for n = 1..10000</a>
%F a(1) = 1; for n > 1, a(n) = (1/2)*(2 + ((A112049(n-1)+A046523((2*n)-1))^2) - A112049(n-1) - 3*A046523((2*n)-1)).
%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 A286465(n) = if(1==n,n,(1/2)*(2 + ((A112049(n-1)+A046523((2*n)-1))^2) - A112049(n-1) - 3*A046523((2*n)-1)));
%o for(n=1, 10000, write("b286465.txt", n, " ", A286465(n)));
%o (Scheme) (define (A286465 n) (if (= 1 n) n (* (/ 1 2) (+ (expt (+ (A112049 (- n 1)) (A046523 (+ -1 n n))) 2) (- (A112049 (- n 1))) (- (* 3 (A046523 (+ -1 n 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 a278223(n): return a046523(2*n - 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 1 if n==1 else T(a112049(n - 1), a278223(n)) # _Indranil Ghosh_, May 11 2017
%Y Cf. A000027, A046523, A112049, A278223, A286461, A286466.
%K nonn
%O 1,2
%A _Antti Karttunen_, May 10 2017