A292583 Restricted growth sequence transform of A278222(A292383(n)); a filter related to runs of numbers of the form 4k+3 encountered on trajectories of A005940-tree.
1, 1, 2, 1, 2, 2, 3, 1, 1, 2, 4, 2, 4, 3, 3, 1, 4, 1, 5, 2, 2, 4, 6, 2, 1, 4, 2, 3, 6, 3, 7, 1, 3, 4, 4, 1, 7, 5, 5, 2, 7, 2, 8, 4, 2, 6, 9, 2, 1, 1, 5, 4, 9, 2, 3, 3, 4, 6, 10, 3, 10, 7, 3, 1, 3, 3, 11, 4, 5, 4, 12, 1, 12, 7, 2, 5, 4, 5, 13, 2, 1, 7, 14, 2, 5, 8, 7, 4, 14, 2, 4, 6, 6, 9, 6, 2, 14, 1, 15, 1, 14, 5, 16, 4, 3
Offset: 1
Keywords
Examples
When traversing from the root of binary tree A005940 from the node containing 7, one obtains path 7 -> 5 -> 3 -> 2 -> 1. Of these numbers, 7 and 3 are of the form 4k+3, while others are not, thus there are two separate runs of length 1: [1, 1]. On the other hand, when traversing from 15 as 15 -> 6 -> 3 -> 2 -> 1, again only two terms are of the form 4k+3: 15 and 3 and they are not next to each other, so we have the same two runs of one each: [1, 1], thus a(7) and a(15) are allotted the same value by the restricted growth sequence transform, which in this case is 3. Note that 3 occurs in this sequence for the first time at n=7, with A292383(7) = 5 and A278222(5) = 6 = 2^1 * 3^1, where those run lengths 1 and 1 are the prime exponents of 6.
Links
Crossrefs
Programs
-
PARI
allocatemem(2^30); 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; }; write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); } A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ Modified from code of M. F. Hasler A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ This function from Charles R Greathouse IV, Aug 17 2011 A064989(n) = {my(f); f = factor(n); if((n>1 && f[1,1]==2), f[1,2] = 0); for (i=1, #f~, f[i,1] = precprime(f[i,1]-1)); factorback(f)}; A278222(n) = A046523(A005940(1+n)); A252463(n) = if(!(n%2),n/2,A064989(n)); A292383(n) = if(1==n,0,(if(3==(n%4),1,0)+(2*A292383(A252463(n))))); write_to_bfile(1,rgs_transform(vector(16384,n,A278222(A292383(n)))),"b292583_upto16384.txt");
Comments