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.

A286257 Compound filter: a(n) = P(A046523(n), A046523(2n-1)), where P(n,k) is sequence A000027 used as a pairing function.

This page as a plain text file.
%I A286257 #18 Feb 16 2025 08:33:44
%S A286257 1,5,5,14,12,27,5,86,14,27,23,90,12,84,27,152,23,148,5,148,27,27,80,
%T A286257 324,25,61,44,148,23,495,5,935,61,27,61,702,5,142,61,324,138,495,23,
%U A286257 148,90,61,23,1426,14,265,27,90,467,324,27,430,27,61,80,2140,12,61,183,2144,61,495,23,607,27,495,23,2998,23,142,90,90,142,625,5,1426,226,27,467
%N A286257 Compound filter: a(n) = P(A046523(n), A046523(2n-1)), where P(n,k) is sequence A000027 used as a pairing function.
%H A286257 Antti Karttunen, <a href="/A286257/b286257.txt">Table of n, a(n) for n = 1..10000</a>
%H A286257 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A286257 a(n) = (1/2)*(2 + ((A046523(n)+A046523((2*n)-1))^2) - A046523(n) - 3*A046523((2*n)-1)).
%F A286257 a(n) = (1/2)*(2 + ((A046523(n)+A278223(n))^2) - A046523(n) - 3*A278223(n)).
%o A286257 (PARI)
%o A286257 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 A286257 A286257(n) = (1/2)*(2 + ((A046523(n)+A046523((2*n)-1))^2) - A046523(n) - 3*A046523((2*n)-1));
%o A286257 for(n=1, 10000, write("b286257.txt", n, " ", A286257(n)));
%o A286257 (Scheme) (define (A286257 n) (* (/ 1 2) (+ (expt (+ (A046523 n) (A046523 (+ -1 n n))) 2) (- (A046523 n)) (- (* 3 (A046523 (+ -1 n n)))) 2)))
%o A286257 (Python)
%o A286257 from sympy import factorint
%o A286257 def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
%o A286257 def P(n):
%o A286257     f = factorint(n)
%o A286257     return sorted([f[i] for i in f])
%o A286257 def a046523(n):
%o A286257     x=1
%o A286257     while True:
%o A286257         if P(n) == P(x): return x
%o A286257         else: x+=1
%o A286257 def a(n): return T(a046523(n), a046523(2*n - 1)) # _Indranil Ghosh_, May 07 2017
%Y A286257 Cf. A000027, A046523, A278223, A286255, A286256, A286258.
%Y A286257 Cf. A005382 (gives the positions of 5's), A067756 (of 12's), A234098 (of 23's).
%K A286257 nonn
%O A286257 1,2
%A A286257 _Antti Karttunen_, May 07 2017