login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A286241 Compound filter: a(n) = P(A278219(n), A278219(1+n)), where P(n,k) is sequence A000027 used as a pairing function. 3

%I #18 May 10 2017 17:45:59

%S 2,12,14,12,59,86,27,12,109,363,269,86,142,148,27,12,109,1093,1117,

%T 363,1097,1517,489,86,601,1408,619,148,142,148,27,12,109,1093,1117,

%U 1093,5707,8587,2545,363,1969,6153,4529,1517,4489,4537,489,86,601,3946,3976,1408,2509,5719,2545,148,601,1408,619,148,142,148,27,12,109,1093,1117,1093,5707,8587

%N Compound filter: a(n) = P(A278219(n), A278219(1+n)), where P(n,k) is sequence A000027 used as a pairing function.

%H Antti Karttunen, <a href="/A286241/b286241.txt">Table of n, a(n) for n = 0..16383</a>

%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/PairingFunction.html">Pairing Function</a>

%F a(n) = (1/2)*(2+((A278219(n)+A278219(1+n))^2) - A278219(n) - 3*A278219(1+n)).

%t f[n_, i_, x_] := Which[n == 0, x, EvenQ@ n, f[n/2, i + 1, x], True, f[(n - 1)/2, i, x Prime@ i]]; g[n_] := If[n == 1, 1, Times @@ MapIndexed[ Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]]]; h[n_] := g@ f[BitXor[n, Floor[n/2]], 1, 1]; Map[(2 + (#1 + #2)^2 - #1 - 3 #2)/2 & @@ # & /@ # &, Table[{h[n], h[n + 1]}, {k, 12}, {n, k (k - 1)/2, k (k + 1)/2 - 1}]] // Flatten (* _Michael De Vlieger_, May 09 2017 *)

%o (PARI)

%o A003188(n) = bitxor(n, n>>1);

%o 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 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 A278222(n) = A046523(A005940(1+n));

%o A278219(n) = A278222(A003188(n));

%o A286241(n) = (2 + ((A278219(n)+A278219(1+n))^2) - A278219(n) - 3*A278219(1+n))/2;

%o for(n=0, 16383, write("b286241.txt", n, " ", A286241(n)));

%o (Scheme) (define (A286241 n) (* (/ 1 2) (+ (expt (+ (A278219 n) (A278219 (+ 1 n))) 2) (- (A278219 n)) (- (* 3 (A278219 (+ 1 n)))) 2)))

%o (Python)

%o from sympy import prime, factorint

%o import math

%o def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2

%o def A(n): return n - 2**int(math.floor(math.log(n, 2)))

%o 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 def a005940(n): return b(n - 1)

%o def P(n):

%o f = factorint(n)

%o return sorted([f[i] for i in f])

%o def a046523(n):

%o x=1

%o while True:

%o if P(n) == P(x): return x

%o else: x+=1

%o def a003188(n): return n^int(n/2)

%o def a243353(n): return a005940(1 + a003188(n))

%o def a278219(n): return a046523(a243353(n))

%o def a(n): return T(a278219(n), a278219(n + 1)) # _Indranil Ghosh_, May 07 2017

%Y Cf. A000027, A003188, A005940, A046523, A243353, A278219, A278222, A286240, A286242, A286255.

%K nonn

%O 0,1

%A _Antti Karttunen_, May 07 2017

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 05:18 EDT 2024. Contains 371964 sequences. (Running on oeis4.)