login
A295888
Filter combining prime signature of n (A101296) with Dedekind's psi (A001615).
6
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 14, 15, 16, 17, 18, 17, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 41, 42, 43, 44, 45, 46, 42, 47, 48, 49, 42, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 56, 60, 63, 64, 65, 66, 67, 67, 56, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 77
OFFSET
1,2
LINKS
Eric Weisstein's World of Mathematics, Pairing Function
Wikipedia, Pairing Function
FORMULA
Restricted growth sequence transform of function f(n) = (1/2)*(2 + ((A046523(n) + A001615(n))^2) - A046523(n) - 3*A001615(n)), where values A046523(n) and A001615(n) are packed together to a(n) with the 2-argument form of A000027, also known as Cantor pairing-function.
PROG
(PARI)
allocatemem(2^30);
up_to = 65537;
rgs_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(om, invec[i]), my(pp = mapget(om, invec[i])); outvec[i] = outvec[pp] , mapput(om, invec[i], i); outvec[i] = u; u++ )); outvec; };
write_to_bfile(start_offset, vec, bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
A001615(n) = (n * sumdivmult(n, d, issquarefree(d)/d)); \\ This function from Charles R Greathouse IV, Sep 09 2014
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
Anotsubmitted8(n) = (1/2)*(2 + ((A046523(n)+A001615(n))^2) - A046523(n) - 3*A001615(n));
write_to_bfile(1, rgs_transform(vector(up_to, n, Anotsubmitted8(n))), "b295888.txt");
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 03 2017
STATUS
approved