login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A378522
Lexicographically earliest infinite sequence such that a(i) = a(j) => A378518(i) = A378518(j), for all i, j >= 1.
1
1, 1, 1, 2, 1, 1, 1, 3, 4, 1, 1, 5, 1, 1, 1, 6, 1, 7, 1, 8, 1, 1, 1, 9, 10, 1, 11, 5, 1, 1, 1, 12, 1, 1, 1, 13, 1, 1, 1, 14, 1, 1, 1, 6, 15, 1, 1, 16, 15, 17, 1, 18, 1, 19, 1, 9, 1, 1, 1, 20, 1, 1, 21, 22, 1, 1, 1, 23, 1, 1, 1, 24, 1, 1, 25, 26, 1, 1, 1, 27, 28, 1, 1, 22, 1, 1, 1, 12, 1, 29, 1, 30, 1, 1, 1, 31, 1, 29, 32, 33, 1, 1, 1, 34, 1
OFFSET
1,4
COMMENTS
Restricted growth sequence transform of A378518.
LINKS
PROG
(PARI)
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; };
A097246(n) = { my(f=factor(n)); prod(i=1, #f~, (nextprime(f[i, 1]+1)^(f[i, 2]\2))*((f[i, 1])^(f[i, 2]%2))); };
A097248(n) = { my(k=A097246(n)); while(k<>n, n = k; k = A097246(k)); k; };
A378518(n) = (n - A097248(n));
v378522 = rgs_transform(vector(up_to, n, A378518(n)));
A378522(n) = v378522[n];
CROSSREFS
Cf. A005117 (positions of 1's), A097248, A378518.
Sequence in context: A261494 A365673 A349574 * A168377 A122867 A124775
KEYWORD
nonn,new
AUTHOR
Antti Karttunen, Nov 30 2024
STATUS
approved