cp's OEIS Frontend

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.

Showing 1-10 of 17 results. Next

A317942 a(n) = Product_{d|n, dA286378(d)-1).

Original entry on oeis.org

1, 2, 2, 4, 2, 12, 2, 8, 6, 20, 2, 72, 2, 28, 30, 16, 2, 396, 2, 200, 42, 52, 2, 432, 10, 68, 66, 392, 2, 17100, 2, 32, 78, 92, 70, 26136, 2, 116, 102, 2000, 2, 54684, 2, 1352, 6270, 148, 2, 2592, 14, 3700, 138, 2312, 2, 178596, 130, 5488, 174, 172, 2, 9747000, 2, 188, 14322, 64, 170, 322452, 2, 4232, 222, 289100, 2, 1724976, 2
Offset: 1

Views

Author

Antti Karttunen, Aug 12 2018

Keywords

Crossrefs

Cf. A286378, A317943 (restricted growth sequence transform), A317944.
Cf. also A293216, A305792.

Programs

  • PARI
    \\ Needs also code from A286378:
    A317942(n) = { my(m=1); fordiv(n,d,if(dA286378(d)-1))); (m); };

Formula

a(n) = Product_{d|n, dA008578(A286378(d)).
For all k >= 0, a(2^k) = 2^k.

A317944 a(n) = Product_{d|n, d>1} prime(A286378(d)-1).

Original entry on oeis.org

1, 2, 3, 4, 5, 18, 7, 8, 33, 50, 13, 108, 17, 98, 285, 16, 23, 2178, 29, 500, 651, 338, 37, 648, 185, 578, 1353, 1372, 43, 162450, 47, 32, 2067, 1058, 2065, 143748, 61, 1682, 3417, 5000, 71, 847602, 73, 8788, 247665, 2738, 83, 3888, 581, 68450, 6141, 19652, 97, 3661218, 6565, 19208, 8961, 3698, 107, 92596500, 109, 4418, 809193, 64
Offset: 1

Views

Author

Antti Karttunen, Aug 12 2018

Keywords

Crossrefs

Cf. A286378, A317942, A317945 (restricted growth sequence transform).
Cf. also A305794.

Programs

  • PARI
    \\ Needs also code from A286378:
    A317944(n) = { my(m=1); fordiv(n,d, if(d>1, m *= prime(A286378(d)-1))); (m); };

Formula

a(n) = Product_{d|n, d>1} A008578(A286378(d)).
For all k >= 0, a(2^k) = 2^k.

A101296 n has the a(n)-th distinct prime signature.

Original entry on oeis.org

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

Views

Author

David Wasserman, Dec 21 2004

Keywords

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

Examples

			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
		

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.

Programs

  • 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 *)
  • 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

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)

Extensions

Data section extended to 120 terms by Antti Karttunen, May 12 2017
Minor edits/corrections by M. F. Hasler, Jul 18 2019

A286622 Restricted growth sequence computed for filter-sequence A278222, related to 1-runs in the binary representation of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 11 2017

Keywords

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

Examples

			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.
		

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.

Programs

  • 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];

Extensions

Example section added by Antti Karttunen, Jun 04 2017

A324400 Lexicographically earliest sequence such that a(i) = a(j) => f(i) = f(j) for all i, j >= 1, where f(n) = -1 if n = 2^k and k > 0, and f(n) = n for all other numbers.

Original entry on oeis.org

1, 2, 3, 2, 4, 5, 6, 2, 7, 8, 9, 10, 11, 12, 13, 2, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 2, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 2, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78
Offset: 1

Views

Author

Antti Karttunen, Mar 01 2019

Keywords

Comments

In the following, A stands for this sequence, A324400, and S -> T (where S and T are sequence A-numbers) indicates that for all i, j >= 1: S(i) = S(i) => T(i) = T(j).
For example, the following chains of implications hold:
A -> A286619 -> A005811,
and
A -> A003602 -> A286622 -> A000120,
-> A323889,
-> A000593,
-> A001227,
among many others.

Crossrefs

Programs

  • PARI
    A000523(n) = if(n<1, 0, #binary(n)-1);
    A324400(n) = if(n<4,n,if(!bitand(n,n-1),2,1+n-A000523(n)));

Formula

If n <= 3, a(n) = n; and for n >= 4, if A209229(n) = 1, then a(n) = 2, otherwise a(n) = 1 + n - A000523(n).

A286621 Restricted growth sequence computed for filter-sequence A278221, related to the conjugated prime factorization (see A122111).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 11 2017

Keywords

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).

Examples

			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.
		

Crossrefs

Cf. also A101296, A286603, A286605, A286610, A286619, A286622, A286626, A286378 for similarly constructed sequences.

Programs

  • 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
    A278221(n) = A046523(A122111(n));
    write_to_bfile(1,rgs_transform(vector(10000,n,A278221(n))),"b286621.txt");

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).

A286603 Restricted growth sequence computed for sigma, A000203.

Original entry on oeis.org

1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 6, 11, 12, 13, 13, 14, 10, 15, 16, 17, 18, 19, 13, 20, 14, 17, 21, 22, 23, 24, 18, 25, 26, 27, 26, 28, 29, 20, 22, 30, 17, 31, 32, 33, 34, 24, 26, 35, 36, 37, 24, 38, 27, 39, 24, 39, 40, 30, 20, 41, 42, 31, 43, 44, 33, 45, 46, 47, 31, 45, 24, 48, 49, 50, 35, 51, 31, 41, 40, 52, 53, 47, 33, 54, 55, 56, 39, 57, 30, 58, 59, 41, 60
Offset: 1

Views

Author

Antti Karttunen, May 11 2017

Keywords

Comments

When filtering sequences (by equivalence class partitioning), this sequence can be used instead of A000203, because for all i, j it holds that: a(i) = a(j) <=> A000203(i) = A000203(j) <=> A286358(i) = A286358(j).
Note that the latter equivalence indicates that this is also the restricted growth sequence of A286358.

Examples

			Construction: we start with a(1)=1 for sigma(1)=1 (where sigma = A000203), and then after, for all n > 1, whenever the value of sigma(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 sigma(n) = sigma(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, sigma(2) = 3, not encountered before, thus we allot for a(2) the least so far unused number, which is 2, thus a(2) = 2.
For n=3, sigma(3) = 4, not encountered before, thus we allot for a(3) the least so far unused number, which is 3, thus a(3) = 3.
For n=4, sigma(4) = 7, not encountered before, thus we allot for a(4) the least so far unused number, which is 4, thus a(4) = 4.
For n=5, sigma(5) = 6, not encountered before, thus we allot for a(5) the least so far unused number, which is 5, thus a(5) = 5.
For n=6, sigma(6) = 12, not encountered before, thus we allot for a(6) the least so far unused number, which is 6, thus a(6) = 6.
And this continues for n=7..10 because also for those n sigma obtains fresh new values, so here a(n) = n up to n = 10.
But then comes n=11, where sigma(11) = 12, a value which was already encountered at n=6 for the first time, thus we set a(11) = a(6) = 6.
		

Crossrefs

Programs

  • Mathematica
    With[{nn = 93}, Function[s, Table[Position[Keys@ s, k_ /; MemberQ[k, n]][[1, 1]], {n, nn}]]@ Map[#1 -> #2 & @@ # &, Transpose@ {Values@ #, Keys@ #}] &@ PositionIndex@ Array[DivisorSigma[1, #] &, nn]] (* Michael De Vlieger, May 12 2017, Version 10 *)
  • PARI
    A000203(n) = sigma(n);
    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(10000,n,A000203(n))),"b286603.txt");

A286619 Restricted growth sequence computed for filter-sequence A278219, related to run-lengths in the binary representation of n.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 11 2017

Keywords

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).

Crossrefs

Cf. also A101296, A286603, A286605, A286610, A286621, A286622, A286626, A286378 for similarly constructed sequences.

Programs

  • 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 *)
  • 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);
    A278219(n) = A278222(A003188(n));
    write_to_bfile(0,rgs_transform(vector(65538,n,A278219(n-1))),"b286619.txt");

A286626 Restricted growth sequence computed for primorial base related filter-sequence A278226.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 11 2017

Keywords

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).

Crossrefs

Cf. also A101296, A286603, A286605, A286610, A286619, A286621, A286622, A286378 for similarly constructed sequences.

Programs

  • 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 *)
  • 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; };
    A278226(n) = A046523(A276086(n));
    write_to_bfile(0,rgs_transform(vector(30031,n,A278226(n-1))),"b286626.txt");

A286610 Restricted growth sequence computed for Euler totient function phi, A000010.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 11 2017

Keywords

Examples

			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.
		

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.

Programs

  • 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 *)
  • 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");
Showing 1-10 of 17 results. Next