login
A286257
Compound filter: a(n) = P(A046523(n), A046523(2n-1)), where P(n,k) is sequence A000027 used as a pairing function.
5
1, 5, 5, 14, 12, 27, 5, 86, 14, 27, 23, 90, 12, 84, 27, 152, 23, 148, 5, 148, 27, 27, 80, 324, 25, 61, 44, 148, 23, 495, 5, 935, 61, 27, 61, 702, 5, 142, 61, 324, 138, 495, 23, 148, 90, 61, 23, 1426, 14, 265, 27, 90, 467, 324, 27, 430, 27, 61, 80, 2140, 12, 61, 183, 2144, 61, 495, 23, 607, 27, 495, 23, 2998, 23, 142, 90, 90, 142, 625, 5, 1426, 226, 27, 467
OFFSET
1,2
LINKS
Eric Weisstein's World of Mathematics, Pairing Function
FORMULA
a(n) = (1/2)*(2 + ((A046523(n)+A046523((2*n)-1))^2) - A046523(n) - 3*A046523((2*n)-1)).
a(n) = (1/2)*(2 + ((A046523(n)+A278223(n))^2) - A046523(n) - 3*A278223(n)).
PROG
(PARI)
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
A286257(n) = (1/2)*(2 + ((A046523(n)+A046523((2*n)-1))^2) - A046523(n) - 3*A046523((2*n)-1));
for(n=1, 10000, write("b286257.txt", n, " ", A286257(n)));
(Scheme) (define (A286257 n) (* (/ 1 2) (+ (expt (+ (A046523 n) (A046523 (+ -1 n n))) 2) (- (A046523 n)) (- (* 3 (A046523 (+ -1 n n)))) 2)))
(Python)
from sympy import factorint
def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
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 a(n): return T(a046523(n), a046523(2*n - 1)) # Indranil Ghosh, May 07 2017
CROSSREFS
Cf. A005382 (gives the positions of 5's), A067756 (of 12's), A234098 (of 23's).
Sequence in context: A192987 A252768 A062367 * A168418 A266440 A317617
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 07 2017
STATUS
approved