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.

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

This page as a plain text file.
%I A286160 #19 Feb 16 2025 08:33:44
%S A286160 1,2,5,12,14,23,27,59,42,40,65,109,90,61,86,261,152,142,189,179,148,
%T A286160 115,275,473,273,148,318,265,434,674,495,1097,320,226,430,1093,702,
%U A286160 271,430,757,860,832,945,485,619,373,1127,1969,1032,485,698,619,1430,838,1030,1105,856,556,1769,2791,1890,625,1117,4497,1426,1196,2277,935,1220
%N A286160 Compound filter: a(n) = T(A000010(n), A046523(n)), where T(n,k) is sequence A000027 used as a pairing function.
%H A286160 Antti Karttunen, <a href="/A286160/b286160.txt">Table of n, a(n) for n = 1..10000</a>
%H A286160 MathWorld, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A286160 a(n) = (1/2)*(2 + ((A000010(n)+A046523(n))^2) - A000010(n) - 3*A046523(n)).
%o A286160 (PARI)
%o A286160 A000010(n) = eulerphi(n);
%o A286160 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 A286160 A286160(n) = (2 + ((A000010(n)+A046523(n))^2) - A000010(n) - 3*A046523(n))/2;
%o A286160 for(n=1, 10000, write("b286160.txt", n, " ", A286160(n)));
%o A286160 (Scheme)
%o A286160 (define (A286160 n) (* (/ 1 2) (+ (expt (+ (A000010 n) (A046523 n)) 2) (- (A000010 n)) (- (* 3 (A046523 n))) 2)))
%o A286160 (Python)
%o A286160 from sympy import factorint, totient
%o A286160 def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
%o A286160 def P(n):
%o A286160     f = factorint(n)
%o A286160     return sorted([f[i] for i in f])
%o A286160 def a046523(n):
%o A286160     x=1
%o A286160     while True:
%o A286160         if P(n) == P(x): return x
%o A286160         else: x+=1
%o A286160 def a(n): return T(totient(n), a046523(n)) # _Indranil Ghosh_, May 06 2017
%Y A286160 Cf. A000010, A000027, A046523, A286161, A286162, A286163, A286164.
%Y A286160 Cf. for example A061468 (one of the sequences this matches with).
%K A286160 nonn
%O A286160 1,2
%A A286160 _Antti Karttunen_, May 04 2017