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

A339013 Class number m containing n in a partitioning of the natural numbers into classes B_m by William J. Keith.

Original entry on oeis.org

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

Views

Author

Kevin Ryde, Nov 19 2020

Keywords

Comments

a(n)=m when n is in class B_m. Keith's residues formula in lemma 1 is equivalent to requiring that n-1 in factorial base representation ends in m-2 nonzero digits, so m = A339012(n-1) + 2.
a(n)=m iff n mod m! is among certain residue classes determined by m. The residues for A339012 are rows of A227157 and here add +1 to each residue (mod m!). For example 3 or 5 (mod 24) in A339012 becomes here 4 or 6 (mod 24).
The frequency of appearance of the term k = 2, 3, ... in this sequence is 1/(k*(k-1)). - Amiram Eldar, Feb 15 2021

Crossrefs

Cf. A005408 (class B_2), A016933 (class B_3).
Cf. A161189 (class number in partition A_k), A339012.

Programs

  • Mathematica
    a[n_] := Module[{k = n - 1, m = 2, r}, While[{k, r} = QuotientRemainder[k, m]; r != 0, m++]; m]; Array[a, 30] (* Amiram Eldar, Feb 15 2021 after Kevin Ryde's PARI code *)
  • PARI
    a(n) = n--; my(b=2,r); while([n,r]=divrem(n,b);r!=0, b++); b;

Formula

a(n) = A339012(n-1) + 2.
a(n) = m iff n == 1 + Sum_{j=1..m-2} d[j]*j! (mod m!) with d[j] in ranges 1 <= d[j] <= j. [Keith, section 2.1 lemma 1]
a(n)=2 iff n mod 2 = 1. [Keith section 4 residues].
a(n)=3 iff n mod 6 = 2.
a(n)=4 iff n mod 24 = 4 or 6.
a(n)=5 iff n mod 120 = any of 10, 12, 16, 18, 22, 24.

A215887 Written in decimal, n ends in a(n) consecutive nonzero digits.

Original entry on oeis.org

0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 0
Offset: 0

Views

Author

M. F. Hasler, Aug 25 2012

Keywords

Comments

Sequences A215879, A215883 and A215884 are the base 3, 4 and 5 analogs, while the base 2 analog of this sequence coincides (up to a shift in the index) with the 2-adic valuation A007814, see comments there.
Starting indexing with k=0 for the rightmost digit, a(n) gives the index of the least significant zero in the decimal representation of n. This may also be the index of the leading zero if there are no zeros in the number itself (A052382). - Antti Karttunen, Dec 07 2017
First occurrence of k is A002275(k). - Robert G. Wilson v, Dec 07 2017

Examples

			Numbers which are multiples of 10 have no nonzero digit at their (right) end, thus a(10*k) = 0.
If numbers are congruent to 1,...,9 mod 100, then they end in a nonzero digit, but do not have more than 1 concatenated nonzero digits at their right end: Thus, a(100k+m)=1 for 0 < m < 10.
In the same way, a(k*10^(e+1)+m) = e if 10^e > m > 10^(e-1).
		

Crossrefs

Cf. A002275, A052382, A339012 (factorial base).

Programs

  • Mathematica
    Table[Which[Divisible[n,10],0,FreeQ[IntegerDigits[n],0], IntegerLength[ n], True, Position[ Reverse[ IntegerDigits[n]],0]-1],{n,0,110}] // Flatten (* Harvey P. Dale, Sep 05 2017 *)
    f[n_] := Block[{c = 0, m = n}, While[Mod[m, 10] > 0, m = Floor[m/10]; c++]; c]; Array[f, 105, 0] (* Robert G. Wilson v, Dec 07 2017 *)
  • PARI
    a(n,b=10)= n=divrem(n,b); for(c=0,9e9, n[2] || return(c); n=divrem(n[1],b))
    
  • PARI
    a(n)=my(k);while(n%10, n\=10; k++); k \\ Charles R Greathouse IV, Sep 26 2013

Extensions

More terms from Antti Karttunen, Dec 07 2017
Showing 1-2 of 2 results.