[go: up one dir, main page]

login
A300243
Filter sequence combining A051953(n) and A009195(n), n-phi(n) (cototient of n) and gcd(n,n-phi(n)).
5
1, 2, 2, 3, 2, 4, 2, 5, 6, 7, 2, 8, 2, 9, 10, 11, 2, 12, 2, 13, 14, 15, 2, 16, 17, 18, 19, 20, 2, 21, 2, 22, 23, 24, 25, 26, 2, 27, 28, 29, 2, 30, 2, 31, 32, 33, 2, 34, 35, 36, 37, 38, 2, 39, 40, 41, 32, 42, 2, 43, 2, 44, 45, 46, 47, 48, 2, 49, 50, 48, 2, 51, 2, 52, 53, 54, 47, 55, 2, 56, 57, 58, 2, 59, 60, 61, 62, 63, 2, 64, 37, 65, 66, 67, 68, 69, 2, 70, 71
OFFSET
1,2
COMMENTS
Restricted growth sequence transform of P(A051953(n), A009195(n)), where P(a,b) is a two-argument form of A000027 used as a Cantor pairing function N x N -> N.
LINKS
EXAMPLE
a(66) = a(70) (= 48) because A051953(66) = A051953(70) = 46 and A009195(66) = A009195(70) = 2.
PROG
(PARI)
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])); }
A009195(n) = gcd(n, eulerphi(n));
A051953(n) = (n - eulerphi(n));
Aux300243(n) = (1/2)*(2 + ((A051953(n)+A009195(n))^2) - A051953(n) - 3*A009195(n));
write_to_bfile(1, rgs_transform(vector(65537, n, Aux300243(n))), "b300243.txt");
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Mar 02 2018
STATUS
approved