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-3 of 3 results.

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

A286357 One more than the exponent of the highest power of 2 dividing sigma(n): a(n) = A001511(A000203(n)).

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 10 2017

Keywords

Crossrefs

Programs

  • Mathematica
    Table[IntegerExponent[DivisorSigma[1,n],2]+1,{n,120}] (* Harvey P. Dale, Sep 04 2023 *)
  • PARI
    A001511(n) = (1+valuation(n,2));
    A286357(n) = A001511(sigma(n));
    for(n=1, 10000, write("b286357.txt", n, " ", A286357(n)));
    
  • Python
    from sympy import divisor_sigma as D
    def a001511(n): return bin(n)[2:][::-1].index("1") + 1
    def a(n): return a001511(D(n)) # Indranil Ghosh, May 12 2017
    
  • Python
    from sympy import divisor_sigma
    def A286357(n): return ((m:=int(divisor_sigma(n)))&-m).bit_length() # Chai Wah Wu, Jul 10 2022
  • Scheme
    (define (A286357 n) (A001511 (A000203 n)))
    (define (A286357 n) (A070939 (/ (A000203 n) (A161942 n))))
    

Formula

a(n) = A001511(A000203(n)).
a(n) = 1 + A000523(A000203(n)/A161942(n)). [See also A082903.]
a(n) = 1 iff A053866(n) = 1.

A286451 Compound filter (2-adic valuation of sigma(n) & 2-adic valuation of n): a(n) = P(A286357(n), A001511(n)), where P(n,k) is sequence A000027 used as a pairing function, with a(1) = 0 by an explicit convention.

Original entry on oeis.org

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

Views

Author

Antti Karttunen, May 13 2017

Keywords

Crossrefs

Programs

  • PARI
    A001511(n) = (1+valuation(n,2));
    A286357(n) = A001511(sigma(n));
    A286451(n) = if(1==n,0,(1/2)*(2 + ((A286357(n)+A001511(n))^2) - A286357(n) - 3*A001511(n)));
    for(n=1, 10000, write("b286451.txt", n, " ", A286451(n)));
    
  • Python
    from sympy import divisor_sigma as D
    def T(n, m): return ((n + m)**2 - n - 3*m + 2)/2
    def a001511(n): return bin(n)[2:][::-1].index("1") + 1
    def a(n): return 0 if n==1 else T(a001511(D(n)), a001511(n)) # Indranil Ghosh, May 14 2017
  • Scheme
    (define (A286451 n) (if (= 1 n) 0 (* (/ 1 2) (+ (expt (+ (A286357 n) (A001511 n)) 2) (- (A286357 n)) (- (* 3 (A001511 n))) 2))))
    

Formula

a(1) = 0; for n > 1, a(n) = (1/2)*(2 + ((A286357(n)+A001511(n))^2) - A286357(n) - 3*A001511(n)).
Showing 1-3 of 3 results.