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.

A300242 Filter sequence combining gcd(n,sigma(n)) and gcd(n,phi(n)), (A009194 and A009195).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 1, 4, 5, 6, 1, 7, 1, 6, 8, 9, 1, 10, 1, 11, 5, 6, 1, 12, 13, 6, 14, 15, 1, 3, 1, 16, 8, 6, 1, 17, 1, 6, 5, 18, 1, 19, 1, 7, 20, 6, 1, 21, 22, 23, 8, 11, 1, 24, 13, 25, 5, 6, 1, 26, 1, 6, 14, 27, 1, 3, 1, 11, 8, 6, 1, 28, 1, 6, 13, 7, 1, 19, 1, 29, 30, 6, 1, 31, 1, 6, 8, 32, 1, 33, 34, 7, 5, 6, 35, 36, 1, 37, 20, 38, 1, 3, 1, 39, 20
Offset: 1

Views

Author

Antti Karttunen, Mar 02 2018

Keywords

Comments

Restricted growth sequence transform of P(A009194(n), A009195(n)), where P(a,b) is a two-argument form of A000027 used as a Cantor pairing function N x N -> N.

Examples

			a(15) = a(33) (= 8) because A009194(15) = A009194(33) = 3 and A009195(15) = A009195(33) = 1.
a(20) = a(52) (= 11) because A009194(20) = A009194(52) = 2 and A009195(20) = A009195(52) = 4.
		

Crossrefs

Programs

  • 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])); }
    A009194(n) = gcd(n, sigma(n));
    A009195(n) = gcd(n, eulerphi(n));
    Aux300242(n) = (1/2)*(2 + ((A009194(n)+A009195(n))^2) - A009194(n) - 3*A009195(n));
    write_to_bfile(1,rgs_transform(vector(65537,n,Aux300242(n))),"b300242.txt");