OFFSET
1,4
COMMENTS
Ordinal transform of A305437.
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537
FORMULA
a(2n) = n.
EXAMPLE
Binary representation of 21 is "10101", encoding (0,1)-polynomial x^4 + x^2 + 1 which factorizes over Q as (x^2 - x + 1)(x^2 + x + 1). Factor (x^2 - x + 1) is lexicographically less than factor (x^2 + x + 1) and this is also the first time factor (x^2 - x + 1) occurs as the least one, thus a(21) = 1. Note that although we have the same factor present for n=9, which encodes the polynomial x^3 + 1 = (x + 1)(x^2 - x + 1), it is not the lexicographically least factor in that case.
The next time the same factor occurs as the smallest one is for n=93, which in binary is 1011101, encoding polynomial x^6 + x^4 + x^3 + x^2 + 1 = (x^2 - x + 1)(x^4 + x^3 + x^2 + x + 1). Thus a(93) = 2.
PROG
(PARI)
allocatemem(2^30);
default(parisizemax, 2^31);
up_to = 65537;
ordinal_transform(invec) = { my(om = Map(), outvec = vector(length(invec)), pt); for(i=1, length(invec), if(mapisdefined(om, invec[i]), pt = mapget(om, invec[i]), pt = 0); outvec[i] = (1+pt); mapput(om, invec[i], (1+pt))); outvec; };
pollexcmp(a, b) = { my(ad = poldegree(a), bd = poldegree(b), e); if(ad != bd, return(sign(ad-bd))); for(i=0, ad, e = polcoeff(a, ad-i) - polcoeff(b, ad-i); if(0!=e, return(sign(e)))); (0); };
Aux305438(n) = if(1==n, 0, my(fs = factor(Pol(binary(n)))[, 1]~); vecsort(fs, pollexcmp)[1]);
v305438 = ordinal_transform(vector(up_to, n, Aux305438(n)));
A305438(n) = v305438[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jun 09 2018
STATUS
approved