A379004 Lexicographically earliest infinite sequence such that a(i) = a(j) => v_2(i) = v_2(j) and v_5(i) = v_5(j), for all i, j, where v_2 (A007814) and v_5 (A112765) give the 2- and 5-adic valuations of n respectively.
1, 2, 1, 3, 4, 2, 1, 5, 1, 6, 1, 3, 1, 2, 4, 7, 1, 2, 1, 8, 1, 2, 1, 5, 9, 2, 1, 3, 1, 6, 1, 10, 1, 2, 4, 3, 1, 2, 1, 11, 1, 2, 1, 3, 4, 2, 1, 7, 1, 12, 1, 3, 1, 2, 4, 5, 1, 2, 1, 8, 1, 2, 1, 13, 4, 2, 1, 3, 1, 6, 1, 5, 1, 2, 9, 3, 1, 2, 1, 14, 1, 2, 1, 3, 4, 2, 1, 5, 1, 6, 1, 3, 1, 2, 4, 10, 1, 2, 1, 15, 1, 2, 1, 5, 4
Offset: 1
Links
- Antti Karttunen, Table of n, a(n) for n = 1..100000
Programs
-
PARI
up_to = 100000; 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; }; v379004 = rgs_transform(vector(up_to, n, [valuation(n,2), valuation(n,5)])); A379004(n) = v379004[n];
Comments