A302536 Inverse permutation to A302350.
1, 9, 3, 75, 7, 2, 18, 1711, 3108, 6, 30, 11931, 49, 17, 4, 53136, 73, 101310, 109, 8, 15, 29, 154
Offset: 1
Crossrefs
Cf. A302350.
This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
Start with [1]; appending 2*[1] results in [1,2]; appending 3*[2,1] results in [1,2, 6,3]; appending 4*[3,6,2,1] results in [1,2,6,3, 12,24,8,4]; appending 5*[4,8,24,12,3,6,2,1] results in [1,2,6,3,12,24,8,4, 20,40,120,60,15,30,10,5]; next append 7*[5,10,30,15,60,120,40,20,4,8,24,12,3,6,2,1], multiplying by 7 since 6 is already found in the previous terms. Each new factor is in A050376: [2,3,4,5,7,9,11,13,16,17,19,23,25,29,...]. Continue in this way to generate all the terms of this sequence.
a = {1}; Do[a = Join[a, Reverse[a]*Min[Complement[Range[Max[a] + 1], a]]], {n, 1, 6}]; a (* Ivan Neretin, May 09 2015 *)
{A050376(n)= local(m, c, k, p); n--; if(n<=0, 2*(n==0), c=0; m=2; while( cA050376(n-1)*Vec(Polrev(A))));A[n]} for(n=0,63,print1(a(n),",")) \\ edited for offsets by Michel Marcus, Apr 04 2019
up_to_e = 13; v050376 = vector(up_to_e); A050376(n) = v050376[n]; ispow2(n) = (n && !bitand(n,n-1)); i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e,break)); A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); }; A003188(n) = bitxor(n, n>>1); A207901(n) = A052330(A003188(n)); \\ Antti Karttunen, Apr 13 2018
up_to_e = 14; v050376 = vector(up_to_e); A050376(n) = v050376[n]; ispow2(n) = (n && !bitand(n,n-1)); i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e,break)); A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); }; A064706(n) = bitxor(n, n>>2); A057300(n) = { my(t=1,s=0); while(n>0, if(1==(n%4),n++,if(2==(n%4),n--)); s += (n%4)*t; n >>= 2; t <<= 2); (s); }; A163356(n) = if(!n,n,my(i = (#binary(n)-1)\2, f = 4^i, d = (n\f)%4, r = (n%f)); (((((2+(i%2))^d)%5)-1)*f) + if(3==d,f-1-A163356(r),A057300(A163356(r)))); A302781(n) = A052330(A064706(A163356(n)));
a(64) = 280 = 2^3 * 5 * 7 = prime(1)^3 * prime(3) * prime(4), which by Heinz-encoding corresponds to integer partition {1+1+1+3+4}. We try to remove all 1's (to get {3+4}, i.e., prime(3)*prime(4) = 35, but that has already been used as a(52)), or to remove either 3 or 4 or both, but also 8, 40 and 56 have already been used, and if we remove all 1's and either 3 or 4, then also prime(3) and prime(4), 5 and 7 have already been used. So we must add one or more copies of 2 (the least missing part) to find a partition that has not already been used. And it turns out we need to add three copies, to get {1+1+1+2+2+2+3+4} to obtain value prime(1)^3 * prime(2)^3 * prime(3) * prime(4) = 7560 not used before, so a(65) = 7560. For the next partition, we remove two 2's and both 3 and 4, to get {1+1+1+2+2} which gives Heinz-code 2^3 * 3^2 = 72, which is the smallest divisor of 7560 that has not been used before in the sequence, thus a(66) = 72.
up_to = 2^14; A053669(n) = forprime(p=2, , if (n % p, return(p))); \\ From A053669 v303751 = vector(up_to); m303752 = Map(); prev=1; for(n=1,up_to,fordiv(prev,d,if(!mapisdefined(m303752,d),v303751[n] = d;mapput(m303752,d,n);break)); if(!v303751[n], p = A053669(prev); while(mapisdefined(m303752,prev), prev *= p); v303751[n] = prev; mapput(m303752,prev,n)); prev = v303751[n]); A303751(n) = v303751[n]; A303752(n) = mapget(m303752,n);
up_to_e = 13; v050376 = vector(up_to_e); A050376(n) = v050376[n]; A209229(n) = (n && !bitand(n,n-1)); A302777(n) = A209229(isprimepower(n)); i = 0; for(n=1,oo,if(A302777(n), i++; v050376[i] = n); if(i == up_to_e,break)); A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); }; A006068(n)= { my(s=1, ns); while(1, ns = n >> s; if(0==ns, break()); n = bitxor(n, ns); s <<= 1; ); return (n); } \\ From A006068 A302783(n) = A052330(A006068(n));
default(parisizemax,2^31); up_to_e = 16; up_to = (1 + 2^up_to_e); v050376 = vector(2+up_to_e); A050376(n) = v050376[n]; ispow2(n) = (n && !bitand(n,n-1)); i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == 2+up_to_e,break)); A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); }; A053669(n) = forprime(p=2, , if (n % p, return(p))); \\ From A053669 v303760 = vector(up_to); m_inverses = Map(); prev=1; for(n=1,up_to,fordiv(prev,d,if(!mapisdefined(m_inverses,d),v303760[n] = d;mapput(m_inverses,d,n);break)); if(!v303760[n], apu = prev; while(mapisdefined(m_inverses,try = prev*A053669(apu)), apu *= A053669(apu)); v303760[n] = try; mapput(m_inverses,try,n)); prev = v303760[n]); A303760(n) = v303760[n+1]; A048675(n) = { my(f = factor(n)); sum(k=1, #f~, f[k, 2]*2^primepi(f[k, 1]))/2; }; A303771(n) = A052330(A048675(A303760(n)));
up_to_e = 16; \\ Good for computing up to n = (2^16)-1 v050376 = vector(up_to_e); ispow2(n) = (n && !bitand(n,n-1)); i = 0; for(n=1,oo,if(ispow2(isprimepower(n)), i++; v050376[i] = n); if(i == up_to_e,break)); A050376(n) = v050376[n]; A052330(n) = { my(p=1,i=1); while(n>0, if(n%2, p *= A050376(i)); i++; n >>= 1); (p); }; A304085(n) = A052330(A304083(n)); \\ Needs also code from A304083
Comments