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

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

A324390 Lexicographically earliest positive sequence such that a(i) = a(j) => A278219(i) = A278219(j) and A324386(i) = A324386(j), for all i, j >= 0.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Feb 27 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A278219(n), A324386(n)].

Crossrefs

Cf. also A286619, A324343, A324344, A324380 (compare the scatter-plots).

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; };
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t }; \\ From A005940
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); }; \\ From A046523
    A278222(n) = A046523(A005940(1+n));
    A003188(n) = bitxor(n, n>>1);
    A278219(n) = A278222(A003188(n));
    Aux324390(n) = [A278219(n), A324386(n)]; \\ See code for A324386 in that entry.
    v324390 = rgs_transform(vector(1+up_to,n,Aux324390(n-1)));
    A324390(n) = v324390[1+n];

Formula

a(A000225(n)) = 2 for all n >= 1.

A286242 Compound filter: a(n) = P(A278222(n), A278219(n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

1, 5, 12, 14, 12, 84, 40, 44, 12, 142, 216, 183, 40, 265, 86, 152, 12, 142, 826, 265, 216, 1860, 607, 489, 40, 832, 607, 1117, 86, 619, 226, 560, 12, 142, 826, 265, 826, 5080, 2497, 619, 216, 2956, 4308, 4155, 607, 8575, 1105, 1533, 40, 832, 2497, 2116, 607, 5731, 4501, 3475, 86, 1402, 1105, 3475, 226, 1759, 698, 2144, 12, 142, 826, 265, 826, 5080, 2497, 619, 826
Offset: 0

Views

Author

Antti Karttunen, May 07 2017

Keywords

Crossrefs

Programs

  • PARI
    A003188(n) = bitxor(n, n>>1);
    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));
    A278219(n) = A278222(A003188(n));
    A286242(n) = (2 + ((A278222(n)+A278219(n))^2) - A278222(n) - 3*A278219(n))/2;
    for(n=0, 16383, write("b286242.txt", n, " ", A286242(n)));
    
  • Python
    from sympy import prime, factorint
    import math
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    def P(n):
        f=factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a003188(n): return n^(n>>1)
    def a243353(n): return a005940(1 + a003188(n))
    def a278219(n): return a046523(a243353(n))
    def a278222(n): return a046523(a005940(n + 1))
    def a(n): return T(a278222(n), a278219(n)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A286242 n) (* (/ 1 2) (+ (expt (+ (A278222 n) (A278219 n)) 2) (- (A278222 n)) (- (* 3 (A278219 n))) 2)))
    

Formula

a(n) = (1/2)*(2 + ((A278222(n)+A278219(n))^2) - A278222(n) - 3*A278219(n)).
a(n) = (1/2)*(2 + ((A278222(n)+A278222(A003188(n)))^2) - A278222(n) - 3*A278222(A003188(n))).

A286554 Ordinal transform of A286619, or equally, of A278219.

Original entry on oeis.org

1, 1, 1, 2, 2, 1, 1, 3, 3, 1, 1, 2, 2, 2, 3, 4, 4, 3, 1, 4, 2, 1, 1, 3, 4, 1, 2, 5, 5, 6, 6, 5, 5, 7, 2, 8, 3, 1, 1, 9, 3, 1, 1, 2, 3, 2, 4, 4, 7, 2, 2, 3, 5, 2, 3, 10, 8, 4, 6, 11, 9, 12, 10, 6, 6, 13, 4, 14, 5, 3, 4, 15, 6, 1, 1, 4, 5, 2, 6, 16, 4, 3, 2, 4, 2, 1, 1, 3, 7, 1, 1, 5, 8, 6, 9, 5, 11, 5, 7, 6, 8, 2, 1, 7, 10, 3, 2, 5, 9, 3, 10, 17, 12, 8, 11, 9
Offset: 0

Views

Author

Antti Karttunen, May 21 2017

Keywords

Crossrefs

A352888 Lexicographically earliest infinite sequence such that a(i) = a(j) => A278219(A109812(i)) = A278219(A109812(j)), for all i, j >= 1.

Original entry on oeis.org

1, 2, 2, 1, 2, 3, 4, 2, 5, 6, 7, 5, 6, 5, 2, 1, 5, 6, 4, 3, 7, 6, 4, 8, 7, 6, 5, 1, 2, 9, 10, 7, 11, 12, 6, 9, 13, 7, 3, 5, 6, 7, 6, 5, 6, 9, 4, 6, 9, 2, 6, 12, 6, 5, 11, 7, 13, 14, 7, 15, 13, 12, 16, 9, 14, 11, 12, 5, 6, 7, 11, 12, 6, 5, 5, 1, 4, 13, 7, 8, 15, 16, 12, 11, 9, 10, 12, 11, 12, 10, 14, 17, 14, 16, 18
Offset: 1

Views

Author

Antti Karttunen, Apr 07 2022

Keywords

Comments

Restricted growth sequence transform of A278219(A109812(n)).
For all i, j: a(i) = a(j) => A352889(i) = A352889(j).

Crossrefs

Programs

  • 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; };
    v109812 = readvec("b109812_to10e5.txt"); \\ Prepared from b-file data with gawk ' { print $2 } '
    up_to = #v109812;
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A003188(n) = bitxor(n, n>>1);
    A278219(n) = A046523(A005940(1+A003188(n)));
    A109812(n) = v109812[n];
    v352888 = rgs_transform(vector(up_to, n, A278219(A109812(n))));
    A352888(n) = v352888[n];

A286241 Compound filter: a(n) = P(A278219(n), A278219(1+n)), where P(n,k) is sequence A000027 used as a pairing function.

Original entry on oeis.org

2, 12, 14, 12, 59, 86, 27, 12, 109, 363, 269, 86, 142, 148, 27, 12, 109, 1093, 1117, 363, 1097, 1517, 489, 86, 601, 1408, 619, 148, 142, 148, 27, 12, 109, 1093, 1117, 1093, 5707, 8587, 2545, 363, 1969, 6153, 4529, 1517, 4489, 4537, 489, 86, 601, 3946, 3976, 1408, 2509, 5719, 2545, 148, 601, 1408, 619, 148, 142, 148, 27, 12, 109, 1093, 1117, 1093, 5707, 8587
Offset: 0

Views

Author

Antti Karttunen, May 07 2017

Keywords

Crossrefs

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]]]; h[n_] := g@ f[BitXor[n, Floor[n/2]], 1, 1]; Map[(2 + (#1 + #2)^2 - #1 - 3 #2)/2 & @@ # & /@ # &, Table[{h[n], h[n + 1]}, {k, 12}, {n, k (k - 1)/2, k (k + 1)/2 - 1}]] // Flatten (* Michael De Vlieger, May 09 2017 *)
  • PARI
    A003188(n) = bitxor(n, n>>1);
    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));
    A278219(n) = A278222(A003188(n));
    A286241(n) = (2 + ((A278219(n)+A278219(1+n))^2) - A278219(n) - 3*A278219(1+n))/2;
    for(n=0, 16383, write("b286241.txt", n, " ", A286241(n)));
    
  • Python
    from sympy import prime, factorint
    import math
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a003188(n): return n^int(n/2)
    def a243353(n): return a005940(1 + a003188(n))
    def a278219(n): return a046523(a243353(n))
    def a(n): return T(a278219(n), a278219(n + 1)) # Indranil Ghosh, May 07 2017
  • Scheme
    (define (A286241 n) (* (/ 1 2) (+ (expt (+ (A278219 n) (A278219 (+ 1 n))) 2) (- (A278219 n)) (- (* 3 (A278219 (+ 1 n)))) 2)))
    

Formula

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

A278532 a(n) = A278219(A255056(n)).

Original entry on oeis.org

1, 4, 4, 6, 16, 6, 6, 36, 24, 24, 6, 6, 4, 36, 64, 24, 60, 60, 24, 6, 6, 4, 36, 144, 60, 64, 216, 24, 6, 60, 96, 60, 60, 60, 24, 6, 6, 4, 36, 144, 60, 144, 60, 60, 144, 64, 96, 216, 216, 24, 6, 60, 240, 210, 96, 360, 60, 6, 60, 96, 60, 60, 60, 24, 6, 6, 4, 36, 144, 60, 144, 60, 60, 900, 144, 360, 360, 60, 60, 144, 144, 240, 384, 96, 360, 216, 360, 216, 216, 24
Offset: 0

Views

Author

Antti Karttunen, Nov 30 2016

Keywords

Crossrefs

Programs

Formula

a(n) = A278219(A255056(n)).

A324533 Lexicographically earliest positive sequence such that a(i) = a(j) => A002487(i) = A002487(j) and A278219(i) = A278219(j), for all i, j >= 0.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, Mar 05 2019

Keywords

Comments

Restricted growth sequence transform of the ordered pair [A002487(n), A278219(n)].

Crossrefs

Cf. also A323889 (compare the scatterplots).

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; };
    A002487(n) = { my(a=1, b=0); while(n>0, if(bitand(n, 1), b+=a, a+=b); n>>=1); (b); }; \\ From A002487
    A005940(n) = { my(p=2, t=1); n--; until(!n\=2, if((n%2), (t*=p), p=nextprime(p+1))); t };
    A046523(n) = { my(f=vecsort(factor(n)[, 2], , 4), p); prod(i=1, #f, (p=nextprime(p+1))^f[i]); };  \\ From A046523
    A003188(n) = bitxor(n, n>>1);
    A278219(n) = A046523(A005940(1+A003188(n)));
    Aux324533(n) = [A002487(n), A278219(n)];
    v324533 = rgs_transform(vector(1+up_to,n,Aux324533(n-1)));
    A324533(n) = v324533[1+n];

Formula

For n >= 1, a(2^n) = 3.

A278222 The least number with the same prime signature as A005940(n+1).

Original entry on oeis.org

1, 2, 2, 4, 2, 6, 4, 8, 2, 6, 6, 12, 4, 12, 8, 16, 2, 6, 6, 12, 6, 30, 12, 24, 4, 12, 12, 36, 8, 24, 16, 32, 2, 6, 6, 12, 6, 30, 12, 24, 6, 30, 30, 60, 12, 60, 24, 48, 4, 12, 12, 36, 12, 60, 36, 72, 8, 24, 24, 72, 16, 48, 32, 64, 2, 6, 6, 12, 6, 30, 12, 24, 6, 30, 30, 60, 12, 60, 24, 48, 6, 30, 30, 60, 30, 210, 60, 120, 12, 60, 60, 180, 24, 120, 48, 96, 4, 12, 12
Offset: 0

Views

Author

Antti Karttunen, Nov 15 2016

Keywords

Comments

This sequence can be used for filtering certain base-2 related sequences, because it matches only with any such sequence b that can be computed as b(n) = f(A005940(n+1)), where f(n) is any function that depends only on the prime signature of n (some of these are listed under the index entry for "sequences computed from exponents in ...").
Matching in this context means that the sequence a matches with the sequence b iff for all i, j: a(i) = a(j) => b(i) = b(j). In other words, iff the sequence b partitions the natural numbers to the same or coarser equivalence classes (as/than the sequence a) by the distinct values it obtains.
Because the Doudna map n -> A005940(1+n) is an isomorphism from "unary-binary encoding of factorization" (see A156552) to the ordinary representation of the prime factorization of n, it follows that the equivalence classes of this sequence match with any such sequence b, where b(n) is computed from the lengths of 1-runs in the binary representation of n and the order of those 1-runs does not matter. Particularly, this holds for any sequence that is obtained as a "Run Length Transform", i.e., where b(n) = Product S(i), for some function S, where i runs through the lengths of runs of 1's in the binary expansion of n. See for example A227349.
However, this sequence itself is not a run length transform of any sequence (which can be seen for example from the fact that A046523 is not multiplicative).
Furthermore, this matches not only with sequences involving products of S(i), but with any sequence obtained with any commutative function applied cumulatively, like e.g., A000120 (binary weight, obtained in this case as Sum identity(i)), and A069010 (number of runs of 1's in binary representation of n, obtained as Sum signum(i)).

Crossrefs

Similar sequences: A278217, A278219 (other base-2 related variants), A069877 (base-10 related), A278226 (primorial base), A278234-A278236 (factorial base), A278243 (Stern polynomials), A278233 (factorization in ring GF(2)[X]), A046523 (factorization in Z).
Cf. also A286622 (rgs-transform of this sequence) and A286162, A286252, A286163, A286240, A286242, A286379, A286464, A286374, A286375, A286376, A286243, A286553 (various other sequences involving this sequence).
Sequences that partition N into same or coarser equivalence classes: too many to list all here (over a hundred). At least every sequence listed under index-entry "Run Length Transforms" is included (e.g., A227349, A246660, A278159), and also sequences like A000120 and A069010, and their combinations like A136277.

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]]; Array[If[# == 1, 1, Times @@ MapIndexed[ Prime[First[#2]]^#1 &, Sort[FactorInteger[#][[All, -1]], Greater]]] &@ f[# - 1, 1, 1] &, 99] (* Michael De Vlieger, May 09 2017 *)
  • PARI
    A046523(n)=factorback(primes(#n=vecsort(factor(n)[, 2], , 4)), n)
    a(n)=my(p=2, t=1); for(i=0,exponent(n), if(bittest(n,i), t*=p, p=nextprime(p+1))); A046523(t) \\ Charles R Greathouse IV, Nov 11 2021
  • Python
    from sympy import prime, factorint
    import math
    def A(n): return n - 2**int(math.floor(math.log(n, 2)))
    def b(n): return n + 1 if n<2 else prime(1 + (len(bin(n)[2:]) - bin(n)[2:].count("1"))) * b(A(n))
    def a005940(n): return b(n - 1)
    def P(n):
        f = factorint(n)
        return sorted([f[i] for i in f])
    def a046523(n):
        x=1
        while True:
            if P(n) == P(x): return x
            else: x+=1
    def a(n): return a046523(a005940(n + 1)) # Indranil Ghosh, May 05 2017
    
  • Scheme
    (define (A278222 n) (A046523 (A005940 (+ 1 n))))
    

Formula

a(n) = A046523(A005940(1+n)).
a(n) = A124859(A278159(n)).
a(n) = A278219(A006068(n)).

Extensions

Misleading part of the name removed by Antti Karttunen, Apr 07 2022

A278220 Filtering sequence (related to prime factorization): a(n) = A046523(A241909(n)).

Original entry on oeis.org

1, 2, 4, 2, 8, 4, 16, 2, 6, 8, 32, 4, 64, 16, 12, 2, 128, 6, 256, 8, 24, 32, 512, 4, 12, 64, 6, 16, 1024, 12, 2048, 2, 48, 128, 36, 6, 4096, 256, 96, 8, 8192, 24, 16384, 32, 12, 512, 32768, 4, 24, 12, 192, 64, 65536, 6, 72, 16, 384, 1024, 131072, 12, 262144, 2048, 24, 2, 144, 48, 524288, 128, 768, 36, 1048576, 6, 2097152, 4096, 30, 256, 72, 96, 4194304, 8, 6, 8192
Offset: 1

Views

Author

Antti Karttunen, Nov 16 2016

Keywords

Crossrefs

Programs

Formula

a(n) = A046523(A241909(n)).
a(n) = A278219(A075158(n-1)).
Showing 1-10 of 16 results. Next