OFFSET
1,3
COMMENTS
First define function f(n) = (1/2)*(2 + ((A003557(n) + A173557(n))^2) - A003557(n) - 3*A173557(n)), or in short, f(n) = P(A003557(n), A173557(n)), where P(n,k) is triangular table sequence A000027 used as an injective N x N -> N pairing function. Then apply the restricted growth sequence transform to the sequence f(1), f(2), f(3), ... See the example-section.
This is also the restricted growth sequence transform of sequence A291756, as A291756(n) = P(A003557(n), A000010(n)), where again P(n,k) is sequence A000027 used as a pairing function. Given either an ordered pair (A003557(n),A000010(n)) or (A003557(n),A173557(n)), the other one can be computed because A000010(n) = A003557(n)*A173557(n).
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
Eric Weisstein's World of Mathematics, Pairing Function
Wikipedia, Pairing Function
EXAMPLE
The first ten terms of the sequence f(n) = (1/2)*(2 + ((A003557(n) + A173557(n))^2) - A003557(n) - 3*A173557(n)) are 1, 1, 2, 3, 7, 2, 16, 10, 9, 7. When we assign to each newly occurring term the least unused number k so far (starting by giving k=1 for the initial term, this k increases by one for each new distinct term produced by f(n) when n grows), and for each repeated term the same number it was given the previous time (equal to the number it was given for the first time), we obtain 1, 1, 2, 3, 4, 2, 5, 6, 7, 4, the first 10 terms of this sequence. Note how f(10) = 7 gets 4 because when seven occurred for the first time at f(5), it was the 4th distinct new number in that sequence.
This is also true for the sequence A291756 although there the terms are different: 1, 1, 2, 5, 7, 2, 16, 25, 31, 7.
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])); }
A003557(n) = { my(f=factor(n)); for (i=1, #f~, f[i, 2] = max(0, f[i, 2]-1)); factorback(f); };
A173557(n) = my(f=factor(n)[, 1]); prod(k=1, #f, f[k]-1); \\ This function from Michel Marcus, Oct 31 2017
write_to_bfile(1, rgs_transform(vector(up_to, n, Anotsubmitted7(n))), "b295887.txt");
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Dec 03 2017
STATUS
approved