login
Compound filter: a(n) = P(A046523(n), A046523(1+n)), where P(n,k) is sequence A000027 used as a pairing function.
7

%I #13 May 12 2017 16:30:59

%S 2,5,12,14,23,27,38,63,40,27,80,90,23,61,216,152,80,90,80,148,61,27,

%T 302,375,40,84,179,90,467,495,530,698,61,61,826,702,23,61,412,324,467,

%U 495,80,265,148,27,1178,1323,109,148,142,90,302,430,412,430,61,27,1832,1890,23,142,2787,2410,601,495,80,148,601,495,2630,2700,23,142,265,148,601,495,1178

%N Compound filter: a(n) = P(A046523(n), A046523(1+n)), where P(n,k) is sequence A000027 used as a pairing function.

%H Antti Karttunen, <a href="/A286255/b286255.txt">Table of n, a(n) for n = 1..10000</a>

%H MathWorld, <a href="http://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>

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

%o (PARI)

%o 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 A286255(n) = (2 + ((A046523(n)+A046523(1+n))^2) - A046523(n) - 3*A046523(1+n))/2;

%o for(n=1, 10000, write("b286255.txt", n, " ", A286255(n)));

%o (Scheme) (define (A286255 n) (* (/ 1 2) (+ (expt (+ (A046523 n) (A046523 (+ 1 n))) 2) (- (A046523 n)) (- (* 3 (A046523 (+ 1 n)))) 2)))

%o (Python)

%o from sympy import factorint

%o def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2

%o def P(n):

%o f = factorint(n)

%o return sorted([f[i] for i in f])

%o def a046523(n):

%o x=1

%o while True:

%o if P(n) == P(x): return x

%o else: x+=1

%o def a(n): return T(a046523(n), a046523(n + 1)) # _Indranil Ghosh_, May 07 2017

%Y Cf. A000027, A046523, A286240, A286256, A286257, A286258.

%Y Cf. A005383 (after its initial term 3, gives the positions of 23's in this sequence).

%Y Cf. A051950 (one of the matches not matched by A046523 alone).

%K nonn

%O 1,1

%A _Antti Karttunen_, May 07 2017