proposed
approved
proposed
approved
editing
proposed
A332806list(up_to) = { my(v=vector(2), xs=Map(), lista=List([]), p, q, u); v[2] = 3; v[1] = 5; mapput(xs, 1, 1); mapput(xs, 2, 2); mapput(xs, 3, 3); for(n=4, up_to, p = v[2-(n%2)]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[2-(n%2)] = q; mapput(xs, primepi(q), n)); for(i=1, oo, if(!mapisdefined(xs, i, &u), return(Vec(lista)), listput(lista, prime(u)))); };
Antti Karttunen, <a href="/A332808/b332808.txt">Table of n, a(n) for n = 1..26927</a>
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 13, 12, 11, 14, 15, 16, 17, 18, 19, 20, 21, 26, 29, 24, 25, 22, 27, 28, 23, 30, 37, 32, 39, 34, 35, 36, 31, 38, 33, 40, 41, 42, 43, 52, 45, 58, 53, 48, 49, 50, 51, 44, 47, 54, 65, 56, 57, 46, 61, 60, 59, 74, 63, 64, 55, 78, 71, 68, 87, 70, 79, 72, 67, 62, 75, 76, 91, 66, 89, 80, 81, 82, 101
1,12
5, 6, 7, 8, 9, 10, 13, 12, 11, 14, 15, 16, 17, 18, 19, 20, 21, 26, 29, 24, 25, 22, 27, 28, 23, 30, 37, 32, 39, 34, 35, 36, 31, 38, 33, 40, 41, 42, 43, 52, 45, 58, 53, 48, 49, 50, 51, 44, 47, 54, 65, 56, 57, 46, 61, 60, 59, 74, 63, 64, 55, 78, 71, 68, 87, 70, 79, 72, 67, 62, 75
1,1
(PARI)
up_to = 10000;
A332806list(up_to) = { my(v=vector(2), xs=Map(), lista=List([]), p, q); v[2] = 3; v[1] = 5; mapput(xs, 1, 1); mapput(xs, 2, 2); mapput(xs, 3, 3); for(n=4, up_to, p = v[2-(n%2)]; q = nextprime(1+p); while(q%4 != p%4, q=nextprime(1+q)); v[2-(n%2)] = q; mapput(xs, primepi(q), n)); for(i=1, oo, if(!mapisdefined(xs, i, &u), return(Vec(lista)), listput(lista, prime(u)))); };
v332806 = A332806list(up_to);
A332806(n) = v332806[n];
A332808(n) = { my(f=factor(n)); f[, 1] = apply(A332806, apply(primepi, f[, 1])); factorback(f); };
allocated
nonn,mult
Antti Karttunen, Feb 27 2020
approved
editing
allocated for Antti Karttunen
allocated
approved