OFFSET
1,2
LINKS
Rémy Sigrist, Table of n, a(n) for n = 1..10000
Rémy Sigrist, PARI program
FORMULA
For all n >= 1, A356867(a(n)) = n.
PROG
(PARI)
up_to = 1+(3^15);
A365390list(up_to) = { my(v=vector(up_to), met=Map(), h=0, ak); for(i=1, #v, if(1==vecsum(digits(i, 3)), v[i] = i; h = i, ak = v[i-h]; forprime(p=2, , if(3!=p && !mapisdefined(met, p*ak), v[i] = p*ak; break))); mapput(met, v[i], i)); my(invs=List([]), x); for(i=1, oo, if(mapisdefined(met, i, &x), listput(invs, x), if(isprime(i)&&i>4, listput(invs, 1+(3^(primepi(i)-2))), return(Vec(invs))))); };
v365390 = A365390list(up_to);
A365390(n) = v365390[n];
for(n=1, #v365390, print1(A365390(n), ", "));
(PARI) See Links section.
CROSSREFS
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 15 2023
STATUS
approved