login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

Compound filter: a(n) = T(A051953(n), A046523(n)), where T(n,k) is sequence A000027 used as a pairing function.
6

%I #15 May 11 2017 10:26:35

%S 0,2,2,12,2,40,2,59,18,61,2,179,2,86,73,261,2,265,2,265,100,148,2,757,

%T 33,185,129,367,2,1297,2,1097,166,271,131,1735,2,320,205,1105,2,1741,

%U 2,619,517,430,2,3113,52,850,295,769,2,1747,205,1517,346,625,2,5297,2,698,730,4497,248,2821,2,1117,460,2821,2,7069,2,941,1070,1315,248,3457,2,4513

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

%H Antti Karttunen, <a href="/A286152/b286152.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 + ((A051953(n)+A046523(n))^2) - A051953(n) - 3*A046523(n)).

%t Table[(2 + (#1 + #2)^2 - #1 - 3 #2)/2 & @@ {n - EulerPhi@ n, Times @@ MapIndexed[Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]] - Boole[n == 1]}, {n, 80}] (* _Michael De Vlieger_, May 04 2017 *)

%o (PARI)

%o A051953(n) = (n - eulerphi(n));

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

%o for(n=1, 10000, write("b286152.txt", n, " ", A286152(n)));

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

%o (Python)

%o from sympy import factorint, totient

%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(n - totient(n), a046523(n)) # _Indranil Ghosh_, May 05 2017

%Y Cf. A000027, A046523, A051953, A285729, A286142, A286143, A286144, A286149, A286154, A286160, A286161, A286162, A286163, A286164.

%K nonn

%O 1,2

%A _Antti Karttunen_, May 04 2017