[go: up one dir, main page]

login
Search: a286603 -id:a286603
     Sort: relevance | references | number | modified | created      Format: long | short | data
n has the a(n)-th distinct prime signature.
+10
109
1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 6, 2, 4, 4, 7, 2, 6, 2, 6, 4, 4, 2, 8, 3, 4, 5, 6, 2, 9, 2, 10, 4, 4, 4, 11, 2, 4, 4, 8, 2, 9, 2, 6, 6, 4, 2, 12, 3, 6, 4, 6, 2, 8, 4, 8, 4, 4, 2, 13, 2, 4, 6, 14, 4, 9, 2, 6, 4, 9, 2, 15, 2, 4, 6, 6, 4, 9, 2, 12, 7, 4, 2, 13, 4, 4, 4, 8, 2, 13, 4, 6, 4, 4, 4, 16, 2, 6, 6, 11, 2, 9, 2, 8, 9, 4, 2, 15, 2, 9, 4, 12, 2, 9, 4, 6, 6, 4, 4, 17
OFFSET
1,2
COMMENTS
From Antti Karttunen, May 12 2017: (Start)
Restricted growth sequence transform of A046523, the least representative of each prime signature. Thus this partitions the natural numbers to the same equivalence classes as A046523, i.e., for all i, j: a(i) = a(j) <=> A046523(i) = A046523(j), and for that reason satisfies in that respect all the same conditions as A046523. For example, we have, for all i, j: if a(i) = a(j), then:
A000005(i) = A000005(j), A008683(i) = A008683(j), A286605(i) = A286605(j).
So, this sequence (instead of A046523) can be used for finding sequences where a(n)'s value is dependent only on the prime signature of n, that is, only on the multiset of prime exponents in the factorization of n. (End)
This is also the restricted growth sequence transform of many other sequences, for example, that of A181819. See further comments there. - Antti Karttunen, Apr 30 2022
LINKS
Michel Marcus (terms 1..10000) & Antti Karttunen, Table of n, a(n) for n = 1..100000
FORMULA
A025487(a(n)) = A046523(n).
Indices of records give A025487. - Michel Marcus, Nov 16 2015
From David A. Corneth, May 12 2017: (Start) [Corresponding characteristic function in brackets]
a(A000012(n)) = 1 (sig.: ()). [A063524]
a(A000040(n)) = 2 (sig.: (1)). [A010051]
a(A001248(n)) = 3 (sig.: (2)). [A302048]
a(A006881(n)) = 4 (sig.: (1,1)). [A280710]
a(A030078(n)) = 5 (sig.: (3)).
a(A054753(n)) = 6 (sig.: (1,2)). [A353472]
a(A030514(n)) = 7 (sig.: (4)).
a(A065036(n)) = 8 (sig.: (1,3)).
a(A007304(n)) = 9 (sig.: (1,1,1)). [A354926]
a(A050997(n)) = 10 (sig.: (5)).
a(A085986(n)) = 11 (sig.: (2,2)).
a(A178739(n)) = 12 (sig.: (1,4)).
a(A085987(n)) = 13 (sig.: (1,1,2)).
a(A030516(n)) = 14 (sig.: (6)).
a(A143610(n)) = 15 (sig.: (2,3)).
a(A178740(n)) = 16 (sig.: (1,5)).
a(A189975(n)) = 17 (sig.: (1,1,3)).
a(A092759(n)) = 18 (sig.: (7)).
a(A189988(n)) = 19 (sig.: (2,4)).
a(A179643(n)) = 20 (sig.: (1,2,2)).
a(A189987(n)) = 21 (sig.: (1,6)).
a(A046386(n)) = 22 (sig.: (1,1,1,1)).
a(A162142(n)) = 23 (sig.: (2,2,2)).
a(A179644(n)) = 24 (sig.: (1,1,4)).
a(A179645(n)) = 25 (sig.: (8)).
a(A179646(n)) = 26 (sig.: (2,5)).
a(A163569(n)) = 27 (sig.: (1,2,3)).
a(A179664(n)) = 28 (sig.: (1,7)).
a(A189982(n)) = 29 (sig.: (1,1,1,2)).
a(A179666(n)) = 30 (sig.: (3,4)).
a(A179667(n)) = 31 (sig.: (1,1,5)).
a(A179665(n)) = 32 (sig.: (9)).
a(A189990(n)) = 33 (sig.: (2,6)).
a(A179669(n)) = 34 (sig.: (1,2,4)).
a(A179668(n)) = 35 (sig.: (1,8)).
a(A179670(n)) = 36 (sig.: (1,1,1,3)).
a(A179671(n)) = 37 (sig.: (3,5)).
a(A162143(n)) = 38 (sig.: (2,2,2)).
a(A179672(n)) = 39 (sig.: (1,1,6)).
a(A030629(n)) = 40 (sig.: (10)).
a(A179688(n)) = 41 (sig.: (1,3,3)).
a(A179689(n)) = 42 (sig.: (2,7)).
a(A179690(n)) = 43 (sig.: (1,1,2,2)).
a(A189991(n)) = 44 (sig.: (4,4)).
a(A179691(n)) = 45 (sig.: (1,2,5)).
a(A179692(n)) = 46 (sig.: (1,9)).
a(A179693(n)) = 47 (sig.: (1,1,1,4)).
a(A179694(n)) = 48 (sig.: (3,6)).
a(A179695(n)) = 49 (sig.: (2,2,3)).
a(A179696(n)) = 50 (sig.: (1,1,7)).
(End)
EXAMPLE
From David A. Corneth, May 12 2017: (Start)
1 has prime signature (), the first distinct prime signature. Therefore, a(1) = 1.
2 has prime signature (1), the second distinct prime signature after (1). Therefore, a(2) = 2.
3 has prime signature (1), as does 2. Therefore, a(3) = a(2) = 2.
4 has prime signature (2), the third distinct prime signature after () and (1). Therefore, a(4) = 3. (End)
From Antti Karttunen, May 12 2017: (Start)
Construction of restricted growth sequences: In this case we start with a(1) = 1 for A046523(1) = 1, and thereafter, for all n > 1, we use the least so far unused natural number k for a(n) if A046523(n) has not been encountered before, otherwise [whenever A046523(n) = A046523(m), for some m < n], we set a(n) = a(m).
For n = 2, A046523(2) = 2, which has not been encountered before (first prime), thus we allot for a(2) the least so far unused number, which is 2, thus a(2) = 2.
For n = 3, A046523(2) = 2, which was already encountered as A046523(1), thus we set a(3) = a(2) = 2.
For n = 4, A046523(4) = 4, not encountered before (first square of prime), thus we allot for a(4) the least so far unused number, which is 3, thus a(4) = 3.
For n = 5, A046523(5) = 2, as for the first time encountered at n = 2, thus we set a(5) = a(2) = 2.
For n = 6, A046523(6) = 6, not encountered before (first semiprime pq with distinct p and q), thus we allot for a(6) the least so far unused number, which is 4, thus a(6) = 4.
For n = 8, A046523(8) = 8, not encountered before (first cube of a prime), thus we allot for a(8) the least so far unused number, which is 5, thus a(8) = 5.
For n = 9, A046523(9) = 4, as for the first time encountered at n = 4, thus a(9) = 3.
(End)
From David A. Corneth, May 12 2017: (Start)
(Rough) description of an algorithm of computing the sequence:
Suppose we want to compute a(n) for n in [1..20].
We set up a vector of 20 elements, values 0, and a number m = 1, the minimum number we haven't checked and c = 0, the number of distinct prime signatures we've found so far.
[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
We check the prime signature of m and see that it's (). We increase c with 1 and set all elements up to 20 with prime signature () to 1. In the process, we adjust m. This gives:
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]. The least number we haven't checked is m = 2. 2 has prime signature (1). We increase c with 1 and set all elements up to 20 with prime signature (1) to 2. In the process, we adjust m. This gives:
[1, 2, 2, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0]
We check the prime signature of m = 4 and see that its prime signature is (2). We increase c with 1 and set all numbers up to 20 with prime signature (2) to 3. This gives:
[1, 2, 2, 3, 2, 0, 2, 0, 3, 0, 2, 0, 2, 0, 0, 0, 2, 0, 2, 0]
Similarily, after m = 6, we get
[1, 2, 2, 3, 2, 4, 2, 0, 3, 4, 2, 0, 2, 4, 4, 0, 2, 0, 2, 0], after m = 8 we get:
[1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 0, 2, 4, 4, 0, 2, 0, 2, 0], after m = 12 we get:
[1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 6, 2, 4, 4, 0, 2, 6, 2, 0], after m = 16 we get:
[1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 6, 2, 4, 4, 7, 2, 6, 2, 0], after m = 20 we get:
[1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 6, 2, 4, 4, 7, 2, 6, 2, 8]. Now, m > 20 so we stop. (End)
The above method is inefficient, because the step "set all elements a(n) up to n = Nmax with prime signature s(n) = S[c] to c" requires factoring all integers up to Nmax (or at least comparing their signature, once computed, with S[c]) again and again. It is much more efficient to run only once over each m = 1..Nmax, compute its prime signature s(m), add it to an ordered list in case it did not occur earlier, together with its "rank" (= new size of the list), and assign that rank to a(m). The list of prime signatures is much shorter than [1..Nmax]. One can also use m'(m) := the smallest n with the prime signature of m (which is faster to compute than to search for the signature) as representative for s(m), and set a(m) := a(m'(m)). Then it is sufficient to have just one counter (number of prime signatures seen so far) as auxiliary variable, in addition to the sequence to be computed. - M. F. Hasler, Jul 18 2019
MAPLE
A101296 := proc(n)
local a046523, a;
a046523 := A046523(n) ;
for a from 1 do
if A025487(a) = a046523 then
return a;
elif A025487(a) > a046523 then
return -1 ;
end if;
end do:
end proc: # R. J. Mathar, May 26 2017
MATHEMATICA
With[{nn = 120}, Function[s, Table[Position[Keys@s, k_ /; MemberQ[k, n]][[1, 1]], {n, nn}]]@ Map[#1 -> #2 & @@ # &, Transpose@ {Values@ #, Keys@ #}] &@ PositionIndex@ Table[Times @@ MapIndexed[Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]] - Boole[n == 1], {n, nn}] ] (* Michael De Vlieger, May 12 2017, Version 10 *)
PROG
(PARI) find(ps, vps) = {for (k=1, #vps, if (vps[k] == ps, return(k)); ); }
lisps(nn) = {vps = []; for (n=1, nn, ps = vecsort(factor(n)[, 2]); ips = find(ps, vps); if (! ips, vps = concat(vps, ps); ips = #vps); print1(ips, ", "); ); } \\ Michel Marcus, Nov 15 2015; edited by M. F. Hasler, Jul 16 2019
(PARI)
rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences, invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences, 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])); }
write_to_bfile(1, rgs_transform(vector(100000, n, A046523(n))), "b101296.txt");
\\ Antti Karttunen, May 12 2017
CROSSREFS
Cf. A025487, A046523, A064839 (ordinal transform of this sequence), A181819, and arrays A095904, A179216.
Sequences that are unions of finite number (>= 2) of equivalence classes determined by the values that this sequence obtains (i.e., sequences mentioned in David A. Corneth's May 12 2017 formula): A001358 (A001248 U A006881, values 3 & 4), A007422 (values 1, 4, 5), A007964 (2, 3, 4, 5), A014612 (5, 6, 9), A030513 (4, 5), A037143 (1, 2, 3, 4), A037144 (1, 2, 3, 4, 5, 6, 9), A080258 (6, 7), A084116 (2, 4, 5), A167171 (2, 4), A217856 (6, 9).
Cf. also A077462, A305897 (stricter variants, with finer partitioning) and A254524, A286603, A286605, A286610, A286619, A286621, A286622, A286626, A286378 for other similarly constructed sequences.
KEYWORD
easy,nonn
AUTHOR
David Wasserman, Dec 21 2004
EXTENSIONS
Data section extended to 120 terms by Antti Karttunen, May 12 2017
Minor edits/corrections by M. F. Hasler, Jul 18 2019
STATUS
approved
Restricted growth sequence computed for filter-sequence A278222, related to 1-runs in the binary representation of n.
+10
62
1, 2, 2, 3, 2, 4, 3, 5, 2, 4, 4, 6, 3, 6, 5, 7, 2, 4, 4, 6, 4, 8, 6, 9, 3, 6, 6, 10, 5, 9, 7, 11, 2, 4, 4, 6, 4, 8, 6, 9, 4, 8, 8, 12, 6, 12, 9, 13, 3, 6, 6, 10, 6, 12, 10, 14, 5, 9, 9, 14, 7, 13, 11, 15, 2, 4, 4, 6, 4, 8, 6, 9, 4, 8, 8, 12, 6, 12, 9, 13, 4, 8, 8, 12, 8, 16, 12, 17, 6, 12, 12, 18, 9, 17, 13, 19, 3, 6, 6, 10, 6, 12, 10, 14, 6, 12, 12, 18, 10, 18
OFFSET
0,2
COMMENTS
When filtering sequences (by equivalence class partitioning), this sequence can be used instead of A278222, because for all i, j it holds that: a(i) = a(j) <=> A278222(i) = A278222(j).
For example, for all i, j: a(i) = a(j) => A000120(i) = A000120(j), and for all i, j: a(i) = a(j) => A001316(i) = A001316(j).
The sequence allots a distinct value for each distinct multiset formed from the lengths of 1-runs in the binary representation of n. See the examples. - Antti Karttunen, Jun 04 2017
EXAMPLE
For n = 0, there are no 1-runs, thus the multiset is empty [], and it is allotted the number 1, thus a(0) = 1.
For n = 1, in binary also "1", there is one 1-run of length 1, thus the multiset is [1], which has not been encountered before, and a new number is allotted for that, thus a(1) = 2.
For n = 2, in binary "10", there is one 1-run of length 1, thus the multiset is [1], which was already encountered at n=1, thus a(2) = a(1) = 2.
For n = 3, in binary "11", there is one 1-run of length 2, thus the multiset is [2], which has not been encountered before, and a new number is allotted for that, thus a(3) = 3.
For n = 4, in binary "100", there is one 1-run of length 1, thus the multiset is [1], which was already encountered at n=1 for the first time, thus a(4) = a(1) = 2.
For n = 5, in binary "101", there are two 1-runs, both of length 1, thus the multiset is [1,1], which has not been encountered before, and a new number is allotted for that, thus a(5) = 4.
PROG
(PARI)
rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences, invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences, 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
A278222(n) = A046523(A005940(1+n));
v286622 = rgs_transform(vector(1+65537, n, A278222(n-1)));
A286622(n) = v286622[1+n];
CROSSREFS
Cf. A286552 (ordinal transform).
Cf. also A101296, A286581, A286589, A286597, A286599, A286600, A286602, A286603, A286605, A286610, A286619, A286621, A286626, A286378, A304101 for similarly constructed or related sequences.
Cf. also A305793, A305795.
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, May 11 2017
EXTENSIONS
Example section added by Antti Karttunen, Jun 04 2017
STATUS
approved
Restricted growth sequence computed for filter-sequence A278221, related to the conjugated prime factorization (see A122111).
+10
29
1, 2, 3, 2, 4, 5, 6, 2, 3, 7, 8, 5, 9, 10, 7, 2, 11, 5, 12, 7, 13, 14, 15, 5, 4, 16, 3, 10, 17, 18, 19, 2, 20, 21, 10, 5, 22, 23, 24, 7, 25, 26, 27, 14, 7, 28, 29, 5, 6, 7, 30, 16, 31, 5, 20, 10, 32, 33, 34, 18, 35, 36, 13, 2, 37, 38, 39, 21, 40, 26, 41, 5, 42, 43, 7, 23, 14, 44, 45, 7, 3, 46, 47, 26, 48, 49, 50, 14, 51, 18, 24, 28, 52, 53, 54, 5, 55, 10, 20, 7
OFFSET
1,2
COMMENTS
When filtering sequences (by equivalence class partitioning), this sequence (with its modestly sized terms) can be used instead of A278221 (which has some huge terms), because for all i, j it holds that: a(i) = a(j) <=> A278221(i) = A278221(j).
For example, for all i, j: a(i) = a(j) => A006530(i) = A006530(j).
LINKS
FORMULA
Construction: we start with a(1)=1 for A278221(1)=1, and then after, for all n > 1, we use the least so far unused natural number k for a(n) if A278221(n) has not been encountered before, otherwise [whenever A278221(n) = A278221(m), for some m < n], we set a(n) = a(m).
EXAMPLE
For n=2, A278221(2) = 2, which has not been encountered before, thus we allot for a(2) the least so far unused number, which is 2, thus a(2) = 2.
For n=3, A278221(3) = 4, which has not been encountered before, thus we allot for a(3) the least so far unused number, which is 3, thus a(3) = 3.
For n=4, A278221(4) = 2, which was already encountered as A278221(2), thus we set a(4) = a(2) = 2.
For n=9, A278221(9) = 4, which was already encountered at n=3, thus a(9) = 3.
For n=13, A278221(13) = 64, which has not been encountered before, thus we allot for a(13) the least so far unused number, which is 9, thus a(13) = 9.
For n=194, A278221(194) = 50331648, which has not been encountered before, thus we allot for a(194) the least so far unused number, which is 106, thus a(194) = 106.
For n=388, A278221(388) = 50331648, which was already encountered at n=194, thus a(388) = a(194) = 106.
PROG
(PARI)
rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences, invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences, 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])); }
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)};
A122111(n) = if(1==n, n, prime(bigomega(n))*A122111(A064989(n)));
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
write_to_bfile(1, rgs_transform(vector(10000, n, A278221(n))), "b286621.txt");
CROSSREFS
Cf. also A101296, A286603, A286605, A286610, A286619, A286622, A286626, A286378 for similarly constructed sequences.
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 11 2017
STATUS
approved
Lexicographically earliest such sequence a that a(i) = a(j) => A003557(i) = A003557(j) and A048250(i) = A048250(j), for all i, j.
+10
21
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 6, 11, 12, 13, 13, 14, 10, 15, 16, 17, 18, 19, 13, 20, 21, 22, 23, 24, 25, 26, 18, 27, 28, 29, 28, 30, 31, 32, 33, 34, 22, 35, 36, 37, 38, 26, 28, 39, 40, 41, 26, 42, 29, 43, 26, 44, 45, 46, 32, 47, 48, 35, 49, 50, 51, 52, 53, 54, 35, 52, 26, 55, 56, 57, 58, 59, 35, 60, 45, 61, 62, 63, 51, 64, 65, 66, 67, 68, 46, 69, 70, 47, 71
OFFSET
1,2
COMMENTS
Restricted growth sequence transform of A291750, which means that this is the lexicographically least sequence a, such that for all i, j: a(i) = a(j) <=> A291750(i) = A291750(j) <=> A003557(i) = A003557(j) and A048250(i) = A048250(j). That this is equal to the definition given in the title follows because any such lexicographically least sequence satisfying relation <=> is also the least sequence satisfying relation => with the same parameters.
Sigma (A000203) and psi (A001615) are functions of this sequence. See comments in A291750 for the reason. For example, to find the value of A001615(n) when we know just a(n), but without knowing n, let m be the least i for which a(i) = a(n); then A001615(n) = A003991(A291750(m)) = A003557(m) * A048250(m).
LINKS
PROG
(PARI)
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; };
A003557(n) = n/factorback(factor(n)[, 1]); \\ From A003557
A048250(n) = if(n<1, 0, sumdiv(n, d, if(core(d)==d, d)));
A291750(n) = (1/2)*(2 + ((A003557(n)+A048250(n))^2) - A003557(n) - 3*A048250(n));
v291751 = rgs_transform(vector(65537, n, A291750(n)));
A291751(n) = v291751[n];
CROSSREFS
Differs from A286603 for the first time at n = 25, where a(25) = 21, while A286603(25) = 14.
KEYWORD
nonn
AUTHOR
Antti Karttunen, Sep 06 2017
EXTENSIONS
Name changed and comments added by Antti Karttunen, Nov 24 2018
STATUS
approved
Restricted growth sequence computed for filter-sequence A278219, related to run-lengths in the binary representation of n.
+10
20
1, 2, 3, 2, 3, 4, 5, 2, 3, 6, 7, 4, 5, 6, 5, 2, 3, 6, 8, 6, 7, 9, 10, 4, 5, 11, 10, 6, 5, 6, 5, 2, 3, 6, 8, 6, 8, 12, 13, 6, 7, 14, 15, 9, 10, 12, 10, 4, 5, 11, 13, 11, 10, 14, 13, 6, 5, 11, 10, 6, 5, 6, 5, 2, 3, 6, 8, 6, 8, 12, 13, 6, 8, 16, 17, 12, 13, 16, 13, 6, 7, 14, 17, 14, 15, 18, 19, 9, 10, 20, 21, 12, 10, 12, 10, 4, 5, 11, 13, 11, 13, 20, 22, 11, 10
OFFSET
0,2
COMMENTS
When filtering sequences (by equivalence class partitioning), this sequence can be used instead of A278219, because for all i, j it holds that: a(i) = a(j) <=> A278219(i) = A278219(j).
For example, for all i, j: a(i) = a(j) => A005811(i) = A005811(j). (The same is true for A073334, as it is a sequence computed from A005811).
MATHEMATICA
f[n_, i_, x_] := Which[n == 0, x, EvenQ@ n, f[n/2, i + 1, x], True, f[(n - 1)/2, i, x Prime@ i]]; g[n_] := If[n == 1, 1, Times @@ MapIndexed[Prime[First@ #2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]]]; With[{nn = 99}, Function[s, Table[Position[Keys@ s, k_ /; MemberQ[k, n]][[1, 1]], {n, nn}]]@ Map[#1 -> #2 & @@ # &, Transpose@ {Values@ #, Keys@ #}] &@ PositionIndex@ Table[g@ f[BitXor[n, Floor[n/2]], 1, 1], {n, 0, nn}]] (* Michael De Vlieger, May 12 2017, Version 10 *)
PROG
(PARI)
rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences, invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences, 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
A278222(n) = A046523(A005940(1+n));
A003188(n) = bitxor(n, n>>1);
write_to_bfile(0, rgs_transform(vector(65538, n, A278219(n-1))), "b286619.txt");
CROSSREFS
Cf. also A101296, A286603, A286605, A286610, A286621, A286622, A286626, A286378 for similarly constructed sequences.
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, May 11 2017
STATUS
approved
Restricted growth sequence computed for primorial base related filter-sequence A278226.
+10
20
1, 2, 2, 3, 4, 5, 2, 3, 3, 6, 5, 7, 4, 5, 5, 7, 8, 9, 10, 11, 11, 12, 13, 14, 15, 16, 16, 17, 18, 19, 2, 3, 3, 6, 5, 7, 3, 6, 6, 20, 7, 21, 5, 7, 7, 21, 9, 22, 11, 12, 12, 23, 14, 24, 16, 17, 17, 25, 19, 26, 4, 5, 5, 7, 8, 9, 5, 7, 7, 21, 9, 22, 8, 9, 9, 22, 27, 28, 13, 14, 14, 24, 29, 30, 18, 19, 19, 26, 31, 32, 10, 11, 11, 12, 13, 14, 11, 12, 12, 23, 14, 24
OFFSET
0,2
COMMENTS
When filtering sequences (by equivalence class partitioning), this sequence (with its modestly sized terms) can be used instead of A278226, because for all i, j it holds that: a(i) = a(j) <=> A278226(i) = A278226(j).
For example, for all i, j: a(i) = a(j) => A276150(i) = A276150(j).
MATHEMATICA
b = MixedRadix[Reverse@ Prime@ Range@ 12]; f[n_] := Times @@ MapIndexed[Prime[#2]^#1 &, Sort[FactorInteger[n][[All, -1]], Greater]] - Boole[n == 1]; With[{nn = 102}, Function[s, Table[Position[Keys@ s, k_ /; MemberQ[k, n]][[1, 1]], {n, nn}]]@ Map[#1 -> #2 & @@ # &, Transpose@ {Values@ #, Keys@ #}] &@ PositionIndex@ Table[Function[k, f[Times @@ Power @@@ # &@ Transpose@ {Prime@ Range@ Length@ k, Reverse@ k}]]@ IntegerDigits[n, b], {n, 0, nn}]] (* Michael De Vlieger, May 12 2017, Version 10.2 *)
PROG
(PARI)
rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences, invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences, 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])); }
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
A276086(n) = { my(i=0, m=1, pr=1, nextpr); while((n>0), i=i+1; nextpr = prime(i)*pr; if((n%nextpr), m*=(prime(i)^((n%nextpr)/pr)); n-=(n%nextpr)); pr=nextpr); m; };
write_to_bfile(0, rgs_transform(vector(30031, n, A278226(n-1))), "b286626.txt");
CROSSREFS
Cf. also A101296, A286603, A286605, A286610, A286619, A286621, A286622, A286378 for similarly constructed sequences.
KEYWORD
nonn,look
AUTHOR
Antti Karttunen, May 11 2017
STATUS
approved
Restricted growth sequence computed for Stern-polynomial related filter-sequence A278243.
+10
18
1, 2, 2, 3, 2, 4, 3, 5, 2, 6, 4, 7, 3, 8, 5, 9, 2, 10, 6, 11, 4, 12, 7, 13, 3, 13, 8, 14, 5, 15, 9, 16, 2, 17, 10, 18, 6, 19, 11, 20, 4, 21, 12, 22, 7, 23, 13, 24, 3, 24, 13, 25, 8, 26, 14, 27, 5, 28, 15, 29, 9, 30, 16, 31, 2, 32, 17, 33, 10, 34, 18, 35, 6, 36, 19, 37, 11, 38, 20, 39, 4, 40, 21, 41, 12, 42, 22, 43, 7, 44, 23, 45, 13, 46, 24, 47, 3, 47, 24, 48
OFFSET
0,2
COMMENTS
Construction: we start with a(0)=1 for A278243(0)=1, and then after, for n > 0, we use the least unused natural number k for a(n) if A278243(n) has not been encountered before, otherwise [whenever A278243(n) = A278243(m), for some m < n], we set a(n) = a(m).
When filtering sequences (by equivalence class partitioning), this sequence (with its modestly sized terms) can be used instead of A278243, because for all i, j it holds that: a(i) = a(j) <=> A278243(i) = A278243(j).
For example, for all i, j: a(i) = a(j) => A002487(i) = A002487(j).
For pairs of distinct primes p, q for which a(p) = a(q) see comments in A317945. - Antti Karttunen, Aug 12 2018
EXAMPLE
For n=1, A278243(1) = 2, which has not been encountered before, thus we allot for a(1) the least so far unused number, which is 2, thus a(1) = 2.
For n=2, A278243(2) = 2, which was already encountered as A278243(1), thus we set a(2) = a(1) = 2.
For n=3, A278243(3) = 6, which has not been encountered before, thus we allot for a(3) the least so far unused number, which is 3, thus a(3) = 3.
For n=23, A278243(23) = 2520, which has not been encountered before, thus we allot for a(23) the least so far unused number, which is 13, thus a(23) = 3.
For n=25, A278243(25) = 2520, which was already encountered at n=23, thus we set a(25) = a(23) = 13.
MATHEMATICA
a[n_] := a[n] = Which[n < 2, n + 1, EvenQ@ n, Times @@ Map[#1^#2 & @@ # &, FactorInteger[#] /. {p_, e_} /; e > 0 :> {Prime[PrimePi@ p + 1], e}] - Boole[# == 1] &@ a[n/2], True, a[#] a[# + 1] &[(n - 1)/2]]; With[{nn = 100}, Function[s, Table[Position[Keys@ s, k_ /; MemberQ[k, n]][[1, 1]], {n, nn}]]@ Map[#1 -> #2 & @@ # &, Transpose@ {Values@ #, Keys@ #}] &@ PositionIndex@ Table[Times @@ MapIndexed[Prime[First@#2]^#1 &, Sort[FactorInteger[#][[All, -1]], Greater]] - Boole[# == 1] &@ a@ n, {n, 0, nn}]] (* Michael De Vlieger, May 12 2017 *)
PROG
(PARI)
up_to = 65537;
rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences, invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences, 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])); }
A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ From A046523
A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
A260443(n) = if(n<2, n+1, if(n%2, A260443(n\2)*A260443(n\2+1), A003961(A260443(n\2))));
v286378 = rgs_transform(vector(up_to+1, n, A278243(n-1)));
A286378(n) = v286378[1+n];
CROSSREFS
Cf. also A101296, A286603, A286605, A286610, A286619, A286621, A286622, A286626 for similarly constructed sequences.
Differs from A103391(1+n) for the first time at n=25, where a(25)=13, while A103391(26) = 14.
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 09 2017
STATUS
approved
Restricted growth sequence computed for A033879 (deficiency), or equally, for A033880 (abundance of n).
+10
15
1, 1, 2, 1, 3, 4, 5, 1, 6, 2, 7, 8, 9, 3, 5, 1, 10, 11, 12, 13, 7, 14, 15, 16, 17, 7, 18, 4, 19, 16, 20, 1, 12, 18, 15, 21, 22, 10, 15, 23, 24, 16, 25, 3, 9, 26, 27, 28, 29, 30, 20, 5, 31, 16, 32, 33, 34, 35, 36, 37, 38, 19, 15, 1, 27, 16, 39, 7, 25, 8, 40, 41, 42, 34, 35, 9, 36, 16, 43, 44, 29, 32, 45, 46, 47, 24, 48, 8, 49, 50, 40, 10, 36, 51, 40, 52, 53
OFFSET
1,3
EXAMPLE
We start by setting a(1) = 1 for A033879(1) = 1. Then, whenever A033879(k) is equal to some A033879(m) with m < k, we set a(k) = a(m). Otherwise (when the value is a new one, not encountered before), we allot for a(k) the least natural number not present among a(1) .. a(k-1).
For n=2, as A033879(2) = 1, which was already present at A033879(1), we set a(2) = a(1) = 1.
For n=3, as A033879(3) = 2, which is a new value not encountered before, we set a(3) = 1 + max(a(1),a(2)) = 2.
For n=4, as A033879(4) = 1, which was already present at n = 2 and n = 1, we set a(4) = a(1) = 1.
For n=5, as A033879(5) = 4, which is a new value not encountered before, we set a(5) = 1 + max(a(1),a(2),a(3),a(4)) = 3.
For n=12, as A033879(12) = -4, which is a new value not encountered before, we set a(12) = 1 + max(a(1),...,a(11)) = 8. Note that the sign matters here; -4 is not equal to +4, which was encountered already at n=5.
PROG
(PARI)
rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences, invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences, 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])); }
A033879(n) = ((2*n)-sigma(n));
write_to_bfile(1, rgs_transform(vector(10000, n, A033879(n))), "b286449.txt");
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 13 2017
STATUS
approved
Restricted growth sequence computed for Euler totient function phi, A000010.
+10
10
1, 1, 2, 2, 3, 2, 4, 3, 4, 3, 5, 3, 6, 4, 7, 7, 8, 4, 9, 7, 6, 5, 10, 7, 11, 6, 9, 6, 12, 7, 13, 8, 11, 8, 14, 6, 15, 9, 14, 8, 16, 6, 17, 11, 14, 10, 18, 8, 17, 11, 19, 14, 20, 9, 16, 14, 15, 12, 21, 8, 22, 13, 15, 19, 23, 11, 24, 19, 25, 14, 26, 14, 27, 15, 16, 15, 22, 14, 28, 19, 29, 16, 30, 14, 31, 17, 32, 16, 33, 14, 27, 25, 22, 18, 27, 19, 34, 17, 22
OFFSET
1,3
LINKS
EXAMPLE
Construction: we start with a(1)=1 for phi(1)=1 (where phi = A000010), and then after, for all n > 1, whenever the value of phi(n) has not been encountered before, we set a(n) to the least natural number k not already in sequence among a(1) .. a(n-1), otherwise [whenever phi(n) = phi(m), for some m < n], we set a(n) = a(m), i.e., to the same value that was assigned to a(m).
For n=2, phi(2) = 1, which value was already encountered as phi(1), thus we set also a(2) = 1.
For n=3, phi(3) = 2, which has not been encountered before, thus we allot for a(3) the least so far unused number, which is 2, thus a(3) = 2.
For n=4, phi(4) = 2, which was already encountered as at n=3 for the first time, thus we set a(4) = a(3) = 2.
For n=5, phi(5) = 4, which has not been encountered before, thus we allot for a(5) the least so far unused number, which is now 3, thus a(5) = 3.
MATHEMATICA
With[{nn = 99}, Function[s, Table[Position[Keys@ s, k_ /; MemberQ[k, n]][[1, 1]], {n, nn}]]@ Map[#1 -> #2 & @@ # &, Transpose@ {Values@ #, Keys@ #}] &@ PositionIndex@ Array[EulerPhi, nn]] (* Michael De Vlieger, May 12 2017, Version 10 *)
PROG
(PARI)
rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences, invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences, 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])); }
A000010(n) = eulerphi(n);
write_to_bfile(1, rgs_transform(vector(10000, n, A000010(n))), "b286610.txt");
CROSSREFS
Cf. A000010, A210719 (positions of records, and also the first occurrence of each n).
Cf. also A101296, A286603, A286605, A286619, A286621, A286622, A286626, A286378 for similarly constructed sequences.
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 11 2017
STATUS
approved
Restricted growth sequence computed for number of divisors, d(n) (A000005).
+10
9
1, 2, 2, 3, 2, 4, 2, 4, 3, 4, 2, 5, 2, 4, 4, 6, 2, 5, 2, 5, 4, 4, 2, 7, 3, 4, 4, 5, 2, 7, 2, 5, 4, 4, 4, 8, 2, 4, 4, 7, 2, 7, 2, 5, 5, 4, 2, 9, 3, 5, 4, 5, 2, 7, 4, 7, 4, 4, 2, 10, 2, 4, 5, 11, 4, 7, 2, 5, 4, 7, 2, 10, 2, 4, 5, 5, 4, 7, 2, 9, 6, 4, 2, 10, 4, 4, 4, 7, 2, 10, 4, 5, 4, 4, 4, 10, 2, 5, 5, 8, 2, 7, 2, 7, 7, 4, 2, 10, 2, 7, 4, 9, 2, 7, 4, 5, 5, 4, 4
OFFSET
1,2
COMMENTS
For all i, j: A101296(i) = A101296(j) => a(i) = a(j).
For all i, j: a(i) = a(j) <=> A000005(i) = A000005(j).
LINKS
MATHEMATICA
With[{nn = 119}, Function[s, Table[Position[Keys@ s, k_ /; MemberQ[k, n]][[1, 1]], {n, nn}]]@ Map[#1 -> #2 & @@ # &, Transpose@ {Values@ #, Keys@ #}] &@ PositionIndex@ Array[DivisorSigma[0, #] &, nn]] (* Michael De Vlieger, May 12 2017, Version 10 *)
PROG
(PARI)
rgs_transform(invec) = { my(occurrences = Map(), outvec = vector(length(invec)), u=1); for(i=1, length(invec), if(mapisdefined(occurrences, invec[i]), my(pp = mapget(occurrences, invec[i])); outvec[i] = outvec[pp] , mapput(occurrences, 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])); }
A000005(n) = numdiv(n);
write_to_bfile(1, rgs_transform(vector(10000, n, A000005(n))), "b286605.txt");
CROSSREFS
Cf. A000005, A007416 (positions of records, and also the first occurrence of each n).
KEYWORD
nonn
AUTHOR
Antti Karttunen, May 11 2017
STATUS
approved

Search completed in 0.017 seconds