OFFSET
1,2
COMMENTS
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..10000
PROG
(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
for(n=1, 10000, write("b286466.txt", n, " ", A286466(n)));
(Scheme) (define (A286466 n) (* (/ 1 2) (+ (expt (+ (A112049 n) (A046523 n)) 2) (- (A112049 n)) (- (* 3 (A046523 n))) 2)))
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 10 2017
STATUS
approved