cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A286466 Compound filter: a(n) = P(A112049(n), A046523(n)), where P(n,k) is sequence A000027 used as a pairing function.

This page as a plain text file.
%I A286466 #12 May 11 2017 11:41:09
%S A286466 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 A286466 38,80,2,436,5,530,16,16,40,706,2,16,23,302,2,436,5,80,67,16,9,1228,7,
%U A286466 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 A286466 Compound filter: a(n) = P(A112049(n), A046523(n)), where P(n,k) is sequence A000027 used as a pairing function.
%C A286466 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 A286466 Antti Karttunen, <a href="/A286466/b286466.txt">Table of n, a(n) for n = 1..10000</a>
%F A286466 a(n) = (1/2)*(2 + ((A112049(n)+A046523(n))^2) - A112049(n) - 3*A046523(n)).
%o A286466 (PARI)
%o A286466 A112049(n) = for(i=1,(2*n),if((kronecker(i,(n+n+1)) < 1),return(primepi(i))));
%o A286466 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 A286466(n) = (1/2)*(2 + ((A112049(n)+A046523(n))^2) - A112049(n) - 3*A046523(n));
%o A286466 for(n=1, 10000, write("b286466.txt", n, " ", A286466(n)));
%o A286466 (Scheme) (define (A286466 n) (* (/ 1 2) (+ (expt (+ (A112049 n) (A046523 n)) 2) (- (A112049 n)) (- (* 3 (A046523 n))) 2)))
%o A286466 (Python)
%o A286466 from sympy import jacobi_symbol as J, factorint, isprime, primepi
%o A286466 def P(n):
%o A286466     f = factorint(n)
%o A286466     return sorted([f[i] for i in f])
%o A286466 def a046523(n):
%o A286466     x=1
%o A286466     while True:
%o A286466         if P(n) == P(x): return x
%o A286466         else: x+=1
%o A286466 def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
%o A286466 def a049084(n): return primepi(n) if isprime(n) else 0
%o A286466 def a112046(n):
%o A286466     i=1
%o A286466     while True:
%o A286466         if J(i, 2*n + 1)!=1: return i
%o A286466         else: i+=1
%o A286466 def a112049(n): return a049084(a112046(n))
%o A286466 def a(n): return T(a112049(n), a046523(n)) # _Indranil Ghosh_, May 11 2017
%Y A286466 Cf. A000027, A046523, A112049, A286258, A286465.
%K A286466 nonn
%O A286466 1,2
%A A286466 _Antti Karttunen_, May 10 2017