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.

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

This page as a plain text file.
%I A286164 #13 Feb 16 2025 08:33:44
%S A286164 0,2,5,7,9,16,14,29,12,16,20,67,27,16,23,121,35,67,44,67,23,16,54,277,
%T A286164 18,16,38,67,65,436,77,497,23,16,31,631,90,16,23,277,104,436,119,67,
%U A286164 80,16,135,1129,25,67,23,67,152,277,31,277,23,16,170,1771,189,16,80,2017,31,436,209,67,23,436,230,2557,252,16,80,67,40,436,275,1129,138,16,299
%N A286164 Compound filter: a(n) = T(A055396(n), A046523(n)), where T(n,k) is sequence A000027 used as a pairing function.
%H A286164 Antti Karttunen, <a href="/A286164/b286164.txt">Table of n, a(n) for n = 1..10000</a>
%H A286164 MathWorld, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A286164 a(n) = (1/2)*(2 + ((A055396(n)+A046523(n))^2) - A055396(n) - 3*A046523(n)).
%o A286164 (PARI)
%o A286164 A001511(n) = (1+valuation(n,2));
%o A286164 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 A286164 A055396(n) = if(n==1, 0, primepi(factor(n)[1, 1])); \\ This function from _Charles R Greathouse IV_, Apr 23 2015
%o A286164 A286164(n) = (2 + ((A055396(n)+A046523(n))^2) - A055396(n) - 3*A046523(n))/2;
%o A286164 for(n=1, 10000, write("b286164.txt", n, " ", A286164(n)));
%o A286164 (Scheme) (define (A286164 n) (* (/ 1 2) (+ (expt (+ (A055396 n) (A046523 n)) 2) (- (A055396 n)) (- (* 3 (A046523 n))) 2)))
%o A286164 (Python)
%o A286164 from sympy import primepi, isprime, primefactors, factorint
%o A286164 def a049084(n): return primepi(n)*(1*isprime(n))
%o A286164 def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
%o A286164 def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
%o A286164 def P(n):
%o A286164     f = factorint(n)
%o A286164     return sorted([f[i] for i in f])
%o A286164 def a046523(n):
%o A286164     x=1
%o A286164     while True:
%o A286164         if P(n) == P(x): return x
%o A286164         else: x+=1
%o A286164 def a(n): return T(a055396(n), a046523(n)) # _Indranil Ghosh_, May 05 2017
%Y A286164 Cf. A000027, A046523, A055396, A286160, A286161, A286162, A286163.
%K A286164 nonn
%O A286164 1,2
%A A286164 _Antti Karttunen_, May 04 2017