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

A304102 a(n) = Product_{d|n, dA304101(d)-1).

Original entry on oeis.org

1, 2, 2, 4, 2, 8, 2, 12, 4, 8, 2, 120, 2, 12, 8, 24, 2, 200, 2, 120, 12, 12, 2, 1680, 4, 8, 20, 180, 2, 2000, 2, 120, 12, 44, 12, 12600, 2, 44, 8, 1680, 2, 1200, 2, 180, 200, 20, 2, 42000, 6, 440, 44, 120, 2, 7800, 12, 3960, 44, 12, 2, 3234000, 2, 44, 120, 840, 8, 10200, 2, 264, 20, 3000, 2, 630000, 2, 20, 440, 1452, 18, 2000, 2, 109200, 260, 44, 2, 1386000
Offset: 1

Views

Author

Antti Karttunen, May 13 2018

Keywords

Crossrefs

Cf. A304101, A304103 (restricted growth sequence transform of this sequence), A304104.

Programs

  • PARI
    \\ Needs also code from A304101:
    A304102(n) = { my(m=1); fordiv(n,d,if(dA304101(d)-1))); (m); };

Formula

a(n) = Product_{d|n, dA000040(A304101(d)-1).
a(n) = 2*A304104(n) / A000040(A304101(n)-1).
Other identities. For all n >= 1:
A001222(a(n)) = A032741(n).
A007814(a(n)) = A293435(n).
A007949(a(n)) = A304095(n).

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

Original entry on oeis.org

1, 2, 2, 6, 2, 20, 3, 12, 10, 20, 3, 420, 2, 30, 20, 60, 11, 300, 11, 420, 12, 30, 5, 4200, 22, 20, 130, 990, 3, 11000, 11, 420, 102, 44, 30, 31500, 5, 242, 20, 10920, 11, 3000, 13, 1170, 1100, 190, 3, 231000, 33, 2420, 506, 420, 19, 66300, 12, 9900, 110, 30, 11, 8085000, 13, 242, 300, 5460, 52, 56100, 19, 660, 130, 19500, 13, 9135000, 11, 290, 4180, 2178, 99
Offset: 1

Views

Author

Antti Karttunen, May 13 2018

Keywords

Crossrefs

Cf. A304101, A304102, A304105 (restricted growth sequence transform of this sequence).

Programs

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

Formula

a(n) = Product_{d|n, d>1} A000040(A304101(d)-1).
a(n) = (1/2) * A304102(n) * A000040(A304101(n)-1).
Other identities. For all n >= 1:
A001222(a(n)) = A032741(n).
A001511(a(n)) = A005086(n).
A007949(a(n)) = A304096(n).

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

A048679 Compressed fibbinary numbers (A003714), with rewrite 0->0, 01->1 applied to their binary expansion.

Original entry on oeis.org

0, 1, 2, 4, 3, 8, 5, 6, 16, 9, 10, 12, 7, 32, 17, 18, 20, 11, 24, 13, 14, 64, 33, 34, 36, 19, 40, 21, 22, 48, 25, 26, 28, 15, 128, 65, 66, 68, 35, 72, 37, 38, 80, 41, 42, 44, 23, 96, 49, 50, 52, 27, 56, 29, 30, 256, 129, 130, 132, 67, 136, 69, 70, 144, 73, 74, 76, 39, 160, 81
Offset: 0

Views

Author

Keywords

Comments

Permutation of the nonnegative integers (A001477); inverse permutation of A048680 i.e. A048679[ A048680[ n ] ] = n for all n.

Crossrefs

Programs

  • Maple
    a(n) = rewrite_0to0_x1to1(fibbinary(j)) (where fibbinary(j) = A003714[ n ])
    rewrite_0to0_x1to1 := proc(n) option remember; if(0 = n) then RETURN(n); else RETURN((2 * rewrite_0to0_x1to1(floor(n/(2^(1+(n mod 2)))))) + (n mod 2)); fi; end;
    fastfib := n -> round((((sqrt(5)+1)/2)^n)/sqrt(5)); fibinv_appr := n -> floor(log[ (sqrt(5)+1)/2 ](sqrt(5)*n)); fibinv := n -> (fibinv_appr(n) + floor(n/fastfib(1+fibinv_appr(n)))); fibbinary := proc(n) option remember; if(n <= 2) then RETURN(n); else RETURN((2^(fibinv(n)-2))+fibbinary_seq(n-fastfib(fibinv(n)))); fi; end;
    # second Maple program:
    b:= proc(n) is(n=0) end:
    a:= proc(n) option remember; local h; h:= iquo(a(n-1), 2)+1;
          while b(h) do h:= h*2 od; b(h):=true; h
        end: a(0):=0:
    seq(a(n), n=0..100);  # Alois P. Heinz, Sep 22 2014
  • Mathematica
    b[n_] := n==0; a[n_] := a[n] = Module[{h}, h = Quotient[a[n-1], 2] + 1; While[b[h], h = h*2]; b[h] = True; h]; a[0]=0; Table[a[n], {n, 0, 100}] (* Jean-François Alcover, Feb 27 2016, after Alois P. Heinz *)
  • PARI
    A072649(n) = { my(m); if(n<1, 0, m=0; until(fibonacci(m)>n, m++); m-2); }; \\ From A072649
    A003714(n) = { my(s=0,w); while(n>2, w = A072649(n); s += 2^(w-1); n -= fibonacci(w+1)); (s+n); }
    A007814(n) = valuation(n,2);
    A000265(n) = (n/2^valuation(n, 2));
    A106151(n) = if(n<=1,n,if(n%2,1+(2*A106151((n-1)/2)),(2^(A007814(n)-1))*A106151(A000265(n))));
    A048679(n) = if(!n,n,A106151(2*A003714(n))); \\ Antti Karttunen, May 13 2018, after Reinhard Zumkeller's May 09 2005 formula.
    
  • Python
    from itertools import count, islice
    def A048679_gen(): # generator of terms
        return map(lambda n: int(bin(n)[2:].replace('01','1'),2),filter(lambda n:not (n<<1)&n,count(0)))
    A048679_list = list(islice(A048679_gen(),20)) # Chai Wah Wu, Mar 18 2024
    
  • Python
    def A048679(n):
        tlist, s = [1,2], 0
        while tlist[-1]+tlist[-2] <= n: tlist.append(tlist[-1]+tlist[-2])
        for d in tlist[::-1]:
            if d <= n:
                s += 1
                n -= d
            else:
                s <<= 1
        return s # Chai Wah Wu, Apr 24 2025

Formula

a(n) = A106151(2*A003714(n)) for n > 0. - Reinhard Zumkeller, May 09 2005
a(n+1) = min{([a(n)/2]+1)*2^k} such that it is not yet in the sequence. - Gerard Orriols, Jun 07 2014
a(n) = A072650(A003714(n)) = A003188(A227351(n)). - Antti Karttunen, May 13 2018

A304105 Restricted growth sequence transform of A304104, a filter sequence related to how the divisors of n are expressed in Fibonacci number system.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 13 2018

Keywords

Crossrefs

Programs

  • PARI
    \\ Needs also code from A304101:
    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; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A304104(n) = { my(m=1); fordiv(n,d,if(d>1, m *= prime(A304101(d)-1))); (m); };
    write_to_bfile(1,rgs_transform(vector(up_to,n,A304104(n))),"b304105.txt");

Formula

For all i, j: a(i) = a(j) => b(i) = b(j), where b can be any of {A000005, A005086, A304096 or A300837} for example.

A304103 Restricted growth sequence transform of A304102, a filter sequence related to the proper divisors of n expressed in Fibonacci number system.

Original entry on oeis.org

1, 2, 2, 3, 2, 4, 2, 5, 3, 4, 2, 6, 2, 5, 4, 7, 2, 8, 2, 6, 5, 5, 2, 9, 3, 4, 10, 11, 2, 12, 2, 6, 5, 13, 5, 14, 2, 13, 4, 9, 2, 15, 2, 11, 8, 10, 2, 16, 17, 18, 13, 6, 2, 19, 5, 20, 13, 5, 2, 21, 2, 13, 6, 22, 4, 23, 2, 24, 10, 25, 2, 26, 2, 10, 18, 27, 28, 12, 2, 29, 30, 13, 2, 31, 13, 32, 5, 33, 2, 34, 5, 35, 13, 5, 13, 21, 2, 36, 37, 38, 2, 39, 2, 9, 15
Offset: 1

Views

Author

Antti Karttunen, May 13 2018

Keywords

Comments

For all i, j: a(i) = a(j) => b(i) = b(j), where b can be any of {A000005, A293435, A304095 or A300836} for example.

Crossrefs

Cf. also A300835, A304105, A305800.
Cf. A305793 (analogous filter for base 2).

Programs

  • PARI
    \\ Needs also code from A304101.
    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; };
    write_to_bfile(start_offset,vec,bfilename) = { for(n=1, length(vec), write(bfilename, (n+start_offset)-1, " ", vec[n])); }
    A304102(n) = { my(m=1); fordiv(n,d,if(dA304101(d)-1))); (m); };
    write_to_bfile(1,rgs_transform(vector(up_to,n,A304102(n))),"b304103.txt");

A304100 a(n) = A003602(A048679(n)).

Original entry on oeis.org

1, 1, 1, 2, 1, 3, 2, 1, 5, 3, 2, 4, 1, 9, 5, 3, 6, 2, 7, 4, 1, 17, 9, 5, 10, 3, 11, 6, 2, 13, 7, 4, 8, 1, 33, 17, 9, 18, 5, 19, 10, 3, 21, 11, 6, 12, 2, 25, 13, 7, 14, 4, 15, 8, 1, 65, 33, 17, 34, 9, 35, 18, 5, 37, 19, 10, 20, 3, 41, 21, 11, 22, 6, 23, 12, 2, 49, 25, 13, 26, 7, 27, 14, 4, 29, 15, 8, 16, 1, 129, 65, 33, 66, 17, 67, 34, 9, 69, 35, 18, 36, 5, 73
Offset: 1

Views

Author

Antti Karttunen, May 13 2018

Keywords

Comments

Positions of ones is given by the positive Fibonacci numbers: 1, 2, 3, 5, 8, 13, 21, ..., that is, A000045(n) from n >= 2 onward.
Positions of 2's is given by Lucas numbers larger than 3: 4, 7, 11, 18, ..., that is, A000032(n) from n >= 3 onward.
The restricted growth sequence transform of this sequence (almost certainly) is A003603.

Crossrefs

Programs

Formula

a(n) = A003602(A048679(n)).
For all i, j: a(i) = a(j) => A304101(i) = A304101(j).

A318831 Restricted growth sequence transform of A278222(A000010(n)).

Original entry on oeis.org

1, 1, 1, 1, 1, 1, 2, 1, 2, 1, 3, 1, 2, 2, 1, 1, 1, 2, 3, 1, 2, 3, 4, 1, 3, 2, 3, 2, 5, 1, 6, 1, 3, 1, 2, 2, 3, 3, 2, 1, 3, 2, 7, 3, 2, 4, 8, 1, 7, 3, 1, 2, 4, 3, 3, 2, 3, 5, 8, 1, 6, 6, 3, 1, 2, 3, 3, 1, 4, 2, 4, 2, 3, 3, 3, 3, 6, 2, 8, 1, 9, 3, 7, 2, 1, 7, 5, 3, 4, 2, 3, 4, 6, 8, 3, 1, 2, 7, 6, 3, 4, 1, 9, 2, 2
Offset: 1

Views

Author

Antti Karttunen, Sep 04 2018

Keywords

Comments

Sequence allots a distinct value for each distinct multiset formed from the lengths of 1-runs in the binary expansion of A000010(n).
For all i, j: a(i) = a(j) => A295660(i) = A295660(j).

Crossrefs

Compare also with the scatterplots of A286622, A304101 and A318832.

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 };
    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));
    v318831 = rgs_transform(vector(up_to,n,A278222(eulerphi(n))));
    A318831(n) = v318831[n];

A304738 Restricted growth sequence transform of A278222(A048673(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 18 2018

Keywords

Comments

Sequence allots a distinct value for each distinct multiset formed from the lengths of 1-runs in the binary representation of A048673(n). Compare to the scatter plot of A286622.

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; };
    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
    A278222(n) = A046523(A005940(1+n));
    A003961(n) = my(f = factor(n)); for (i=1, #f~, f[i, 1] = nextprime(f[i, 1]+1)); factorback(f); \\ From A003961
    A048673(n) = (A003961(n)+1)/2;
    v304738 = rgs_transform(vector(65539,n,A278222(A048673(n))));
    A304738(n) = v304738[n];

A305820 Filter sequence for a(Fibonacci numbers > 1) = constant sequences.

Original entry on oeis.org

0, 1, 2, 2, 3, 2, 4, 5, 2, 6, 7, 8, 9, 2, 10, 11, 12, 13, 14, 15, 16, 2, 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, 2, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 2, 82, 83, 84, 85, 86
Offset: 0

Views

Author

Antti Karttunen, Jun 16 2018

Keywords

Comments

For all i, j:
a(i) = a(j) => A003603(i) = A003603(j) => A304101(i) = A304101(j) => A007895(i) = A007895(j).

Crossrefs

Programs

  • PARI
    A010056(n) = { my(k=n^2); k+=(k+1)<<2; (issquare(k) || (n>0 && issquare(k-8))) }; \\ From A010056
    A072649(n) = { my(m); if(n<1, 0, m=0; until(fibonacci(m)>n, m++); m-2); }; \\ From A072649
    A305820(n) = if(n<=1, n, if(1==A010056(n),2,2+n-A072649(n)));

Formula

a(0)= 0, a(1) = 1, for n > 1, a(n) = 2 if n is a Fibonacci number > 1, otherwise a(n) = 2+n-A072649(n) = running count from 3 onward for non-Fibonacci numbers.
Showing 1-10 of 12 results. Next