cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A286152 #16 Feb 16 2025 08:33:44
%S A286152 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 A286152 33,185,129,367,2,1297,2,1097,166,271,131,1735,2,320,205,1105,2,1741,
%U A286152 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 A286152 Compound filter: a(n) = T(A051953(n), A046523(n)), where T(n,k) is sequence A000027 used as a pairing function.
%H A286152 Antti Karttunen, <a href="/A286152/b286152.txt">Table of n, a(n) for n = 1..10000</a>
%H A286152 MathWorld, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A286152 a(n) = (1/2)*(2 + ((A051953(n)+A046523(n))^2) - A051953(n) - 3*A046523(n)).
%t A286152 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 A286152 (PARI)
%o A286152 A051953(n) = (n - eulerphi(n));
%o A286152 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 A286152(n) = (2 + ((A051953(n)+A046523(n))^2) - A051953(n) - 3*A046523(n))/2;
%o A286152 for(n=1, 10000, write("b286152.txt", n, " ", A286152(n)));
%o A286152 (Scheme) (define (A286152 n) (* (/ 1 2) (+ (expt (+ (A051953 n) (A046523 n)) 2) (- (A051953 n)) (- (* 3 (A046523 n))) 2)))
%o A286152 (Python)
%o A286152 from sympy import factorint, totient
%o A286152 def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
%o A286152 def P(n):
%o A286152     f = factorint(n)
%o A286152     return sorted([f[i] for i in f])
%o A286152 def a046523(n):
%o A286152     x=1
%o A286152     while True:
%o A286152         if P(n) == P(x): return x
%o A286152         else: x+=1
%o A286152 def a(n): return T(n - totient(n), a046523(n)) # _Indranil Ghosh_, May 05 2017
%Y A286152 Cf. A000027, A046523, A051953, A285729, A286142, A286143, A286144, A286149, A286154, A286160, A286161, A286162, A286163, A286164.
%K A286152 nonn
%O A286152 1,2
%A A286152 _Antti Karttunen_, May 04 2017