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.

Original entry on oeis.org

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, 38, 80, 2, 436, 5, 530, 16, 16, 40, 706, 2, 16, 23, 302, 2, 436, 5, 80, 67, 16, 9, 1228, 7, 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
Offset: 1

Views

Author

Antti Karttunen, May 10 2017

Keywords

Comments

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).

Crossrefs

Programs

  • PARI
    A112049(n) = for(i=1,(2*n),if((kronecker(i,(n+n+1)) < 1),return(primepi(i))));
    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
    A286466(n) = (1/2)*(2 + ((A112049(n)+A046523(n))^2) - A112049(n) - 3*A046523(n));
    for(n=1, 10000, write("b286466.txt", n, " ", A286466(n)));
    
  • Python
    from sympy import jacobi_symbol as J, factorint, isprime, primepi
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def a049084(n): return primepi(n) if isprime(n) else 0
    def a112046(n):
        i=1
        while True:
            if J(i, 2*n + 1)!=1: return i
            else: i+=1
    def a112049(n): return a049084(a112046(n))
    def a(n): return T(a112049(n), a046523(n)) # Indranil Ghosh, May 11 2017
  • Scheme
    (define (A286466 n) (* (/ 1 2) (+ (expt (+ (A112049 n) (A046523 n)) 2) (- (A112049 n)) (- (* 3 (A046523 n))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A112049(n)+A046523(n))^2) - A112049(n) - 3*A046523(n)).