[go: up one dir, main page]

login
A322974
Lexicographically earliest such sequence a that a(i) = a(j) => f(i) = f(j) for all i, j, where f(1) = 0, f(2) = 1, f(n) = 3 if A009191(n) == 1 and f(n) = A049820(n) for all other numbers > 2.
4
1, 2, 3, 3, 3, 4, 3, 5, 6, 6, 3, 6, 3, 7, 3, 3, 3, 8, 3, 9, 3, 10, 3, 11, 3, 12, 3, 12, 3, 12, 3, 13, 3, 14, 3, 15, 3, 16, 3, 17, 3, 16, 3, 18, 19, 20, 3, 18, 3, 21, 3, 22, 3, 22, 3, 23, 3, 24, 3, 23, 3, 25, 26, 3, 3, 25, 3, 27, 3, 27, 3, 28, 3, 29, 30, 29, 3, 29, 3, 29, 3, 31, 3, 32, 3, 33, 3, 34, 3, 31, 3, 35, 3, 36, 3, 37, 3, 38, 39, 3, 3, 40, 3, 41, 3
OFFSET
1,2
COMMENTS
For all i, j:
A322810(i) = A322810(j) => a(i) = a(j),
a(i) = a(j) => A323073(i) = A323073(j).
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; };
A322974aux(n) = if(n<=2, n-1, my(u=(n-numdiv(n))); if(1==gcd(n, u), 3, u));
v322974 = rgs_transform(vector(up_to, n, A322974aux(n)));
A322974(n) = v322974[n];
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Jan 05 2019
STATUS
approved