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!)
A286242 Compound filter: a(n) = P(A278222(n), A278219(n)), where P(n,k) is sequence A000027 used as a pairing function. 4
1, 5, 12, 14, 12, 84, 40, 44, 12, 142, 216, 183, 40, 265, 86, 152, 12, 142, 826, 265, 216, 1860, 607, 489, 40, 832, 607, 1117, 86, 619, 226, 560, 12, 142, 826, 265, 826, 5080, 2497, 619, 216, 2956, 4308, 4155, 607, 8575, 1105, 1533, 40, 832, 2497, 2116, 607, 5731, 4501, 3475, 86, 1402, 1105, 3475, 226, 1759, 698, 2144, 12, 142, 826, 265, 826, 5080, 2497, 619, 826 (list; graph; refs; listen; history; text; internal format)
OFFSET
0,2
LINKS
MathWorld, Pairing Function
FORMULA
a(n) = (1/2)*(2 + ((A278222(n)+A278219(n))^2) - A278222(n) - 3*A278219(n)).
a(n) = (1/2)*(2 + ((A278222(n)+A278222(A003188(n)))^2) - A278222(n) - 3*A278222(A003188(n))).
PROG
(PARI)
A003188(n) = bitxor(n, n>>1);
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
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
A278222(n) = A046523(A005940(1+n));
A286242(n) = (2 + ((A278222(n)+A278219(n))^2) - A278222(n) - 3*A278219(n))/2;
for(n=0, 16383, write("b286242.txt", n, " ", A286242(n)));
(Scheme) (define (A286242 n) (* (/ 1 2) (+ (expt (+ (A278222 n) (A278219 n)) 2) (- (A278222 n)) (- (* 3 (A278219 n))) 2)))
(Python)
from sympy import prime, factorint
import math
def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
def A(n): return n - 2**int(math.floor(math.log(n, 2)))
def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
def a005940(n): return b(n - 1)
def P(n):
f=factorint(n)
return sorted([f[i] for i in f])
def a046523(n):
x=1
while True:
if P(n) == P(x): return x
else: x+=1
def a003188(n): return n^(n>>1)
def a243353(n): return a005940(1 + a003188(n))
def a278219(n): return a046523(a243353(n))
def a278222(n): return a046523(a005940(n + 1))
def a(n): return T(a278222(n), a278219(n)) # Indranil Ghosh, May 07 2017
CROSSREFS
Sequence in context: A367355 A367621 A114073 * A360137 A185871 A037007
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 07 2017
STATUS
approved

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 24 05:36 EDT 2024. Contains 371918 sequences. (Running on oeis4.)