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.

A286379 Compound filter ("discard the smallest prime factor" & "signature for 1-runs in base-2"): a(n) = P(A032742(n), A278222(n)), where P(n,k) is sequence A000027 used as a pairing function, with a(1) = 1.

This page as a plain text file.
%I A286379 #12 Feb 16 2025 08:33:45
%S A286379 1,2,7,5,16,18,29,14,31,50,67,42,67,98,195,44,16,100,67,115,637,242,
%T A286379 277,117,125,289,955,224,277,450,497,152,131,248,160,271,436,454,643,
%U A286379 320,436,1246,1771,550,2716,1058,1129,375,160,655,1343,692,1771,1918,3332,623,880,1355,2557,1020,1129,1922,3507,560,166,736,67,775,1349,1070,277,856,436
%N A286379 Compound filter ("discard the smallest prime factor" & "signature for 1-runs in base-2"): a(n) = P(A032742(n), A278222(n)), where P(n,k) is sequence A000027 used as a pairing function, with a(1) = 1.
%H A286379 Antti Karttunen, <a href="/A286379/b286379.txt">Table of n, a(n) for n = 1..16384</a>
%H A286379 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>
%F A286379 a(1) = 1, for n > 1, a(n) = (1/2)*(2 + ((A032742(n)+A278222(n))^2) - A032742(n) - 3*A278222(n)).
%o A286379 (PARI)
%o A286379 A032742(n) = if(1==n,n,n/vecmin(factor(n)[,1]));
%o A286379 A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ Modified from code of _M. F. Hasler_
%o A286379 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 A286379 A278222(n) = A046523(A005940(1+n));
%o A286379 A286379(n) = if(1==n,n,(1/2)*(2 + ((A032742(n)+A278222(n))^2) - A032742(n) - 3*A278222(n)));
%o A286379 for(n=1, 16384, write("b286379.txt", n, " ", A286379(n)));
%o A286379 (Scheme) (define (A286379 n) (if (= 1 n) n (* (/ 1 2) (+ (expt (+ (A032742 n) (A278222 n)) 2) (- (A032742 n)) (- (* 3 (A278222 n))) 2))))
%o A286379 (Python)
%o A286379 from sympy import factorint, divisors
%o A286379 import math
%o A286379 def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
%o A286379 def A(n): return n - 2**int(math.floor(math.log(n, 2)))
%o A286379 def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
%o A286379 def a005940(n): return b(n - 1)
%o A286379 def P(n):
%o A286379     f = factorint(n)
%o A286379     return sorted([f[i] for i in f])
%o A286379 def a046523(n):
%o A286379     x=1
%o A286379     while True:
%o A286379         if P(n) == P(x): return x
%o A286379         else: x+=1
%o A286379 def a278222(n): return a046523(a005940(n + 1))
%o A286379 def a(n): return 1 if n==1 else T(divisors(n)[-2], a278222(n)) # _Indranil Ghosh_, May 13 2017
%Y A286379 Cf. A032742, A278222, A285729.
%K A286379 nonn
%O A286379 1,2
%A A286379 _Antti Karttunen_, May 13 2017