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 28 results. Next

A286454 Compound filter (prime signature & prime signature of conjugated prime factorization): a(n) = P(A101296(n), A286621(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 5, 8, 9, 12, 32, 23, 20, 13, 49, 38, 51, 47, 82, 49, 35, 68, 51, 80, 72, 124, 140, 122, 74, 18, 175, 26, 111, 155, 334, 192, 65, 257, 280, 82, 116, 255, 329, 355, 99, 327, 570, 380, 177, 72, 469, 437, 132, 31, 72, 532, 216, 498, 74, 257, 144, 599, 634, 597, 448, 632, 745, 159, 119, 784, 1044, 782, 331, 907, 570, 863, 186, 905, 1039, 72, 384, 140, 1335, 1037
Offset: 1

Views

Author

Antti Karttunen, May 14 2017

Keywords

Comments

Here, instead of A046523 and A278221 we use as the components of a(n) their rgs-versions A101296 and A286621 because of the latter sequence's moderate growth rates.
For all i, j: a(i) = a(j) => A286356(i) = A286356(j).

Crossrefs

Programs

Formula

a(n) = (1/2)*(2 + ((A101296(n)+A286621(n))^2) - A101296(n) - 3*A286621(n)).

A286455 Compound filter (smallest prime dividing n & prime signature of conjugated prime factorization): a(n) = P(A055396(n), A286621(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

0, 2, 8, 2, 18, 11, 40, 2, 8, 22, 71, 11, 97, 46, 30, 2, 143, 11, 179, 22, 93, 92, 262, 11, 18, 121, 8, 46, 335, 154, 417, 2, 212, 211, 69, 11, 540, 254, 302, 22, 679, 326, 794, 92, 30, 379, 918, 11, 40, 22, 467, 121, 1051, 11, 234, 46, 530, 529, 1242, 154, 1344, 631, 93, 2, 744, 704, 1615, 211, 822, 326, 1790, 11, 1912, 904, 30, 254, 140, 947, 2167, 22, 8
Offset: 1

Views

Author

Antti Karttunen, May 14 2017

Keywords

Comments

Note that as the other component of a(n) we use A286621 instead of A278221, because of latter sequence's unwieldy large terms.
For all i, j: a(i) = a(j) => A243055(i) = A243055(j).
For all i, j: a(i) = a(j) => A286470(i) = A286470(j).

Crossrefs

Programs

Formula

a(n) = (1/2)*(2 + ((A055396(n)+A286621(n))^2) - A055396(n) - 3*A286621(n)).

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

A286469 a(n) = maximum of {the index of least prime dividing n} and {the maximal gap between indices of the successive primes in the prime factorization of n}.

Original entry on oeis.org

0, 1, 2, 1, 3, 1, 4, 1, 2, 2, 5, 1, 6, 3, 2, 1, 7, 1, 8, 2, 2, 4, 9, 1, 3, 5, 2, 3, 10, 1, 11, 1, 3, 6, 3, 1, 12, 7, 4, 2, 13, 2, 14, 4, 2, 8, 15, 1, 4, 2, 5, 5, 16, 1, 3, 3, 6, 9, 17, 1, 18, 10, 2, 1, 3, 3, 19, 6, 7, 2, 20, 1, 21, 11, 2, 7, 4, 4, 22, 2, 2, 12, 23, 2, 4, 13, 8, 4, 24, 1, 4, 8, 9, 14, 5, 1, 25, 3, 3, 2, 26, 5, 27, 5, 2, 15, 28, 1, 29, 2, 10, 3
Offset: 1

Views

Author

Antti Karttunen, May 14 2017

Keywords

Comments

This gives the maximal gap between the indices of successive prime factors p_i <= p_j <= ... <= p_k of n = p_i * p_j * ... * p_k when the index of the least prime factor p_i (A055396) is considered as the initial gap from the "level zero".

Crossrefs

Programs

  • Python
    from sympy import primepi, isprime, primefactors, divisors
    def a049084(n): return primepi(n)*(1*isprime(n))
    def a055396(n): return 0 if n==1 else a049084(min(primefactors(n)))
    def x(n): return 1 if n==1 else divisors(n)[-2]
    def a286470(n): return 0 if n==1 or len(primefactors(n))==1 else max(a055396(x(n)) - a055396(n), a286470(x(n)))
    def a(n): return max(a055396(n), a286470(n)) # Indranil Ghosh, May 17 2017
  • Scheme
    (define (A286469 n) (max (A055396 n) (A286470 n)))
    

Formula

a(n) = max(A055396(n), A286470(n)).
a(n) = A051903(A122111(n)).
For all i, j: A286621(i) = A286621(j) => a(i) = a(j). [Because of the above formula.]

Extensions

Definition corrected May 17 2017

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");

A286378 Restricted growth sequence computed for Stern-polynomial related filter-sequence A278243.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 09 2017

Keywords

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

Examples

			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.
		

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.

Programs

  • 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 *)
  • 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))));
    A278243(n) = A046523(A260443(n));
    v286378 = rgs_transform(vector(up_to+1,n,A278243(n-1)));
    A286378(n) = v286378[1+n];

A305897 Lexicographically earliest infinite sequence such that a(i) = a(j) => A348717(i) = A348717(j), for all i, j >= 1.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Jun 14 2018

Keywords

Comments

Restricted growth sequence transform of A348717, or equally, of A246277.
Filter sequence for prime factorization patterns, including also information about gaps between prime factors. - Original name, gives the motivation for this sequence. Here the "gaps" refers to differences between the indices of primes present, not the prime gaps as usually understood.
For all i, j:
A305800(i) = A305800(j) => a(i) = a(j),
a(i) = a(j) => A077462(i) = A077462(j) => A101296(i) = A101296(j).
a(i) = a(j) => A243055(i) = A243055(j).

Examples

			a(10) = a(21) (= 6) because both have prime exponents [1, 1] and the difference between the prime indices is the same, as 10 = prime(1)*prime(3), and 21 = prime(2)*prime(4).
a(12) != a(18) because the prime exponents [2,1] and [1,2] do not occur in the same order.
a(140) = a(693) (= 71) because both numbers have prime exponents [2, 1, 1] (in this order) and the differences between the indices of the successive prime factors are same: 140 = prime(1)^2 * prime(3) * prime(4), 693 = prime(2)^2 * prime(4) * prime(5).
		

Crossrefs

Programs

  • PARI
    up_to = 65537;
    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; };
    A246277(n) = if(1==n, 0, my(f = factor(n), k = primepi(f[1,1])-1); for (i=1, #f~, f[i,1] = prime(primepi(f[i,1])-k)); factorback(f)/2);
    v305897 = rgs_transform(vector(up_to,n,A246277(n)));
    A305897(n) = v305897[n];

Extensions

Name changed by Antti Karttunen, Apr 30 2022
Showing 1-10 of 28 results. Next