editing
approved
editing
approved
nonn,look,changed
approved
editing
proposed
approved
editing
proposed
spi[n_] := Sum[Floor@Log[2, n/3^k] + 1, {k, 0, Floor@Log[3, n]}];
seq[n_] := Module[{a = Table[0, {n}], p = 1, s = 1}, For[i = 1, i <= Length[a], i++, p = Min[2^(1 + Floor@Log[2, p]), 3^(1 + Floor@Log[3, p])]; With[{t = spi[p]}, a[[i]] = t - s - 1; s = t]]; a];
seq[100] (* Jean-François Alcover, Dec 17 2021, after Andrew Howroyd's PARI code *)
approved
editing
Andrew Howroyd, <a href="/A096067/b096067_1.txt">Table of n, a(n) for n = 1..10000</a>
proposed
approved
editing
proposed
Andrew Howroyd, <a href="/A096067/b096067_1.txt">Table of n, a(n) for n = 1..100010000</a>
(PARI) \\ here mkS returns vector of A003586 with values <= limit.
(PARI) \\ here spi(n) is A071521(n).
spi(n)={sum(k=0, logint(n, 3), logint(n\3^k, 2)+1)}
mkSseq(limn)={my(S=[1]); forprime(p=2, 3, Sa=concat(vector(n), p=1, s=1); for(i=1, #a, p=min(2^(1+logint(p, 2)), 3^(1+logint(lim, p, 3))), i, [t | ; my(t<-=spi(p^()); a[i]=t-s-1)*S, ; s=t<=lim]))); Set(S)a} \\ _Andrew Howroyd_, Jan 07 2020
seq(n)={my(S=mkS(2^n), v=vector(n), k=1, p=1); for(i=1, #S, my(t=S[i]); if(isprimepower(t) && k<=#v, v[k]=i-p-1; k++; p=i)); v} \\ Andrew Howroyd, Jan 06 2020
approved
editing
reviewed
approved