A286257 Compound filter: a(n) = P(A046523(n), A046523(2n-1)), where P(n,k) is sequence A000027 used as a pairing function.
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
Keywords
Links
- Antti Karttunen, Table of n, a(n) for n = 1..10000
- Eric Weisstein's World of Mathematics, Pairing Function
Crossrefs
Programs
-
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)));
-
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
-
Scheme
(define (A286257 n) (* (/ 1 2) (+ (expt (+ (A046523 n) (A046523 (+ -1 n n))) 2) (- (A046523 n)) (- (* 3 (A046523 (+ -1 n n)))) 2)))